Hi, I have a fairly simple blueprint which allows me to turn a light on and off with a selected switch, which works fine.
blueprint:
name: light switch
description: light switch
domain: automation
input:
switch:
name: Switch
selector:
device:
filter:
- integration: zha
model: "RODRET Dimmer"
light:
name: Light
selector:
target:
entity:
domain: light
trigger:
- device_id: !input switch
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
id: "on"
- device_id: !input switch
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_off
id: "off"
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- "on"
sequence:
- service: light.turn_on
metadata: {}
data:
transition: 0
brightness_pct: 100
target: !input light
- conditions:
- condition: trigger
id:
- "off"
sequence:
- service: light.turn_off
metadata: {}
data:
transition: 0
target: !input light
mode: single
I have one small issue which is that one of my bulbs seems to have an issue which is whenever i send press the off button again when it’s already off it comes back on again but dimly. To fix this bug, I can put in an extra condition which checks to see if the light is on before telling to turn off. I managed to get this to work in a manual automation but when I put it in the blueprint I can’t get it to work. If I add this extra condition:
- conditions:
- condition: trigger
id:
- "off"
- condition: state
entity_id: !input light
state: "on"
enabled: true
I get
Automation Living Room Light failed to set up
The blueprinted automation "Living Room Light" (automation.living_room_light) failed to set up.
Error:Entity entity_id is neither a valid entity ID nor a valid UUID for dictionary value @ data['action'][0]['choose'][1]['conditions'][1]['entity_id']. Got {'entity_id': 'light.living_room_bulb_light'}.
To fix this error, edit the automation to correct it, then save and reload the automation configuration.
And if I do:
- conditions:
- condition: trigger
id:
- "off"
- condition: state
target:
entity_id: !input light
state: "on"
enabled: true
I get
Automation Living Room Light failed to set up
The blueprinted automation "Living Room Light" (automation.living_room_light) failed to set up.
Error:extra keys not allowed @ data['action'][0]['choose'][1]['conditions'][1]['target']. Got {'entity_id': {'entity_id': 'light.living_room_bulb_light'}} required key not provided @ data['action'][0]['choose'][1]['conditions'][1]['entity_id']. Got None.
To fix this error, edit the automation to correct it, then save and reload the automation configuration.
Can anyone tell me what I’m doing wrong and how to fix this please?