"Unavailable" State not sent to InfluxDB

Hi All,

for am mqtt tasmota sonoff light, I successfully log state on/off and value 1/0 to influxDB however the “Unavailable” State does not appear to get sent to influxDB.

The inavailable state appears in the HA UX so that is working.

I would like to use this to get a understanding to how ofter the SONOFF(in my case) reboots or becomes unavailable.

I’m not sure indeed if HA will send that state to InfluxDB as it’s not really a state since the state is not available
Guess you could override that state with a different one by adding | default ("state you want here")
Or create a template sensor that will have its value set to one when that state is not available:
value_template: '{{states.light.light_name.state is defined}}'

1 Like

@lolouk44 Thanks this helps a lot.

1 Like