Hi, I am trying to create a blueprint for an automation to turn on the light when I open the door. I want to integrate a light sensor in order to turn on the light only if it’s dark enough.
The tricky part is that I want to make the light sensor optional. This beats me.
I spent few days trying to figure this out, read other blueprints but I cannot understand what’s the issue.
Can anybody take a look?
blueprint:
name: Test
domain: automation
input:
door:
name: Door
default: ''
selector:
entity:
domain: binary_sensor
device_class: door
multiple: false
light:
name: Light
selector:
entity:
domain: light
light_sensor:
name: Light sensor
default: ''
selector:
entity:
domain: sensor
device_class: illuminance
variables:
light_sensor: !input light_sensor
trigger:
- platform: state
entity_id: !input door
from: "off"
to: "on"
action:
- choose:
- conditions: "{{ light_sensor|length > 0 }}"
sequence:
- if:
- condition: numeric_state
entity_id: "light_sensor"
below: 100
then:
- service: light.turn_on
data: {}
target:
entity_id: !input light
- default:
- service: light.turn_on
data: {}
target:
entity_id: !input light
mode: single
The error I get at this moment:
Message malformed: Entity light_sensor is neither a valid entity ID nor a valid UUID for dictionary value @ data['action'][0]['choose'][0]['sequence'][0]['if'][0]['entity_id']
It looks like it ignores my choose condition
Thanks