I’m trying to get the hang of templates for my setup and would like some help.
I have a Sonoff connected to the alarm output of my burner.
If the Sonoff have status “unavailable” the burner is working properly. If the Sonoff change status to “off” or “on” the alarm output is active, indicating an error.
If I include the device (“light.burner”) in the UI I get an device that mostly state “unavailable”.
I would like to like to create a virtual sensor that instead is “off” when the status of the device is “unavailable” and “on” when the device either has the status “on” or “off”.
How would the syntax for this look?