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.
Method 1: Notify Service (Recommended)
Section titled “Method 1: Notify Service (Recommended)”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.
Method 2: REST Command
Section titled “Method 2: REST Command”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:
Trigger Section
Section titled “Trigger Section”- When: Choose State or Device
- Entity: Select your sensor (e.g.
binary_sensor.water_leak_kitchen) - From:
off - To:
on
Actions Section
Section titled “Actions Section”- Click Add Action
- Choose Perform action (or Call service)
- Action: Select
notify.critalarm(orrest_command.critalarm_alert) - In the action parameters:
- Message:
Water leak detected under kitchen sink! - Title:
Water Leak Alarm
- Message:
Click Save in the bottom right corner of the automation editor.
Testing the Action in Developer Tools
Section titled “Testing the Action in Developer Tools”Test the service directly without triggering a physical sensor:
- In Home Assistant, open Developer Tools from the sidebar.
- Select the Actions tab (named Services in older Home Assistant releases).
- In the Action (or Service) dropdown, select
notify.critalarm. - Enter the test fields:
- Message:
Test emergency alert from Home Assistant - Title:
Test Alarm
- Message:
- Click the Perform action button.
- Check your phone: Crit Alarm should sound the alarm.