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”.
That’s a very strange way of setting things up. I’m assuming your burner has an alarm relay output and you are using that to switch the power to the sonoff on or off?
A better way of connecting this would be to power the sonnof all the time and connect the burner alarm relay (must be voltage free contacts!!) to one of the sonoff GPIOs.
As a bonus you also now have the switched sonoff power output you can use to control a device nearby.
I only had a Sonoff Basic laying around and the burner gives 220V when the alarm relay output is active.
I have a relay laying around I could use but I don’t know how the voltage free output from the relay would be connected to the Sonoff? Would this require dismantling the Sonoff and soldering?