I’m new to HA and it’s great to learn something new, but I can’t figure out what I’m doing wrong. I know I should probably stick to the Automation Editor, but I edited the YAML for this one.
I want my dusk/dawn, motion sensor light, to stay on when I manually turn them on via the HA Android app, instead of turning off after the normally set time. The motion activation is great, but I do work at night and need them to stay on until I mantually turn them off. I tried using the automation from HERE (automations.yaml also produced below).
I’m getting an Automation is unavailable. Actions: required key not provided @ data[‘entity_id’] error and I’m not sure why. All my entity ids seem correct and I’m at a loss.
- id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
alias: Front Porch Sengled (with Override)
description: Front Porch Sengled (with Override)
trigger:
- platform: device
type: turned_on
device_id: 16771b88b4fa87d72ea9eb62e1540ef3
entity_id: light.sengled_e13_n11_light_2
domain: light
id: light.sengled_e13_n11_light_2 on
- platform: device
type: turned_off
device_id: 16771b88b4fa87d72ea9eb62e1540ef3
entity_id: light.sengled_e13_n11_light_2
domain: light
id: light.sengled_e13_n11_light_2 off
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: light.sengled_e13_n11_light_2 on
- condition: template
value_template: '{{ trigger.to_state.context.id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.parent_id == none }}'
- condition: template
value_template: '{{ trigger.to_state.context.user_id == none }}'
sequence:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.front_porch_sengled
- choose:
- conditions:
- condition: trigger
id: light.sengled_e13_n11_light_2 on
- condition: template
value_template: '{{ trigger.to_state.context.id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.parent_id == none }}'
- condition: template
value_template: '{{ trigger.to_state.context.user_id != none }}'
sequence:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.front_porch_sengled
- choose:
- conditions:
- condition: trigger
id: light.sengled_e13_n11_light_2 on
- condition: template
value_template: '{{ trigger.to_state.context.id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.parent_id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.user_id == none }}'
sequence:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.front_porch_sengled
- choose:
- conditions:
- condition: trigger
id: light.sengled_e13_n11_light_2 off
- condition: template
value_template: '{{ trigger.to_state.context.id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.parent_id == none }}'
- condition: template
value_template: '{{ trigger.to_state.context.user_id == none }}'
sequence:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.front_porch_sengled
- choose:
- conditions:
- condition: trigger
id: light.sengled_e13_n11_light_2 off
- condition: template
value_template: '{{ trigger.to_state.context.id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.parent_id == none }}'
- condition: template
value_template: '{{ trigger.to_state.context.user_id != none }}'
sequence:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.front_porch_sengled
- choose:
- conditions:
- condition: trigger
id: light.sengled_e13_n11_light_2 off
- condition: template
value_template: '{{ trigger.to_state.context.id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.parent_id != none }}'
- condition: template
value_template: '{{ trigger.to_state.context.user_id == none }}'
sequence:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.front_porch_sengled
mode: single
- id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
alias: Front Porch Motion Lights Detection
description: ''
trigger:
- type: motion
platform: device
device_id: 16771b88b4fa87d72ea9eb62e1540ef3
entity_id: binary_sensor.sengled_e13_n11_motion_2
domain: binary_sensor
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.front_porch_sengled
state: 'off'
sequence:
- type: turn_on
device_id: 16771b88b4fa87d72ea9eb62e1540ef3
domain: light
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 16771b88b4fa87d72ea9eb62e1540ef3
domain: light
mode: single