Skip to content

Home Assistant Integration

Home Assistant can publish directly to Crit Alarm to ring alarms when smoke detectors, freeze sensors, water leak monitors, or security systems trip.

Add a REST notification platform to your Home Assistant configuration.yaml file:

notify:
- name: critalarm
platform: rest
resource: https://alerts.example.com/prod
method: POST_JSON
headers:
Authorization: "Bearer tk_xxxxxxxxxxxx"
data:
topic: "prod"
priority: 5
title: "{{ title }}"
message: "{{ message }}"

Restart Home Assistant or reload YAML configurations under Developer Tools -> YAML -> REST Entities and Notify Services.


If you prefer using rest_command to customize headers dynamically:

Add the following to configuration.yaml:

rest_command:
critalarm_alert:
url: "https://alerts.example.com/prod"
method: POST
headers:
Authorization: "Bearer tk_xxxxxxxxxxxx"
X-Priority: "{{ priority | default('5') }}"
X-Title: "{{ title | default('Home Assistant Alert') }}"
payload: "{{ message | default('Critical sensor triggered') }}"
content_type: "text/plain"

Restart Home Assistant to load the new REST command.


Creating an Automation in the Home Assistant UI

Section titled “Creating an Automation in the Home Assistant UI”

Navigate to Settings -> Automations & Scenes and click Create Automation.

Configure the automation using the exact UI fields:

  • When: Choose State or Device
  • Entity: Select your sensor (e.g. binary_sensor.water_leak_kitchen)
  • From: off
  • To: on
  • Click Add Action
  • Choose Perform action (or Call service)
  • Action: Select notify.critalarm (or rest_command.critalarm_alert)
  • In the action parameters:
    • Message: Water leak detected under kitchen sink!
    • Title: Water Leak Alarm

Click Save in the bottom right corner of the automation editor.


Test the service directly without triggering a physical sensor:

  1. In Home Assistant, open Developer Tools from the sidebar.
  2. Select the Actions tab (named Services in older Home Assistant releases).
  3. In the Action (or Service) dropdown, select notify.critalarm.
  4. Enter the test fields:
    • Message: Test emergency alert from Home Assistant
    • Title: Test Alarm
  5. Click the Perform action button.
  6. Check your phone: Crit Alarm should sound the alarm.