krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
450 stars 47 forks source link

No function after power outage I am just looking to clarify something that is occurring with my 310 Smart switch with energy monitoring. After the device looses power, it will not report usages in home assistant, until it has connected to the internet (shown up as active in the meross app), then i can block access to the internet again, and all remains working. Until the device looses power. It this normal functionality due to the HTTP setup. I am not using MQTT at this time. The on off functions of the switch remain unaffected. And continue to operate in HA fine. #422

Closed Goopdegooo closed 6 months ago

Goopdegooo commented 7 months ago

Add your logs here.
krahabb commented 7 months ago

I think the issue is related to the device being unable to synchronize its internal time at boot (query of NTP servers) as suggested by several similar issues where the power readings are zeroed (#300 - #318 - #367 - and many others ;)

All of these issues seems to confirm that if the device doesn't have a correct time it is unable to report powert and energy readings. Several users, were able to keep the device 'out of the internet' by spoofing the public NTP servers queried by the device firmware and using their own private NTP service.

Beside the NTP query, if the device is Meross paired, it also tries to connect to the mqtt broker and could likely stall indefinitely if it is unable to reach the intended Meross MQTT broker (but this more vague...)