Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RandomArray/06f9894e1a58767dd7c05a369a2506f2 to your computer and use it in GitHub Desktop.
Save RandomArray/06f9894e1a58767dd7c05a369a2506f2 to your computer and use it in GitHub Desktop.
template:
- sensor:
- name: "Painting Weather Conditions"
state: >
{% set temp = states('sensor.lacrosse_tx141thbv2_0_144_t')|float %}
{% set humid = states('sensor.lacrosse_tx141thbv2_0_144_h')|float %}
{% if is_number(temp) and is_number(humid) and temp | float > 50 and temp | float < 90 and humid | float < 65 %}
Yes
{% elif temp | float <= 50 or temp | float >= 90 or humid | float >= 65 %}
No
{% else %}
Unknown
{% endif %}
icon: >
{% if is_state("sensor.painting_weather_conditions", "Yes") %}
mdi:spray
{% else %}
mdi:cancel
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment