Greetings all,
I need some help concerning the structure of conditions.
The fist block is working, but I don’t know why. Ok, it seems to start with a condition, then the type of the condition (and), followed by a keyword indicating that more conditions have to follow and then the first condition is there, but there is a leading ‘-’. Why is no leading ‘-’ before the second condition?
condition:
- condition: and
conditions:
- condition: time
after: "21:00"
before: 05:00
- type: is_plugged_in
condition: device
device_id: 41430627056111eb403adf3fd0c80
entity_id: binary_sensor.sm_g965f_i
domain: binary_sensor
- type: is_plugged_in
condition: device
device_id: 18bb63a0034f11eb9dd4dd2ad209
entity_id: binary_sensor.sm_g965f
domain: binary_sensor
action:
- service: script.lights_off
data: {}
The second block is still chaotic and not working at all. Basically I tried to combine different AND-conditions.
If motion is detected, first check condition A and B and if everything is fine, do C. If not, check D and E and if this is fine, do F instead. …followed by other conditions.
trigger:
- platform: state
entity_id: binary_sensor.lidl_bs_occupancy
to: "on"
condition: []
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: time
after: "16:00"
before: 22:00
- type: is_plugged_in
- condition: device
device_id: 41430627056111eb803adf3fd0c80
entity_id: binary_sensor.sm_g965f_i
domain: binary_sensor
- type: is_plugged_in
- condition: device
device_id: 18bb63a0034f11eba9dd4dd2ad209
entity_id: binary_sensor.sm_g965f
domain: binary_sensor
sequence:
- service: homeassistant.turn_on
data:
brightness_pct: 100
xy_color:
- 0.612
- 0.374
entity_id: light.osram_light_strip_light
conditions:
- condition: time
after: 02:00
before: 05:30
Is there any good advice, concerning how to proceed? Is there any tooling to help structuring those conditions?
Thanks a lot,
Fridolin