Intro
For those interested, I went down the route of creating a YAML package for an Olarm device (sold in South Africa). Unfortunately, this device relies on the cloud, but is otherwise very easy to setup and use.
One benefit of a YAML package is that you can customise this to your own needs.
The package uses the Olarm REST API and webhooks to create an HA manual alarm panel.
I should also call out the existing integration for HA which is more feature rich than this package, but due to technological and operational constraints you might hit API limits. This makes certain features less useful (such as zone monitoring).
Note that local monitoring and automation of your alarm system doesn’t replace subscribing to a security service.
Requirements
- An Olarm device connected to your physical alarm panel.
- An active Olarm API.
- Your config must support packages.
- Your HA instance must be reachable by Olarm (i.e. be reachable via the Internet).
Installation & Configuration
Define these secrets in your secrets.yaml
:
olarm_webhook_id: "<as configured under your Olarm API profile>"
olarm_bearer_token: " <as provided by Olarm>"`
olarm_device_endpoint: "https://apiv4.olarm.co/api/v4/devices/<device_id>"
olarm_actions_endpoint: "https://apiv4.olarm.co/api/v4/devices/<device_id>/actions"
alarm_code: "<alarm pin>"
Get the latest package here. Read more about packages here.
Features
- Real-time alarm state updates and triggers
- Basic alarm management: arming/disarming (advanced management such as bypassing must be done via the Olarm app)
- Presence aware: ask to arm/disarm when leaving/arriving
- Extensible with more custom automations and integration of one’s own sensors
- Area/partition aware (although not set up for multiple areas/partitions; make a copy if you want to manage multiple partitions)
Unsupported Features
- Zone monitoring (no real-time updates via webhooks or mqtt)
- Bypassing zones (not implemented; not supported by the alarm integration)
- Alarm action history (not implemented; not supported by the alarm integration)
- Managing more than one area/partition (clone the package in order to do so)
- How or who armed/disarmed the alarm (complex)
Future
- Distinct alerts (notifications) for breach, panic, fire and emergency (currently no distinction)
- Hoping for an MQTT integration with additional features (multiple requests made to Olarm; apparently it is WIP)
Known Issues & Bugs
- Arming when a zone is active (open) will not fail when calling the API (issue reported to Olarm)
Dashboard
If you’re like me and don’t like green for an armed alarm on your UI (and you want it to match your Olarm app), you can customise this.
What this will do, is to use red for an armed alarm, yellow for armed stay/home/night and green for unarmed. It will also show the triggered state in blue (think, police) with a green disarm button.
Tile Card and History Graph
- type: tile
entity: alarm_control_panel.home
name: "Home Alarm"
features:
- type: "alarm-modes"
modes:
- armed_home
- armed_away
- disarmed
card_mod:
# this works in conjunction with www/custom.js
style:
hui-card-features $ hui-alarm-modes-card-feature $ div ha-control-select $ div: |
#option-armed_home {
--control-select-color: #ffa800 !important;
}
#option-armed_away {
--control-select-color: #aa0000 !important;
}
#option-disarmed {
--control-select-color: #40b100 !important;
}
hui-card-features $ div hui-card-feature $ hui-alarm-modes-card-feature $ ha-control-button-group ha-control-button $ button: |
.button {
background-color: #40b100 !important;
}
- type: history-graph
name: Alarm
hours_to_show: 24
entities:
- entity: alarm_control_panel.home
name: Alarm
Put this in custom.js
in your www
directory.
Theme Customisations
/*
Idea taken from https://gist.github.com/thomasloven/2a37152725c582fec4420ecedb65ebe3
Add this to your configuration.yaml
frontend:
extra_module_url:
- /local/ThemeOverride.js
And put the following into <config-dir>/www/ThemeOverride.js
*/
// setting these here means it will work for both the panel and the history graph cards
document.documentElement.style.setProperty('--state-alarm_control_panel-armed_home-color', '#ffa800');
document.documentElement.style.setProperty('--state-alarm_control_panel-armed_away-color', '#aa0000');
document.documentElement.style.setProperty('--state-alarm_control_panel-disarmed-color', '#40b100');
document.documentElement.style.setProperty('--state-alarm_control_panel-triggered-color', '#135dd8');
References: