maybe-an-earthquake.yaml 1.08 KB
Newer Older
Erick Hitter's avatar
Erick Hitter committed
1 2
alias: Turn on all lights when all accelerometers move
trigger:
Erick Hitter's avatar
Erick Hitter committed
3 4 5
  platform: state
  entity_id: binary_sensor.office_cabinet_door_motion
  to: 'on'
Erick Hitter's avatar
Erick Hitter committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
condition:
  condition: and
  conditions:
    - condition: state
      entity_id: binary_sensor.front_door_motion
      state: 'on'
    - condition: state
      entity_id: binary_sensor.slider_motion
      state: 'on'
    - condition: state
      entity_id: binary_sensor.master_bedroom_window_motion
      state: 'on'
    - condition: state
      entity_id: binary_sensor.dining_area_window_motion
      state: 'on'
    - condition: state
      entity_id: binary_sensor.office_window_motion
      state: 'on'
action:
  - service: scene.turn_on
    entity_id:
      - scene.da_bright
      - scene.lr_bright
      - scene.office_bright
      - scene.ericks_desk_lamp_relax
      - scene.master_bedroom_bright
      - scene.master_bath_bright
      - scene.balcony_bright
Erick Hitter's avatar
Erick Hitter committed
34
  - service: notify.mattermost
Erick Hitter's avatar
Erick Hitter committed
35 36 37 38 39 40
    data:
      message: 'MAYBE AN EARTHQUAKE?!? ALL ACCELEROMETERS ARE ACTIVE.'
      target:
        - '#alerts'
        - '#general'
        - '#home'