Automation OK, templating wrong condition

This commit is contained in:
2024-10-26 12:35:27 +02:00
parent 9777cf0ce8
commit 1971490dc8
3 changed files with 47 additions and 37 deletions

View File

@@ -117,20 +117,31 @@
entity_id: ebae111d5248a4a919571b66f79824d3
domain: binary_sensor
trigger: device
- type: not_opened
device_id: d9e47be4d9369f77ee2c07273324bc46
entity_id: ebae111d5248a4a919571b66f79824d3
domain: binary_sensor
trigger: device
actions:
- choose:
# if finestra is open
- conditions: >
{{ is_state('binary_sensor.salottopt_finestra_contact', 'off ') }}
# - condition: state
# entity_id: binary_sensor.salottopt_finestra_contact
# state: "on"
# for:
# hours: 0
# minutes: 0
# seconds: 3
{{ is_state('binary_sensor.salottopt_finestra_contact', 'on') }}
# - condition: state
# entity_id: binary_sensor.salottopt_finestra_contact
# state: "on"
# for:
# hours: 0
# minutes: 0
# seconds: 3
sequence:
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: "off"
target:
entity_id: climate.soggiornopt_termosifonesud
- action: switch.turn_off
metadata: {}
data: {}
@@ -140,14 +151,20 @@
metadata: {}
data:
message: Home Assistant DEBUG
title: Dovrebbe essere finestra aperta
title: Aperta {{ states('binary_sensor.salottopt_finestra_contact') }}
# if finestra is closed
- conditions: >
{{ is_state('binary_sensor.salottopt_finestra_contact', 'on ') }}
{{ is_state('binary_sensor.salottopt_finestra_contact', 'off') }}
# - condition: state
# entity_id: binary_sensor.salottopt_finestra_contact
# state: "off"
sequence:
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: "heat"
target:
entity_id: climate.soggiornopt_termosifonesud
- action: switch.turn_on
metadata: {}
data: {}
@@ -157,7 +174,7 @@
metadata: {}
data:
message: Home Assistant DEBUG
title: Dovrebbe essere finestra chiusa
title: Chiusa {{ states('binary_sensor.salottopt_finestra_contact') }}
default:
- action: notify.mobile_app_ttrabatt_iphone15pro
metadata: {}