#Do template triggers work on their own or as conditions?

1 messages · Page 1 of 1 (latest)

oblique bough
#

Basically title, I have a template checking the temperature inside/outside and figuring out if I need to open windows when it evaluates true, Do I need to add a timer to check this periodically?

alias: Manage house temperature and windows
description: ""
triggers:
  - id: office_open
    trigger: template
    value_template: |
      {{
        state_attr('weather.forecast_home', 'temperature') | float
        <
        (states('sensor.office_sensor_temperature') | float - 1)
      }}
  - id: downstairs_open
    trigger: template
    value_template: |
      {{
        state_attr('weather.forecast_home', 'temperature') | float
        <
        (states('sensor.downstairs_sensor_temperature') | float - 1)
      }}
  - id: office_close
    trigger: template
    value_template: |
      {{
        state_attr('weather.forecast_home', 'temperature') | float
        >
        (states('sensor.office_sensor_temperature') | float - 0.5)
      }}
  - id: downstairs_close
    trigger: template
    value_template: |
      {{
        state_attr('weather.forecast_home', 'temperature') | float
        >
        (states('sensor.downstairs_sensor_temperature') | float - 0.5)
      }}
nimble frigate
#

as all triggers, also template triggers only trigger when they become true
They will have to change to false again before they will trigger again.

oblique bough
# nimble frigate as all triggers, also template triggers only trigger when they become `true` The...

hmm, the setup may not be ideal. probably better to check periodically, and use the window-open/close sensors I have to verify a window state.
so instead of relying on the template change, I could do:
if window open and temp_outside > temp_inside -> notify close window
instead of
when temp_outside > temp_inside -> notify close window once.

if for any reason I don't close the window, because im busy or whatever and forget. I would not get notified again with the way I have it