Feline Loss Prevention

Bringing together a Raspberry Pi, Home Assistant, and an Aeotec ZWave Stick, Door/Window Sensor, and Siren, I’ve got the beginnings of something practical: an audio alert that will fire with escalating intensity when a door is left ajar long enough to risk a curious animal wandering out of the house.

The configuration is a little bit copy-pasta and a little bit inconsistent. I don’t yet know how much cleaner it can be with Home Assistant’s native faculties. That is a project for future Andrew. Today’s exercise was an exploration of the art of the possible.

automation:
  - alias: Rear Door Ajar Alarm Initiation
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor_2
      to: 'on'
      for:
        seconds: 5
    action:
      - service: zwave.set_config_parameter
        data:
          node_id:   13
          parameter: 37
          value:     "Sound 5 - Low Volume"
  - alias: Rear Door Ajar Alarm Escalation
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor_2
      to: 'on'
      for:
        seconds: 10
    action:
      - service: zwave.set_config_parameter
        data:
          node_id:   13
          parameter: 37
          value:     "Sound 4 - Low Volume"
  - alias: Rear Door Ajar Alarm Panic
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor_2
      to: 'on'
      for:
        seconds: 15
    action:
      - service: zwave.set_config_parameter
        data:
          node_id:   13
          parameter: 37
          value:     "Sound 3 - Low Volume"
  - alias: Rear Door Ajar Alarm Termination
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor_2
      to: 'off'
    action:
      - service:   switch.turn_off
        entity_id: switch.aeotec_zw080_siren_gen5_switch
  - alias: Front Door Ajar Alarm Initiation
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor
      to: 'on'
      for:
        seconds: 10
    action:
      - service: zwave.set_config_parameter
        data:
          node_id:   13
          parameter: 37
          value:     "Sound 5 - Low Volume"
  - alias: Front Door Ajar Alarm Escalation
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor
      to: 'on'
      for:
        seconds: 30
    action:
      - service: zwave.set_config_parameter
        data:
          node_id:   13
          parameter: 37
          value:     "Sound 4 - Low Volume"
  - alias: Front Door Ajar Alarm Panic
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor
      to: 'on'
      for:
        seconds: 60
    action:
      - service: zwave.set_config_parameter
        data:
          node_id:   13
          parameter: 37
          value:     "Sound 3 - Low Volume"
  - alias: Front Door Ajar Alarm Termination
    trigger:
      platform:  state
      entity_id: binary_sensor.aeotec_zw112_door_window_sensor_6_sensor
      to: 'off'
    action:
      - service:   switch.turn_off
        entity_id: switch.aeotec_zw080_siren_gen5_switch

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s