Testing the following templates work:
{{states(‘sensor.qnapups_status_data’) == ‘OL’}} returns true if UPS is online
{{states(‘sensor.qnapups_status_data’) != ‘OL’}} returns false if it is online
so far so good. The problem is I need a binary sensor (to add to a groups of ping binary sensors, to trigger an alarm) using this template.
I’ve added this to my templates.yaml:
Next time include the full error text in your post. It helps when working out what is wrong. I’m guessing it was something like “value_template is not a valid option”.
The error was about a missing “state”. I had tried with state: instead of value_template but to no avail.
Problem is as you state change in configuration option and the examples I found were mixed.
Quite, but then, only a good baker makes a tasty bread, others buy a japanese bread making machine
My coding experience (Basic, Pascal, Modula2, assembler) is 40 years ago so all bear with me asking dumb questions in the future.
The binary sensor is working fine I just need an addition, if the UPS is online and charging it shows “OL CHRG” instead of “OL”
So I need to change the binary sensor with an AND condition checking for both states: