I’ve been struggling with an automation in Home Assistant for a few days now.
I want the automations to stop as soon as I control my lights manually, with the heute app or with Alexa. I have tried different ways but I always fail.
With {{ trigger.to_state.context.user_id == none }} or {{ trigger.to_state.context.parent_id == none }} I couldn’t get it to work either. Or I’m just being stupid. Can someone help me?
For your information, my lights normally turn on with motion detectors. The forum I have already searched but could not find anything that has helped me directly
Home Assistant newest Version
Thx
alias: Wohnzimmer | 6 - 23:30 Licht an
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.lumi_lumi_motion_ac02_iaszone_2
to: "on"
condition:
- condition: time
after: "06:00:00"
before: "23:30:00"
weekday:
- sun
- sat
- fri
- thu
- wed
- mon
- tue
- condition: template
value_template: "{{ trigger.to_state.context.user_id == none }}"
enabled: true
- condition: template
value_template: "{{ trigger.to_state.context.parent_id == none }}"
enabled: true
- condition: state
entity_id: light.wohnzimmer
state: "off"
enabled: true
- condition: state
entity_id: binary_sensor.wohnzimmer_dunkel
state: "on"
enabled: true
- condition: state
entity_id: input_boolean.party
state: "off"
enabled: true
- condition: state
entity_id: input_boolean.urlaubsmodus
state: "off"
action:
- service: scene.turn_on
target:
entity_id: scene.wohnzimmer_lieblingslicht
metadata: {}
enabled: false
- service: light.turn_on
data:
profile: Lieblingslicht
target:
device_id: 8083f34cb7cc8aba0e9ba8889f5b798a
enabled: true
- delay:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
enabled: true
- wait_for_trigger:
- type: no_motion
platform: device
device_id: 1297108f8732c4fba3c858ffbfd5c393
entity_id: binary_sensor.lumi_lumi_motion_ac02_iaszone_2
domain: binary_sensor
- service: scene.turn_on
target:
entity_id: scene.wohnzimmer_lieblingslicht_dunkler
metadata: {}
- delay:
hours: 0
minutes: 0
seconds: 25
milliseconds: 0
enabled: true
- type: turn_off
device_id: 8083f34cb7cc8aba0e9ba8889f5b798a
entity_id: light.wohnzimmer
domain: light
mode: restart
And the second
alias: Wohnzimmer | Aut. beenden bei man. Steuerung 6-22
description: ""
trigger:
- platform: state
entity_id:
- light.wohnzimmer
to: "on"
id: wohnzimmer_changes_on
- platform: state
entity_id:
- light.wohnzimmer
to: "off"
id: wohnzimmer_changes_off
condition:
- condition: time
after: "06:00:00"
before: "23:30:00"
- condition: template
value_template: "{{ trigger.to_state.context.user_id == none }}"
enabled: false
- condition: template
value_template: "{{ trigger.to_state.context.parent_id == none }}"
enabled: false
action:
- choose:
- conditions:
- condition: trigger
id: wohnzimmer_changes_on
sequence:
- service: automation.turn_off
data: {}
target:
entity_id: automation.wz_8_18_licht_an
- conditions:
- condition: trigger
id: wohnzimmer_changes_off
sequence:
- service: automation.turn_off
data: {}
target:
entity_id: automation.wz_8_18_licht_an
mode: single