alcar21 / WemosEM

Cheap power monitor (STC013) with Home Assistant Discover and Wemos D1 Mini / PRO (esp8266)
114 stars 24 forks source link

MQTT not publishing #2

Closed afly007 closed 4 years ago

afly007 commented 5 years ago

I'm having issues with MQTT and home assistant. The only message that the MQTT broker receives from wemosEM is a status offline message, even though the logs show it's publishing correctly.

I have everything configured as instructed in the Readme, any ideas?

Thanks

Status MQTT: -3 Reconnecting... Attempting MQTT Broker connection... Reconnecting with user/pass MQTT Connected. Preparing topic HA Discover Preparing message HA Discover [METER] - Payload: {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"56% Bad","uptime":" 0 days 00:02:32","time":"11:36:30 22/11/2019","freemem":23928} [MQTT] - Published: wemos/wemosEM-51F13F/power > {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"56% Bad","uptime":" 0 days 00:02:32","time":"11:36:30 22/11/2019","freemem":23928} [MQTT] - Published: wemos/wemosEM-51F13F/status > online [METER] - rmsCurrent: 0.00 mainsVoltage: 5.00 Watios: 20.36 kwh: 0.02 Before reset kwh: 0.00 lastTimeMeasure: 147133 SAVED CONFIG: {"wifi_name":"","wifi_password":"","ip_mode":0,"ip":"192.168.0.43","mask":"255.255.255.0","gateway":"192.168.0.1","mqtt_enabled":true,"mqtt_server":"192.168.0.6","mqtt_port":1883,"mqtt_username":"wemosem","mqtt_password":"wemosem","message_interval":10000,"voltage":5,"ical":85.71,"blynk_enabled":false,"blynkAuth":"","blynkServer":"","blynkPort":0,"ts_enabled":false,"tsChannelNumber":0,"tsWriteAPIKey":"","timezone":7,"minutes_timezone":0,"system_password":"infinito&masalla","dayReset":0,"watiosTotal":20.35835,"kiloWattHours":0.020358,"beforeResetKiloWattHours":0} [BLYNK] Disabled [THINGSPEAK] Disabled [METER] - Payload: {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"60% Poor","uptime":" 0 days 00:02:37","time":"11:36:35 22/11/2019","freemem":26200} [MQTT] - Published: wemos/wemosEM-51F13F/power > {"current":"0.00","voltage":"5.00","watios":"0.00","kwh":"0.02","beforeKwh":"0.00","ical":"85.71","mqttreconnected":"2","wifidb":"60% Poor","uptime":" 0 days 00:02:37","time":"11:36:35 22/11/2019","freemem":26200} [MQTT] - Published: wemos/wemosEM-51F13F/status > online

Output from Home Assistant MQTT listener...

Message 18 received on wemos/wemosEM-51F13F/status at 11:39 PM:

Offline

QoS: 0 - Retain: false Message 17 received on wemos/wemosEM-51F13F/status at 11:39 PM:

Offline

QoS: 0 - Retain: false Message 16 received on wemos/wemosEM-51F13F/status at 11:38 PM:

Offline

QoS: 0 - Retain: false Message 15 received on wemos/wemosEM-51F13F/status at 11:37 PM:

Offline

QoS: 0 - Retain: false Message 14 received on wemos/wemosEM-51F13F/status at 11:36 PM:

Offline

alcar21 commented 5 years ago

Hello, what version do you have installed?

Do you have the discover on home assistant enabled?

Thanks.