diff --git a/automation/bicycle-charger-notification.yaml b/automation/bicycle-charger-notification.yaml index 28bbf38d08b7cbce9c202b698141e42a313c51d8..594a368dfaa652cd5dfe069561a573cb137fca49 100644 --- a/automation/bicycle-charger-notification.yaml +++ b/automation/bicycle-charger-notification.yaml @@ -1,6 +1,6 @@ blueprint: name: Bicycle Charger Notification - description: Get notified when the bicycle battery is fully charged + description: Get notified when the bicycle battery is fully charged. domain: automation input: power_switch: diff --git a/automation/closet-light.yml b/automation/closet-light.yml new file mode 100644 index 0000000000000000000000000000000000000000..648f35af31d6ad1ef7825670896a77ecda98e571 --- /dev/null +++ b/automation/closet-light.yml @@ -0,0 +1,51 @@ +blueprint: + name: Closet Light Timer + description: Turn on closet light for 5 minutes when door is opened or light is turned on. + domain: automation + input: + closet_door: + name: Closet Door Sensor + description: The open/close sensor for the closet door. + selector: + entity: + domain: binary_sensor + closet_light: + name: Closet Light + description: The light in the closet. + selector: + entity: + domain: light + +mode: single + +trigger: + - platform: state + entity_id: + - !input closet_door + - platform: state + entity_id: + - !input closet_light + to: "on" + for: + hours: 0 + minutes: 5 + seconds: 0 + +action: + - choose: + - conditions: + - condition: state + entity_id: !input closet_light + state: "on" + sequence: + - service: light.turn_off + target: + entity_id: !input closet_light + - conditions: + - condition: state + entity_id: !input closet_door + state: "on" + sequence: + - service: light.turn_on + target: + entity_id: !input closet_light