Got some sonoff devices last week. I flashed them with Tasmota FW and all works well with the pimatic-mqtt-plugin. Also the status in pimatic is updating correctly over mqtt.
Big thanks @wutu
Sonoff 10A
{
"class": "MqttSwitch",
"id": "mqttsonoffswitch",
"name": "MqttSonoffSwitch",
"topic": "cmnd/sonoff/Power",
"stateTopic": "stat/sonoff/POWER",
"onMessage": "ON",
"offMessage": "OFF"
},
Sonoff POW
{
"class": "MqttSwitch",
"id": "mqttsonoffPOWswitch",
"name": "MqttSonoffPowSwitch",
"topic": "cmnd/sonoffPOW/Power",
"stateTopic": "stat/sonoffPOW/POWER",
"onMessage": "ON",
"offMessage": "OFF"
},
{
"class": "MqttSensor",
"id": "mqttsonoffPOWinfo",
"name": "MqttSonoffPowInfo",
"attributes": [
{
"name": "ENERGY.Yesterday",
"topic": "tele/sonoffPOW/SENSOR",
"type": "number",
"unit": "kWh",
"acronym": "Gestern"
},
{
"name": "ENERGY.Today",
"topic": "tele/sonoffPOW/SENSOR",
"type": "number",
"unit": "kWh",
"acronym": "Heute"
},
{
"name": "ENERGY.Current",
"topic": "tele/sonoffPOW/SENSOR",
"type": "number",
"unit": "A",
"acronym": "I"
},
{
"name": "ENERGY.Voltage",
"topic": "tele/sonoffPOW/SENSOR",
"type": "number",
"unit": "V",
"acronym": "U"
},
{
"name": "ENERGY.Power",
"topic": "tele/sonoffPOW/SENSOR",
"type": "number",
"unit": "W",
"acronym": "P"
}
]
},
By default the device sends every 5 minutes the energy data. You can change this interval with the command TelePeriod <seconds>
in the console or by url http://<ip>/cm?cmnd=TelePeriod <seconds>
Sonoff 4CH for DIN Rail (Hutschine)
This device has a ESP8285. When flashing with Arduino, select “Generic ESP8285 Module” as boardtype. It seems that the labeling for TX/RX on the circuit board are reversed. I had to connect TX<–>TX RX<–>RX.
{
"class": "MqttSwitch",
"id": "mqttsonoff4chSswitch1",
"name": "MqttSonoff4chSwitch1",
"topic": "cmnd/sonoff4ch/Power1",
"stateTopic": "stat/sonoff4ch/POWER1",
"onMessage": "ON",
"offMessage": "OFF"
},
{
"class": "MqttSwitch",
"id": "mqttsonoff4chSswitch2",
"name": "MqttSonoff4chSwitch2",
"topic": "cmnd/sonoff4ch/Power2",
"stateTopic": "stat/sonoff4ch/POWER2",
"onMessage": "ON",
"offMessage": "OFF"
},
{
"class": "MqttSwitch",
"id": "mqttsonoff4chSswitch3",
"name": "MqttSonoff4chSwitch3",
"topic": "cmnd/sonoff4ch/Power3",
"stateTopic": "stat/sonoff4ch/POWER3",
"onMessage": "ON",
"offMessage": "OFF"
},
{
"class": "MqttSwitch",
"id": "mqttsonoff4chSswitch4",
"name": "MqttSonoff4chSwitch4",
"topic": "cmnd/sonoff4ch/Power4",
"stateTopic": "stat/sonoff4ch/POWER4",
"onMessage": "ON",
"offMessage": "OFF"
},
{
"name": "MQTTButtons",
"id": "mqtt-4ch-buttons",
"class": "MqttButtons",
"buttons": [
{
"id": "mqtt-sonoff4ch-button1",
"text": "1",
"topic": "cmnd/sonoff4ch/POWER1",
"message": "2",
"stateTopic": "stat/sonoff4ch/POWER1"
},
{
"id": "mqtt-sonoff4ch-button2",
"text": "2",
"topic": "cmnd/sonoff4ch/POWER2",
"message": "2",
"stateTopic": "stat/sonoff4ch/POWER2"
},
{
"id": "mqtt-sonoff4ch-button3",
"text": "3",
"topic": "cmnd/sonoff4ch/POWER3",
"message": "2",
"stateTopic": "stat/sonoff4ch/POWER3"
},
{
"id": "mqtt-sonoff4ch-button4",
"text": "4",
"topic": "cmnd/sonoff4ch/POWER4",
"message": "2",
"stateTopic": "stat/sonoff4ch/POWER4"
}
]
}
Sonoff Wifi Touch
To enter the flashmode connect GPIO0 to Ground.
Sonoff DUAL
To enter flashmode connect GPIO0 to GND