Thursday, July 11, 2024

Home Assistant MQTT Alarm Control Panel Integration

Home Assistant is becoming increasingly popular in DIY home automation projects. To help you integrate OHS groups as alarm control panels, I've put together a small guide. The steps are straightforward:

First, you need to access the main configuration file, located at /homeassistant/configuration.yaml. The easiest way to do this is by using the File editor add-on. Go to Settings, then Add-ons, and click on the ADD-ON STORE button at the bottom right. Type "File" in the search bar, and the first add-on to appear should be the File editor. Install it, start it, and set it to start on boot.

Once the File editor is installed, you can access the configuration file at /homeassistant/configuration.yaml. All local files are conveniently accessible from the Folder icon located at the top left. Edit the file and add the following section at the bottom, making sure to maintain proper YAML indentation:

# OHS Alarm
mqtt:
  - alarm_control_panel:
    name: "Alarm Group House"
    supported_features:
      - arm_home
      - arm_away
    payload_arm_away: "arm_away"
    payload_arm_home: "arm_home"
    payload_disarm: "disarm"
    code_arm_required: false
    state_topic: "OHS/group/1/state"
    command_topic: "OHS/set/group/1/state"

This section can be repeated for each group number you have defined in OHS. Simply change the group number in both the state and command topics to match the actual number in OHS, and adjust the alarm panel name as needed.

After editing, save the configuration and then restart Home Assistant. The restart option is conveniently accessible from the editor menu at the top right under the settings icon.

After restarting, the following panel will be added to the main overview. Here, you can directly arm or disarm the OHS group and see its current state.

Note: Each time you edit or remove the MQTT configuration, you need to restart Home Assistant and also log off and log on again to clear the web cache.