Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103263

MQTT handling if values are missing in payload

$
0
0

Hey there, i am still new with home assistant, but it is getting better. My current project is to read Mi Flora plant sensor value using tasmota esp32s. Unfortunatley auto discovery is not working with Mi Flora and tasmota, so i decided to create my own discovery messages for mqtt with a small python script. This is working so far really well. Unfortunately i have a small problem with battery values.

From tasmota i get a payload with different value and not every value is available in every message. With the battery value the problem is that if the battery payload is missign the value in HA is 0.

I think that is some kind of default behaviour of the mqtt inetgration. Now i am searchin a solution that simply let teh actual value the last value in the battery payload is empty. But - No idea

The value template to extract the battery value is:
value_template: '{{value_json.Battery}}'

Anyone an idea?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>