My old Sonoff S31 is flashed with Tasmota and is integrated with the Home Assistant Tasmota Integration, and is reporting values every 10 seconds while the Sonoff Switch is ON and connected devices are consuming power. But if I turn off the Sonoff switch, the power sensor values go to zero as expected, but no further updates of HA sensor values happen till I turn on the Sonoff switch again. This is causing my Grafana power chart to show a curve from the last value before turning off (sensor value not zero sometimes, but actually zero in the Sonoff) to the next turn-on time, where I expect it to be a straight line coinciding with zero during this period, as shown in the attachment:
Is there a way to force the Tasmota integration sensors to update at some specified interval? (The Sonoff itself is sending Tasmota MQTT messages every 10 seconds all the time, since Teleperiod is set to 10 Seconds in Tasmota)
go to sonoff s31 web and check in console if updates are actually send after plug is set to off. I set mine to different Teleperiod based on state but in your case maybe its being turned off completely when its being set to off.
I confirm that the MQTT sensor messages ( with topic tele/device/SENSOR ) are being sent every 10 seconds from the Sonoff S31. I can receive these in Node-RED, for example.
ahh - so it is HA that ignores them when off - I don’t know much about HA energy collecting however I can suggest workarounds. there is Prometheus exporter that will listen to mqtt and paste it into prometheus from there you can use grafana. or just modify graph to fill in zero instead null in graph or dont join end points