Just make house Smarter 1 automation at a time well 2
got a light in the pantry want to come on when door open and kitchen lights on then off when door closed and if I turn kitchen light on and door open pantry light must come on
first problem get door sensor
my pick are
the 433mhz take a AA battery and have not let me down yet
there more than one way to skin this cat so this is my version
would love to see your guys version
so just write the trigger with no state then use choose to do the right thing
remember binary_sensor are on/off not a open/close its the class that makes it open/close
- id: 90802f0e-3f03-4737-b911-517f97f225f6
alias: Sink pantry light with pantry door
trigger:
- platform: state
entity_id: binary_sensor.panty_door
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.panty_door
state: "on"
- condition: state
entity_id: light.kitchen
state: "on"
sequence:
- service: switch.turn_on
entity_id: switch.panty_lights
- conditions:
- condition: state
entity_id: binary_sensor.panty_door
state: "off"
sequence:
- service: switch.turn_off
entity_id: switch.panty_lights
now the kitchen lights just trigger on the sate and use the choose and condition to get thing right
- id: c5a0b778-6577-4a5e-8395-a976f664aa4f
alias: Sink pantry light with kitchen light
trigger:
- platform: state
entity_id: light.kitchen
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.panty_door
state: "on"
- condition: state
entity_id: light.kitchen
state: "on"
sequence:
- service: switch.turn_on
entity_id: switch.panty_lights
- conditions:
- condition: state
entity_id: light.kitchen
state: "off"
sequence:
- service: switch.turn_off
entity_id: switch.panty_lights
and yes someone will do it in one automation but this is my way of fixing the problem. fix write each automation to fix one problem and then add the condition(s) to fix it