Armed and Alarmed

Not a social position or political rant — the topic is a DIY alert system as in home security/protection.

One of the better advance alerting devices is the family dog but for redundancy, Home Assistant has an intruder notification integration, Alarmo. It provides a user interface for setting up your own alarm system completely from within the browser.

Instead of buying a dedicated siren why not use an existent sound system that is connected to your local network (LAN) e.g. bluetooth speaker, home theater, stereo. Home Assistant has an AppleTV integration for example. Your sound system can be used to deliver an .mp3 file in a tone of your choosing.

Using VLC for a media player integration: Go to Settings > Add-ons > Add-on Store. Search for and install the VLC add-on. Configure the add-on to start automatically. Next go to Settings> Integrations, look for the just installed VLC media player via Telnet add-on and click Add.

Upload an mp3 Siren File:

  • Download or create an mp3 file for your alarm sound (e.g., siren.mp3).
  • Place the file in HA’s /config/www directory (accessible via the File Editor add-on.
  • note that the file will be accessible via HTTP at http://<HA_IP>:8123/local/siren.mp3

Write a Script that will set the volume (between 0.0 and 1.0) and point to the sound file (your http address may differ slightly)

alias: Siren_PC
description: "loads the mp3"
sequence:
  - action: media_player.volume_set
    target:
      entity_id: media_player.vlc_telnet
    data:
      volume_level: 0.75
  - action: media_player.play_media
    target:
      entity_id: media_player.vlc_telnet
    data:
      media_content_id: http://homeassistant.local:8123/local/air_raid.mp3
      media_content_type: audio/mp3

Write another Script that will be used to silence the alarm and reset the volume to a relaxed level.

alias: Siren PC Stop
description: "stops"
sequence:
  - action: media_player.media_stop
    target:
      entity_id: media_player.vlc_telnet
    data: {}
  - action: media_player.volume_set
    target:
      entity_id: media_player.vlc_telnet
    data:
      volume_level: 0.25

Go to the Alarmo tab in the Home Assistant sidebar. At the bottom is the Areas header and you should have an Area there (if not click ADD) Your Area has a link to the sensors and a link to the automations. Click the automations link. Create an automation that will run your Siren_PC script. For the Condition use the Alarm is triggered event. For the Mode choose Home or Away (optional). Task will be Siren_PC. In YAML the task looks like this:

- service: script.siren_pc
  entity_id: script.siren_pc
  data: {}

Next click upon the RUN button under the Action header. Under Options give your automation a Name. Finally, at the very bottom click on SAVE.

Create a second automation that will run you Siren PC Stop script. In this case the event will be Alarm is disarmed and the Task entity, Siren PC Stop. Choose RUN action and give the automation a name. Click SAVE.

Try it out. Arm your system and then trigger a sensor. The mp3 file will blast away. Disarm your Alarmo system to kill the siren.

Leave a Reply

Your email address will not be published. Required fields are marked *