Hallo,
ich habe ein Problem beim auslesen der Stromwerte (Sonoff POW R2) über mqtt, welcher auf einem Raspberry läuft und Daten weiter an Homebridge senden soll. Ein/Ausschalten geht über Homebridge bzw. EVE, jedoch werden die Stromwerte nicht übermittelt. Sending / Received funktioniert, jedoch nicht die kompletten Daten, siehe hier die Informationen vom MQTT:
1549358735: Received PINGREQ from sonoff
1549358735: Sending PINGRESP to sonoff
1549358740: Received PUBLISH from sonoff (d0, q0, r0, m0, 'tele/sonoff/STATE', ... (211 bytes))
1549358740: Sending PUBLISH to mqttjs_ed8ec08a (d0, q0, r0, m0, 'tele/sonoff/STATE', ... (211 bytes))
1549358740: Received PUBLISH from mqttjs_ed8ec08a (d0, q0, r0, m0, 'cmnd/sonoff/power', ... (2 bytes))
1549358740: Sending PUBLISH to sonoff (d0, q0, r0, m0, 'cmnd/sonoff/power', ... (2 bytes))
1549358740: Received PUBLISH from sonoff (d0, q0, r0, m0, 'tele/sonoff/SENSOR', ... (225 bytes))
1549358740: Received PUBLISH from sonoff (d0, q0, r0, m0, 'stat/sonoff/RESULT', ... (14 bytes))
1549358740: Received PUBLISH from sonoff (d0, q0, r0, m0, 'stat/sonoff/POWER', ... (2 bytes))
1549358740: Sending PUBLISH to mqttjs_ed8ec08a (d0, q0, r0, m0, 'stat/sonoff/POWER', ... (2 bytes))
1549358750: Received PINGREQ from mqttjs_ed8ec08a
1549358750: Sending PINGRESP to mqttjs_ed8ec08a
1549358750: Received PINGREQ from sonoff
1549358750: Sending PINGRESP to sonoff
1549358755: Received PUBLISH from sonoff (d0, q0, r0, m0, 'tele/sonoff/STATE', ... (211 bytes))
1549358755: Sending PUBLISH to mqttjs_ed8ec08a (d0, q0, r0, m0, 'tele/sonoff/STATE', ... (211 bytes))
1549358755: Received PUBLISH from mqttjs_ed8ec08a (d0, q0, r0, m0, 'cmnd/sonoff/power', ... (2 bytes))
1549358755: Sending PUBLISH to sonoff (d0, q0, r0, m0, 'cmnd/sonoff/power', ... (2 bytes))
1549358755: Received PUBLISH from sonoff (d0, q0, r0, m0, 'tele/sonoff/SENSOR', ... (225 bytes))
1549358755: Received PUBLISH from sonoff (d0, q0, r0, m0, 'stat/sonoff/RESULT', ... (14 bytes))
1549358755: Received PUBLISH from sonoff (d0, q0, r0, m0, 'stat/sonoff/POWER', ... (2 bytes))
1549358755: Sending PUBLISH to mqttjs_ed8ec08a (d0, q0, r0, m0, 'stat/sonoff/POWER', ... (2 bytes))
1549358765: Received PINGREQ from mqttjs_ed8ec08a
1549358765: Sending PINGRESP to mqttjs_ed8ec08a
1549358765: Received PINGREQ from sonoff
1549358765: Sending PINGRESP to sonoff
Alles anzeigen
Hier die Daten aus der Konsole des Sonoff POW R2 (gerade kein Strom dran, aber auch mit Strom werden die Daten zwar hier korrekt angezeigt, aber nicht im mqtt Protokoll):
10:27:24 MQT: Connected
10:27:24 MQT: tele/sonoff/LWT = Online (retained)
10:27:24 MQT: cmnd/sonoff/POWER = 10:27:25 MQT: tele/sonoff/STATE = {"Time":"2019-02-05T10:27:25","Uptime":"0T00:13:27","Vcc":4.466,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":1,"SSId":"sammygregor","BSSId":"B2:84:C6:C6:3C:68","Channel":10,"RSSI":100}}
10:27:25 MQT: tele/sonoff/SENSOR = {"Time":"2019-02-05T10:27:25","ENERGY":{"TotalStartTime":"2019-02-05T10:10:49","Total":0.000,"Yesterday":0.000,"Today":0.000,"Period":0,"Power":0,"ApparentPower":0,"ReactivePower":0,"Factor":0.00,"Voltage":0,"Current":0.000}}
10:27:26 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
10:27:26 MQT: stat/sonoff/POWER = ON
10:27:40 MQT: tele/sonoff/STATE = {"Time":"2019-02-05T10:27:40","Uptime":"0T00:13:42","Vcc":4.466,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":1,"SSId":"sammygregor","BSSId":"B2:84:C6:C6:3C:68","Channel":10,"RSSI":94}}
10:27:40 MQT: tele/sonoff/SENSOR = {"Time":"2019-02-05T10:27:40","ENERGY":{"TotalStartTime":"2019-02-05T10:10:49","Total":0.000,"Yesterday":0.000,"Today":0.000,"Period":0,"Power":0,"ApparentPower":0,"ReactivePower":0,"Factor":0.00,"Voltage":0,"Current":0.000}}
10:27:40 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
10:27:40 MQT: stat/sonoff/POWER = ON
Hier noch meine Conig des POW R2:
Und die Config von Homebridge:
{ "accessory": "mqtt-power-consumption-log-tasmota", "name": "sonoff", "url": "mqtt://192.168.188.87", "username": "NICHT SICHTBAR", "password": "NICHT SICHTBAR", "topics": { "statusGet": "stat/sonoff/POWER", "statusSet": "cmnd/sonoff/power", "energyGet": "tele/sonoff/ENERGY", "stateGet": "tele/sonoff/STATE" }, "onValue": "ON", "offValue": "OFF", "outletInUseBy": "current", "outletInUseCurrent": "0.01", "totalPowerResetBy": "month", "activityTopic": "tele/sonoff/LWT", "activityParameter": "Online", "startCmd": "cmnd/sonoff/TelePeriod", "startParameter": "15", "patchToSave": "/root/.homebridge/", "savePeriod": "15", "timeOffset": "-60", "manufacturer": "ITEAD", "model": "Sonoff TH", "serialNumberMAC": "NICHT SICHTBAR" },
Wie gesagt schalten geht in der EVE App, jedoch sind die Stromdaten jeweils auf 0.
Ich habe auch schon versucht mehrere Sonoff-Tasmota versionene zu Flashen, unter anderem v5.11.0, v5.10.0 etc..
Ich hoffe ihr habt einen Lösungsansatz für mich
Vielen Dank schonmal.