Relative newbie here trying to edit a working blueprint to include an OR condition.
Basically the objective is that I want a light to turn one when either of the two sets of states exist:
1… Motion Sensor Triggered and Light sensor below a specified level
– OR –
2… Motion Sensor Triggered and Binary Sensor is True
The idea is that once a light turns on, the light sensor picks up that luminance and sets the light lux higher so if someone leaves a room and then comes back in after the light turns off but before the light level has a chance to reset, the light will not turn on. Therefore, i want it to turn on no matter what the light level is if that light was recently (within the last 3 minutes) turned off.
First I created binary_sensors with the following as one example:
- binary_sensor:
- name: light_hall_down_recent
state: "{{ now() - states('sensor.light_hall_down_off_time') | as_datetime < timedelta(minutes=3) }}"
Then I took a known working Blueprint (it’s what I am currently using) and copied the file but gave it a different name - then I edited it.
The Blueprint shows up in the list in the UI, but when I go to save an automation I get:
“Message malformed: Unexpected value for condition: ‘None’. Expected and, device, not, numeric_state, or, state, sun, template, time, trigger, zone, a list of conditions or a valid template @ data[‘action’][0]”
Pretty sure I have a simple mistake somewhere in the YAML I added in this section:
action:
- choose:
- conditions:
- condition: state
entity_id: !input motion_entity
state: 'on'
- condition: numeric_state
entity_id: !input illuminance_entity
below: !input lux_trigger_value
or:
- conditions:
- condition: state
entity_id: !input motion_entity
state: 'on'
- condition: state
entity_id: !input recent_off_sensor
state: 'on'
sequence:
- service: homeassistant.turn_on
target:
entity_id: !input light_target
- conditions:
- condition: state
entity_id: !input motion_entity
state: 'off'
sequence:
- service: homeassistant.turn_off
target:
entity_id: !input light_target