Tag Archives: HAAS

Home Assistant – home automation

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.

ZHA Visualization

Overview

This visualization of a home automation shows a mesh network of smart switches, smart plugs, and sensors.

The rectangle object in the diagram identifies a Zigbee Coordinator (radio adapter) which is the go-between for the automation hub. Sensor end devices (circular object) that are within close proximity can signal back to the Coordinator directly. Data is transmitted using a low power RF so signal strength is a factor. Happily, since this is a mesh network, the more distant end devices can chain relay through smart devices (oblong object) which relay amplify to the Coordinator like a router.

Router Detail

Winter is Coming

In sympathy with peoples abroad who might be chilling these next few months and in consideration of rising energy costs closer to home I am implementing a new routine with hopes for conserving.

The first step is to adopt a “time of use” billing strategy that utility companies offer. The utility solicits a pricing incentive for customers to refrain from and reduce consumption during the part of day that is historically prime time for energy usage. My humble abode is equipped with a heat pump and that is a big consumer so I give you the following strategy:

On-peak is from  6 a.m. to 9 a.m., Monday through Friday excluding holidays, so I don’t intend to use the heat pump(s) or worse — system AUX heating, a big draw item. So to comply, the thermostat will be turned down for this time slot. To mitigate rise and shine shivering or breakfast hour discomfort the living space will be pre-heated using the Off-peak ($0.067) rate before it cuts off. On-peak is a penalizing $0.39 per kilowatt hour and to be avoided.

thermostat – settings

  • 0500-0600 74 degrees (pre-heating)
  • 0600-0900 65 degrees (On-peak)
  • 0900-1600 68 degrees
  • 1600-2145 72 degrees
  • 2145-0500 65 degrees

A Smart Thermostat simplifies the task of micromanaging the setting adjustments.

extra credit

Ensuring that the water heater, also electric, will never draw current during the On-peak is a bit more involved but easily controlled. A relay to open/close the 240v contactors for the heating element can be actuated by a 120v smart plug. An [smart-hub] automation routine then will pause the appliance like a timer.

future plan

There is a Super Off-peak between the odd hours of 10 at night and 5 in the morning. At a mere $0.043 cents per kWh this will be an opportune time period to charge the EV.

maybe…

At some point go off grid? Solar array? Powerwall? In any event, please stay warm.