System status reported as Unknown after HA restart #2086
-
DESCRIPTIONI have an automation that sends out a notification if EMS-ESP is not online. What was the reasoning behind it? REQUESTED INFORMATIONMake sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
{"System Info":{"version":"3.6.5","uptime":"062+19:05:32.882","uptime (seconds)":5425532,"platform":"ESP32","arduino":"Tasmota Arduino v2.0.14","sdk":"4.4.6.240105","free mem":158,"max alloc":103,"used app":1591,"free app":393,"partition":"app0","reset reason":"Power on reset / APP CPU reset by PRO CPU"},"Network Info":{"network":"WiFi","hostname":"ems-esp","RSSI":-37,"TxPower setting":78,"static ip config":false,"enable IPv6":true,"low bandwidth":false,"disable sleep":false,"enable MDNS":true,"enable CORS":false,"AP provision mode":"disconnected","AP security":"wpa2","AP ssid":"ems-esp"},"NTP Info":{"NTP status":"connected","enabled":true,"server":"time.google.com","tz label":"Europe/Brussels"},"OTA Info":{"enabled":false,"port":8266},"MQTT Info":{"MQTT status":"connected","MQTT publishes":2804860,"MQTT queued":0,"MQTT publish fails":0,"MQTT connects":10,"enabled":true,"client id":"ems-esp","keep alive":60,"clean session":false,"entity format":1,"base":"ems-esp","discovery prefix":"homeassistant","discovery type":0,"nested format":1,"ha enabled":true,"mqtt qos":0,"mqtt retain":true,"publish time heartbeat":60,"publish time boiler":10,"publish time thermostat":10,"publish time solar":10,"publish time mixer":10,"publish time other":10,"publish time sensor":10,"publish single":false,"publish2command":false,"send response":false},"Syslog Info":{"enabled":false},"Sensor Info":{"temperature sensors":0,"temperature sensor reads":0,"temperature sensor fails":0},"API Info":{"API calls":0,"API fails":0},"Bus Info":{"bus status":"connected","bus protocol":"HT3","bus telegrams received (rx)":7148952,"bus reads (tx)":994039,"bus writes (tx)":308,"bus incomplete telegrams":1,"bus reads failed":970,"bus writes failed":15,"bus rx line quality":100,"bus tx line quality":100},"Settings":{"board profile":"NODEMCU","locale":"en","tx mode":3,"ems bus id":11,"shower timer":false,"shower alert":false,"hide led":true,"notoken api":false,"readonly mode":false,"fahrenheit":false,"dallas parasite":false,"bool format":1,"bool dashboard":1,"enum format":1,"analog enabled":false,"telnet enabled":true,"max web log buffer":50,"web log buffer":50},"Devices":[{"type":"boiler","name":"Condens 2500/Logamax/Logomatic/Cerapur Top/Greenstar/Generic HT3","device id":"0x08","product id":95,"version":"23.04","entities":69,"handlers received":"0x10 0x11 0x15 0x1C 0x18 0x19 0x34 0x04","handlers fetched":"0x14 0x16 0x33","handlers pending":"0xBF 0xC2 0x1A 0x35 0x26 0x2A","handlers ignored":"0x1E"},{"type":"thermostat","name":"FW200","device id":"0x10","product id":106,"version":"12.14","entities":31,"handlers received":"0x06","handlers fetched":"0x016F 0x0170 0x0165 0x0166 0xBB 0x01D3","handlers pending":"0xA3 0xA2 0x12 0x13 0x0171 0x0172 0x0167 0x0168 0x23 0x0123","handlers ignored":"0xBE"},{"type":"mixer","name":"IPM","device id":"0x20","product id":102,"version":"20.08","entities":2,"handlers received":"0x010C","handlers pending":"0x011E","handlers ignored":"0x23 0xBE 0x010B"},{"type":"mixer","name":"IPM","device id":"0x21","product id":102,"version":"20.08","entities":4,"handlers received":"0x010C","handlers pending":"0x011E","handlers ignored":"0x23 0xBE 0x010B"},{"type":"solar","name":"ISM1","device id":"0x30","product id":101,"version":"23.04","entities":8,"handlers fetched":"0x0103 0x0101","handlers pending":"0x0104","handlers ignored":"0xBE"},{"type":"controller","name":"HT3","device id":"0x09","product id":95,"version":"23.04","entities":0}]} TO REPRODUCE
To fix:
EXPECTED BEHAVIOURI would expect the SCREENSHOTS |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 6 replies
-
That was the old way of detection. The trouble with that method is that it would give false positives, e.g. if the MQTT broker or the WiFi restarted/switched channels. There is a new method described in https://emsesp.org/Home-Assistant/#alert-when-ems-esp-boots. I would also recommend upgrading to 3.7.0. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. Would it be possible to make the |
Beta Was this translation helpful? Give feedback.
-
ok, I see now. There is no reliable way of getting EMS-ESP to notify when it goes offline or crashes. If there is a network interruption or MQTT server restart, EMS-ESP is still technically alive. There is an MQTT last will topic, but that doesn't say much and usually fired too late. This is why we had so many false positives in HA thinking EMS-ESP crashed when in fact it didn't. Tehnically EMS-ESP is only offline if it can't connect to the network. I'd be happy to explore other ways, but this needs careful thinking through all different scenarios. You may want to look at other vendors (sonoff, shelly) and OSS (tasmota, esphome) to see how they do it. You could try using the |
Beta Was this translation helpful? Give feedback.
-
Moving to a discussion. |
Beta Was this translation helpful? Give feedback.
-
I think this is a special case. The status message is set as "last will" retain on the broker. On a emsesp crash the broker will set this message as "offline". On each connect emsesp sends this message as "online", but not retain. Now we have different scenarios:
I think if we set the "online" message to retain this will help in this case and does not break anything. Last will will still overwrite the status on a abnormal disconnect. |
Beta Was this translation helpful? Give feedback.
-
I happen to be working in the industrial automation industry and we use the VDA5050 protocol which is built on MQTT.
All these messages are published with the retain flag on. For EMS-ESP I think the system status sensor should clearly indicate that this is referring to the connection status and that it doesn't relate to the overall EMS-ESP system status (the device_class is already set to connectivity though) In my opinion the following config would be a correct representation of the connection status towards HA:
I do understand that those false positive reports can be frustrating but I suppose that if a user can provide the data he receives from the |
Beta Was this translation helpful? Give feedback.
-
Ok, so we keep the The line
in Mqtt::on_connect() goes to so don't use anything from the heartbeat (binary_sensor.system_status) |
Beta Was this translation helpful? Give feedback.
-
I have the same behavior after HA Restart with the ems-esp shower device. All entities are shown as:
As soon as the next shower is completed all entities are fine again. Do I need to raise an own issue or is there already a solution available? The Firmware on my EMS-ESP: v3.7.0-dev.17 Many Thanks! |
Beta Was this translation helpful? Give feedback.
Ok, so we keep the
<base>/status
topic as is, which is eitheroffline
oronline
and make it MQTT retain.The line
in Mqtt::on_connect() goes to
..., true)
so don't use anything from the heartbeat (binary_sensor.system_status)