Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
---
sensor:
- platform: template
sensors:
car_front:
value_template: >-
{% if states('sensor.car_position_front')|float > 1.60 and states('sensor.car_position_centerf')|float > 0.80 and states('sensor.car_position_centerf')|float < 0.85 %}
greencar_north
{% elif states('sensor.car_position_front')|float > 0.80 and states('sensor.car_position_front')|float < 0.85 and states('sensor.car_position_centerf')|float > 1.60 %}
greencar_south
{% elif states('sensor.car_position_front')|float > 1.50 and states('sensor.car_position_front')|float < 1.60 and states('sensor.car_position_centerf')|float > 0.75 and states('sensor.car_position_centerf')|float < 0.80 %}
bluecar_north
{% elif states('sensor.car_position_front')|float > 0.75 and states('sensor.car_position_front')|float < 0.80 and states('sensor.car_position_front')|float < 1.60 and states('sensor.car_position_centerf')|float > 1.50 %}
bluecar_north
{% else %}
off
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.