diff --git a/include/automations/open_garage_when_car_arrives.yaml b/include/automations/open_garage_when_car_arrives.yaml new file mode 100644 index 0000000..a1a5c01 --- /dev/null +++ b/include/automations/open_garage_when_car_arrives.yaml @@ -0,0 +1,51 @@ +- id: garage_auto_claus_distance + alias: Garage auto Claus + + trigger: + - platform: numeric_state + entity_id: sensor.claus_distance_home + below: 40 + id: arriving + + - platform: numeric_state + entity_id: sensor.claus_distance_home + above: 60 + id: leaving + + condition: + - condition: time + after: "05:30:00" + before: "22:30:00" + - condition: state + entity_id: device_tracker.snowywhite_location_tracker + state: "home" + + action: + - choose: + + # ÅBN + - conditions: + - condition: trigger + id: arriving + - condition: state + entity_id: cover.anne + state: "closed" + sequence: + - service: cover.open_cover + target: + entity_id: cover.anne + + # LUK + - conditions: + - condition: trigger + id: leaving + - condition: state + entity_id: cover.anne + state: "open" + sequence: + - service: cover.close_cover + target: + entity_id: cover.anne + + mode: single +