Hi guys,
I’m trying to create Template Sensors that represent my Window states in the UI, hass --script check_config gives an error I cannot decode. Can you help?
I found the customization option in the UI and changed the “Device Class”. That suits my needs as well. Nevertheless, I would be interested in what I did wrong in the approach above!
So the problem with your binary sensor is that you aren’t returning True/False, On/Off, ''/'xxx', or 0/1.
It would have worked if you put your sensor in template sensor, not template binary_sensor. Binary sensor expects A boolean response. If your response is a string, and the string isn’t empty, it considers it ‘on’.
Acceptable boonlean responses:
True or False (No quotes)
On / Off (Not 100% on this one, but I think it works in home assistant land)
0 / 1 '' (empty string) / 'ldkjlskajf' (populated string)
EDIT:
And just to clarify, your template sensor is returning 2 populated strings, meaning always on.