I have a Vera unit coming into HA very well and I can control my lights and other z-wave devices. I have two inputs however that are on a IO bridge interface the appear in Vera as light sensors so they report their values as % Lux.
My garage door sensor and rain gauge sensor appear in HA but I want to create a new sensor that reports either wet/dry or open/closed. I’ve used template sensors before and I tried modifying an existing one shown below but when I do a config_check, I get an error for the new Vera garage door sensor. Anyone tell me what I’m doing wrong?
Working config on an Electrodragon relay and reports on/off
ED02 Input 1 Garage Door Sensor 7:
- platform: template
sensors:
garage_door_ed02:
value_template: '{% if is_state("binary_sensor.ed02_button_1", "on") %}Closed{% else %}Open{% endif %}'
friendly_name: 'Garage Door State'
Whoops, seems it doesn’t actually change state. Sensor appears and when inspecting in templating, it seems that <10 is not recognised. If I put {% if is_state("sensor.i1garage_door_sensor_14", "0") %}, the state is determined correctly. Trouble is, sometimes the state ‘floats’ a bit and is not either fully 0 or 100. Anyone got any clues.
{% if states('sensor.i1garage_door_sensor_14') | float < 5%}Closed{% else %}Open{% endif %} works but I’m not sure if that is the correct use of the syntax.
Thanks. {% if states(‘sensor.i1garage_door_sensor_14’):float < 5 %} does not work but {% if states(‘sensor.i1garage_door_sensor_14’)|float < 5 %} works a treat. Appreciate your help.