Hi, I’m a novice user, but Home Assistant is great. I bought a Shelly 3EM to measure the energy consumed. Everything works great until I restart the router.
Shelly 3EM is connected via the ShellyForHass plugin in version 0.2.0. Everything runs on Raspberry Pi 4 and Home Assistant in version 0.118.3. In configuration.yaml I set a formula for the “platform: template”, which adds up the absolute consumption of the individual electrical phases.
Looks like this:
sensor:
- platform: template
sensors:
energy_consumption_total:
friendly_name: Energy Consumption Total
icon_template: mdi:flash
unit_of_measurement: kWh
value_template: "{{ states('sensor.shelly_shem_3_40f52001972c_1_total_consumption')|float + states('sensor.shelly_shem_3_40f52001972c_2_total_consumption')|float + states('sensor.shelly_shem_3_40f52001972c_3_total_consumption')|float}}"
Everything works fine until I restart or turn off the router to which my devices are connected for more than a few seconds. Then anomalies appear in the graph based on “energy_consumption_total”, which also affects all other variables that are derived from them.
The strange thing is that the sensors that the formula works with ("'sensor.shelly_shem_3_40f52001972c_1_total_consumption., Etc.") did not detect any anomalies.
Where do you think the problem is? Shelly EM3 sensors appear to be OK according to the graph. So is the problem in the formula that adds them, or directly in the Home Assistant kernel?
We’ve been to many places on the internet, but haven’t found an answer. Can anyone think of finding and fixing the cause of the error?