Hi All. Im trying to make a alert that triggers in these set conditions.
- alias: 'Alarm is not activated'
trigger:
- platform: state
entity_id: group.familydevices
from: home
to: not_home
for:
minutes: 5
condition:
condition: state
entity_id: alarm_control_panel.alarm
state: disarmed
action:
- service: notify.notify
data:
message: 'Alarm not aktivated'
Included this cause this is what i have for one alert right now. But it like it to continue alerting us over and over.
I read the alert component but did not realy get it. seems like i had to create a input_boolean but then i tried to understnad how i would get that to trigger os the same things as my automasation and by then i was lost.
Allso tried to google and search here on the forum to try finding someone thats done the same. Might be im searching the wrong things. Anyone that can guide me on the right path?
Yeh as i said in the post i have read the Alert component help. But cant realy make out how to combine it with what i have and etc. read that 8 times now and still cant figure it out. I cant make mutch sens out of it. and i have full out automasation going for my light and notifications for allot of stuff. Im just realy trying to figure out how to repeat the automasation. Kinda.
- alias: 'Alarm is not activated'
trigger:
- platform: state
entity_id: group.familydevices
from: home
to: not_home
for:
minutes: 5
condition:
condition: state
entity_id: alarm_control_panel.alarm
state: disarmed
action:
- service: notify.notify
data:
message: 'Alarm not aktivated'
- service: input_select.select_option
data_template:
entity_id: input_select.alarm_status_dropdown
option: Gone
- alias: 'alert off on alarm'
trigger:
- platform: state
entity_id: group.familydevices
to: home
- platform: state
entity_id: alarm_control_panel.alarm
to: armed_away
action:
- service: input_select.select_option
data_template:
entity_id: input_select.alarm_status_dropdown
option: Home
My approach would be to create a template binary sensor that is ‘on’ when no one is at home for at least 5 minutes AND the alarm is still disarmed. And then create an alert for that sensor. This would no longer require any automation.
Pretty cool. I’m going to use this as well. If you have iOS, you can make it an actionable alert (not sure about andoid), where you could just enable the alarm right then.
Not tested, but something like this
configuration.yaml
ios:
push:
categories:
- name: Activate Alarm
identifier: 'activate_alarm'
actions:
- identifier: 'ACTIVATE'
title: 'Activate'
activationMode: 'background'
authenticationRequired: no
destructive: yes
behavior: 'default'
- identifier: 'IGNORE'
title: 'Ignore'
activationMode: 'background'
authenticationRequired: no
destructive: yes
Automation
- alias: Alarm off but no one is home
trigger:
- platform: state
entity_id: binary_sensor.forgot_alarm_when_leaving
to: 'on'
action:
- service: notify.ios_whoever
data:
message: "Looks like you're gone but the alarm is still off"
title: "Alarm not armed"
data:
push:
category: "activate_alarm"
- alias: Activate Alarm
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: ACTIVATE
action:
- service: not sure what goes here for alarm_control_panel
entity_id: alarm_control_panel.alarm
No message is sent to the phone. ive checked the group and alarm pannel and the criteria is meet.
Something must not be right, as it should be for the code. tripple checked the alarm panel and group and thats correct. and there state is correct.
Ive allso tried lowering and removing any delay to see if it triggers and spams me. But still nothing.
Its like the alarm dont understand that the sensor is on. or that the whole funktion if off.
Found the problem. the problem was that you cant have
notifiers:
- notify.notify
correct is:
notifiers:
- notify
And it makes sens sins its asking what to notify. not what funktion to use.
My final codes was as followed
Ive notice one problem with this setup that i kinda find wierd.
With this setup. For example when im sleeping. We werry often get the warning that we left home and alarm is off. Sins were home sleeping and have not left the zone i dont get why it does that. and its 10 min untill it hits.
If you use a device tracker like NMAP, device will appear to be offline if they loose network access. Phones will disconnect from Wifi from time to time. This will render your device tracker as ‘not_home’. This will in turn enable the alarm. I think.
Pretty much. This is why it’s a good practice to use a group of device trackers for something like a user. You kind of need the redundancy more than say with something like a tv.
try setting up a few different ones, ping, wifi, gps, whatever and then creating a single group out of those entities. ie dad-ping, dad-nmap, dad-phone and then creating the group group.dad-trackers that has those 3 in it. That way if 2 out of the 3 are home it still says home. If 1 out of the 3 drops off it still says home. All three would need to be not_home to be considered not_home.