Hi,
I have this automation that reminds me that a windows is open :
- id: d13baaf3-807d-4268-af0d-60c91da31eec
alias: "Avviso finestra aperta con aria inquinata"
initial_state: true
trigger:
- platform: state
from: 'off'
to: 'on'
entity_id: [
binary_sensor.001558a99d47fc_state,
binary_sensor.001558a99d4529_state,
binary_sensor.001558a99d5eea_state,
binary_sensor.finestra_cucina,
binary_sensor.001558a99d4a8d_state,
binary_sensor.porta_finestra_camera_di_adele,
binary_sensor.001558a99ef4be_state,
binary_sensor.001558a99d4e50_state,
binary_sensor.001558a99ef07a_state
]
for:
# hours: 1
minutes: 20
# seconds: 5
condition:
- condition: template
value_template: "{{ states('sensor.waqi_rebaudengo_torino_piemonte_italy')|int >= 101 }}"
action:
repeat:
while:
- condition: template
value_template: "{{ repeat.index <= 6 }}"
- condition: template
value_template: "{{ trigger.to_state.state == 'on' }}"
- condition: template
value_template: "{{ now().month >= 10 or now().month <= 4 }}"
sequence:
- service: script.my_notify
data_template:
call_no_annuncio: 1
title: "Finestra Aperta"
# message_tts: ""
message: "{{ state_attr(trigger.entity_id, 'friendly_name') }} è aperta da più di 20 minuti. L'aria a Torino oggi è inquinata quindi ti suggerisco di chiuderla."
- delay:
minutes: 10
I would like to make it “smarter” adding the following features:
- Add a “timer” that tells me in the message how many minutes have passed since the windows is open
- BONUS: record and add the difference in temperature since the windows is open.
Is that possible?