I have the following automation which should observe the temperature outside and check this against some room temperatures to notify me, when I can open the windows to cool the rooms down.
Actually this automation isn’t called and I dont know why. Meanwhile I’ve searched the forum and I came to the conclusion, that this should work. What am I missing?
alias: Lüften im Sommer
description: ""
trigger:
- platform: numeric_state
above: sensor.aussentemperatur
below: sensor.aussentemperatur
entity_id:
- sensor.lumi_lumi_weather_temperature_2
- sensor.lumi_lumi_weather_temperature_3
- sensor.lumi_lumi_weather_temperature_4
- sensor.lumi_lumi_weather_temperature_8
- sensor.lumi_lumi_weather_temperature_9
- sensor.wohnzimmer_temperature
condition:
- condition: state
entity_id: sensor.season
state: summer
action:
- variables:
area: "{{ area_name(trigger.entity_id) }}"
openWindows: "{{ trigger.below }}"
device_state_icon: 🪟
device_state_name: "{% if openWindows == false %}öffnen{% else %}schließen{% endif %}"
device_state: "{% if openWindows == false %}öffnen{% else %}schließen{% endif %}"
- service: notify.notify
data:
title: "{{ device_state_icon }} Fenster in {{ device_state_name }}"
message: Du solltest die Fenster in {{area}} nun {{device_state_name}}
mode: parallel
max: 10
Yeah I see. My intension was to check later if the value is above or below. I actually thought the above and below would be an or check when both are applied. I guess I have to check them in two triggers. Too bad, I really would prefer such a “small” automation for this to avoid a double declaration of those triggers, which are basically the same.
I guess there is something pretty wrong. I only set the entity_id to the sensor outside and fixed value for above or below and the automation doesnt get triggered.
You probably want to just trigger on simple state changes for any of the seven entities in your original config, then work out what to do with them in the action. An alternative would be one or more template triggers with trigger ids attached to them.