- Change alarm system mode (away, home, night, disarmed)
- Welcome people arriving by their name
- Turn off all lights (when you leave for example)
- Press
*
to enter code mode - Enter Pin
- Finish sequence by using
A
: Arm AwayB
: Arm NightC
: Arm HomeD
: Disarm
- You can also reset the entered code by pressing
*
again
Press #
while on the main state screen. On any other screen #
will go back to the main screen.
Press any key.
-
ESP8266 Board (You will proably need to change the config in PlatformIO for your board)
You should probably choose a better pin layout than I did but apparently this is what I used judging from the code 😅
Download and install the PlatformIO IDE.
Create a file called config.h
in the folder include
with the contents of config_example.h.
Choose a language file (default selected is English):
#include "translations/EN.h"
Add your WiFi and MQTT credentials:
#define WiFi_SSID "WiFi_SSID"
#define WiFi_PW "WiFi_PW"
#define MQTT_SERVER_IP "192.168.x.y"
#define MQTT_USER "MQTT_USER"
#define MQTT_PW "MQTT_PW"
#define MQTT_CLIENT_NAME "AlarmControlPanel"
Adjust the other settings to your liking.
If needed adjust the settings in PlatformIO for your board.
-
MQTT Server (for Home Assistant OS: Mosquitto)
-
An alarm system (for example: Manual)
-
Some Automations (see YAML below)
Setup a MQTT server, configure it in Home Assistant and add an account for the alarm panel on the server.
Sends alarm system changes to the panel & receives state requests from the panel.
Replace alarm_control_panel.alarmsystem
with the entity id of your alarm system.
- alias: "MQTT Alarm Panel - Alarm State"
trigger:
- platform: mqtt
topic: "alarmpanel/get"
payload: "state"
- platform: state
entity_id: alarm_control_panel.alarmsystem
action:
- service: mqtt.publish
data:
topic: "alarmpanel/state"
payload: "{{ states('alarm_control_panel.alarmsystem') }}"
Automation to change the state of the alarm system. You can define valid codes in the variables
section.
The name of the code will be used to send a message to a specified phone when the alarm is disabled via the panel. You can disable this by removing the notify
action.
Replace alarm_control_panel.alarmsystem
with the entity id of your alarm system.
Replace notify.enter_phone_id_here
with the entity id of your phone.
- alias: "MQTT Alarm Panel - Set Alarm State"
variables:
codes:
23342: "Code 1"
6563434: "Code 2"
9189938992: "Code 3"
trigger:
- platform: mqtt
topic: "alarmpanel/arm/away"
- platform: mqtt
topic: "alarmpanel/arm/home"
- platform: mqtt
topic: "alarmpanel/arm/night"
- platform: mqtt
topic: "alarmpanel/disarm"
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.payload | int in codes }}'
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.topic == 'alarmpanel/arm/away' }}"
sequence:
- service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.alarmsystem
- conditions:
- condition: template
value_template: "{{ trigger.topic == 'alarmpanel/arm/home' }}"
sequence:
- service: alarm_control_panel.alarm_arm_home
entity_id: alarm_control_panel.alarmsystem
- conditions:
- condition: template
value_template: "{{ trigger.topic == 'alarmpanel/arm/night' }}"
sequence:
- service: alarm_control_panel.alarm_arm_night
entity_id: alarm_control_panel.alarmsystem
- conditions:
- condition: template
value_template: "{{ trigger.topic == 'alarmpanel/disarm' }}"
sequence:
- service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.alarmsystem
- service: notify.enter_phone_id_here
data_template:
message: >
Alarm system disarmed with code: {{codes[trigger.payload | int]}}
title: "⚠️ Warning Alarmpanel"
default:
- service: mqtt.publish
data:
topic: "alarmpanel/arm/error"
payload: "invalidCode"
- service: notify.enter_phone_id_here
data_template:
message: >
A wrong code was entered into the alarm panel: {{trigger.payload}}
title: "⚠️ Warning Alarmpanel"
Turns of your lights when #
is pressed on the panel while on the alarm state screen.
- alias: "MQTT Alarm Panel - Lights off"
trigger:
- platform: mqtt
topic: "alarmpanel/lights"
payload: "off"
action:
- service: light.turn_off
entity_id: all
- service: mqtt.publish
data:
topic: "alarmpanel/lights/callback"
payload: "success"
The automation below will send the name of people arriving at your home to the alarm panel to display.
If you have a motion / door sensor in the area it will wait for someone to be present near the panel. Remove the first action if you don't have one.
- alias: "Welcome Notification"
trigger:
platform: event
event_type: state_changed
mode: parallel
condition:
condition: and
conditions:
- condition: template
value_template: "{{ trigger.event.data.new_state is defined }}"
- condition: template
value_template: "{{ trigger.event.data.old_state is defined }}"
- condition: template
value_template: "{{ trigger.event.data.new_state.domain == 'person' }}"
- condition: template
value_template: "{{ trigger.event.data.new_state.state == 'home' }}"
- condition: template
value_template: "{{ trigger.event.data.old_state.state != 'home' }}"
action:
- wait_template: "{{ is_state('binary_sensor.motion_sensor_near_panel', 'on') }}"
timeout: 300
continue_on_timeout: false
- service: mqtt.publish
data:
topic: "person/arrived"
payload: "{{state_attr(trigger.event.data.entity_id, 'friendly_name')}}"
Turn on the LCD backlight if a motion sensor near the panel is triggered.
- alias: "MQTT Alarm Panel - Turn LCD on when motion is detected"
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_near_panel
to: 'on'
action:
- service: mqtt.publish
data:
topic: "alarmpanel/lcd"
payload: "on"
- TLS Support (Anyone want to give it a shot?)
- Support more display types?
- More translations