With recent news articles about children being left at home alone with deceased parents (example 1, example 2) I set out to make a panic button my 4 year old could operate if they needed to tell somebody outside the home they need help. I already use the Zigbee Home Assistant integration so I just purchased and paired an Ikea SOMRIG shortcut button to act as the panic button.
Within Home Assistant, I created an entity called input_boolean.panic_mode
by going to Settings > Devices & Services > Helpers > + Create Helper > Toggle. I then created an Automation that triggers when either button on the remote is pressed. It then toggles the Panic Mode to ON and sends an alert notification to my phone with the option to disable Panic Mode. Here’s the YAML for the first Automation:
alias: panic_button
trigger:
- device_id: 08a01d396b203a1aaa1cfc0cae419e84
domain: zha
platform: device
type: initial_switch_press
subtype: button_1
- device_id: 08a01d396b203a1aaa1cfc0cae419e84
domain: zha
platform: device
type: initial_switch_press
subtype: button_2
condition:
- condition: state
entity_id: input_boolean.panic_mode
state: "off"
action:
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.panic_mode
- service: notify.mobile_app_my_phone
data:
message: Panic button pressed!
data:
actions:
- action: DEACTIVATE
title: Deactivate
push:
sound:
name: default
critical: 1
volume: 1
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: DEACTIVATE
continue_on_timeout: false
- service: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.panic_mode
mode: restart
Then I created a second Automation that will send a notification to my emergency contact if I haven’t disabled Panic Mode within a certain period of time. This is the dead man’s switch part of the system where I can prevent false alarms if I am not incapacitated. I used the Google Mail integration to send an email to a my emergency contact through their cell provider’s email to SMS service.
alias: panic_notification
trigger:
- platform: state
entity_id:
- input_boolean.panic_mode
to: "on"
for:
hours: 0
minutes: 1
seconds: 0
condition: []
action:
- service: notify.myaddress_gmail_com
metadata: {}
data:
message: CHILDNAME pressed the panic button and PARENT didn't respond.
target: [email protected]
mode: single
The final part is installing the panic button in an easy to reach place for the child and training them on how and when to use it. I put the button in their room near the door and we did a few scenarios where I was too sleepy and couldn’t wake up or I pretended to fall and bump my head. I also recommend testing the button when you test your smoke detectors.
Toddler friendly panic/emergency button
byu/rastrillo inhomeassistant