Tasmota sensor values set back to 0 randomly

Hello,

I have a tasmota sensor connected via MQTT over WLAN to track my power consumption. I configured it sucessfully to show up in the “Energy”-Tab and it looks good so far. However, sometimes it happens that the values are dropping to 0 an go back to the original value just right after.

How does this happen?

Is it sent by MQTT? Can I somehow see the raw data that is sent? And if so, how can I prevent this?

When a peak happens in my energy usage graph is completely blown up and shows an energy usage of several MWh per day. Usually I have multiple (~3) peaks per day, which I need to fix via the Statistics-Tab, this is quite annoying.

I use the total power consumption sensor, it’s unit is “kWh” to track it, I also configured it to use the actual power consumption with the unit “W”, but this does not work since the values shown here are in “Wh” and it shows too big values.

Best regards
Berger

Probably for a very short time unavailable.

MQTT Explorer https://mqtt-explorer.com/

Template sensor with an availability template

1 Like

thanks! looks like it is what I need.

Where can I find this full-text template? looks like mine is a mask with just the “state” part.

You can’t create a template sensor with availability in the GUI

I’m sorry, I’m new to HomeAssistant, what do you mean? I created a helper for the sensor, it works, but I have the issue described above.

You mean I need to create another template somewhere else to add this “has_value” function?

Francis provided an example as one of the links. You will need to take what you have and adjust the YAML to add an availability key to your template.

Berger, what you need to do is find the YAML for the sensor, for which you’ll need to use the File Editor AddOn [probably where the helper is], then add a properly formatted YAML statement to your Sensor-Template.
I’ve just created a Utility Meter Helper, and right at the bottom is an option to make the sensor value retain the last value, enabling this might help if its shown on your GUI configuration after clicking on the gear.

Helper configurations are written in config_entries in JSON format, this post here might help https://community.home-assistant.io/t/where-are-helpers-stored-when-created-in-the-gui/347556/31

Roger