YET another take on an alarm system

Interested to see this…

However I have invested a lot of time in HADashboard, have a lot of screens and information displayed, its probably used more but the rest of the family that never use the UI.

Interesting concept thou

1 Like

thank’s a lot for the example, you did a beautiful job, really.
i have a question for you.
this automation:

  • alias: ‘[Alarm] Warning’
    trigger:
    • platform: state
      entity_id: alarm_control_panel.house
      to: ‘warning’
      action:
    • service: notify.pushbullet
      data:
      message: ‘ALARM Warning {{ states[states.alarm_control_panel.house.attributes.changed_by.split(“.”)[0]][ states.alarm_control_panel.house.attributes.changed_by.split(“.”)[1]].name }}’
      target: email/[email protected]
    • data:
      message: ‘Hello, the house alarm has been tripped. Please deactivate’
      service: notify.example_phone_tts

the alarm never goes to the “warning” state.
and also, i can’t see the countdown for the pending time.

Apologies, I did this late last night and forgot to include ‘ids’ in the automation example. I’ve pushed an update to github

make sure your automation ids include alarm_warning and alarm_triggered.

As for the pending timer have you cleared the browser cache after installed the libs in the right folder? Do you see any errors in HA or your web browser console window?

nothing to apologies for. i think the problem is that in my set up the “alarm” doesn’t go in the “warning state”, after it is triggered it remains in the “triggered” state. How much time for the change between triggered and warning state?
now the countdown works.

The time between warning and triggered state is defined in your ‘pending_time’ config in alarm.yaml

You do need the automation defined as id: alarm_warning for this to work.

Also worth pointing out that the pending & warning state is only available in Away mode

ah ok, so “warning” is related for the delayed sensor, now i understand, sorry for the question.
When the alarm is triggered there is a way to automatically re-alarm it?

I don’t think I understand the question. Could you provide some context/example scenario?

i arm the alarm, the alarm is triggered. it remains in the triggered state until i disarm it. that’s it’s how the component works.
i wish the alarm after a certain amount of time (maybe 60 second?) it could re-alarm by itself, so it change the state from “triggered” to the previous state, ex: “armed_home” or “armed_away”. so the components start working again.

This is how the alarm works.

The ‘trigger_time’ (default 600 secs/10 minutes) defined in alarm.yaml determines how long the alarm should stay in trigger mode before reverting back to its previous state

So I guess I have made a mistyake here somewhere. I initially made very few changes to the github files and it seemed to work… then i realised that there was an error in the automation so i tried to fix it… then Hassio woundnt even load up. here is my automation file which seems to be causing the issue. if i # it out, hassio starts up so i know the problem is in this file. I have #'d oupt a lot of the example stuff but left it there for reference, other items are mine. can you please help me find out why it wont start up with this file included?

- id: alarm_armed_away
  alias: '[Alarm] Away Mode Armed'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'armed_away'
  action:
#  - data:
#      message: 'Alarm Away Mode Armed'
#      target: email/[email protected]
  - service: notify.pushbullet
    data:
      message: 'The house alarm has been switched on in away mode. Goodbye'
#    service: notify.example_phone_tts

- id: alarm_armed_home
  alias: '[Alarm] Home Mode Armed'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'armed_home'
  action:
#  - data:
#      message: 'Alarm Home Mode Armed'
#      target: email/[email protected]
  -service: notify.pushbullet
    data:
      message: 'The house alarm has been switched on in home mode'
#    service: notify.example_phone_tts

- id: alarm_arming_away
  alias: '[Alarm] Away Mode Arming'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'pending'
  action:
  - service: notify.pushbullet
    data:
#  - data:
      message: 'House alarm activating, ensure all doors and windows are closed'
#    service: notify.example_phone_tts

- id: alarm_disarmed
  alias: '[Alarm] Disarmed'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'disarmed'
  action:
  - service: notify.pushbullet
    data:
      message: 'Alarm Disabled'
#      target: email/[email protected]
  - service: switch.turn_off
    entity_id: switch.alarm_siren1_switch
#  - data:
#      message: 'The house alarm has been Deactivated'
#    service: notify.example_phone_tts

- id: alarm_triggered
  alias: '[Alarm] Triggered'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'triggered'
  action:
  - service: switch.turn_on
    entity_id: switch.alarm_siren1_switch
  - service: notify.pushbullet
    data:
      message: 'ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][ states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name }}'
#      target: email/[email protected]

- id: alarm_warning
  alias: '[Alarm] Warning'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'warning'
  action:
  - service: notify.pushbullet
    data:
      message: 'ALARM Warning {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][ states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name }}'
#      target: email/[email protected]
#  - data:
#      message: 'Hello, the house alarm has been tripped. Please deactivate'
#    service: notify.example_phone_tts

hi mate I am not an expert but could be your message service code could be the wrong way round. Here is mine

  - service: notify.ios_iospphone
    data:
      message: "The House Alarm State Has Changed to Pending, Please Disarm Alarm Within 30 Secs"

Just a thought …

problem solved! amazing! thanks

I’ve had another crack at changing the indents and use of ‘-’ to match another automation I have which works fine… but this one is still causing an error to load the ‘automation’ component. I dont know what else to fix in this code

- id: alarm_armed_away
  alias: '[Alarm] Away Mode Armed'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'armed_away'
  action:
    - service: notify.pushbullet
      data:
        message: 'Alarm Away Mode Armed'

#    data:
#      message: 'The house alarm has been switched on in away mode. Goodbye'
#    service: notify.example_phone_tts

- id: alarm_armed_home
  alias: '[Alarm] Home Mode Armed'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'armed_home'
  action:
    - service: notify.pushbullet
      data:
        message: 'Alarm Home Mode Armed'
#    data:
#      message: 'The house alarm has been switched on in home mode'
#    service: notify.example_phone_tts

#- id: alarm_arming_away
#  alias: '[Alarm] Away Mode Arming'
#  trigger:
#  - platform: state
#    entity_id: alarm_control_panel.house
#    to: 'pending'
#  action:
#  - data:
#      message: 'House alarm activating, ensure all doors and windows are closed'
#    service: notify.example_phone_tts

- id: alarm_disarmed
  alias: '[Alarm] Disarmed'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'disarmed'
  action:
    - service: notify.pushbullet
      data:
        message: 'Alarm Disabled'
#      target: email/[email protected]
    - service: switch.turn_off
      entity_id: switch.alarm_siren1_switch
#  - data:
#      message: 'The house alarm has been Deactivated'
#    service: notify.example_phone_tts

- id: alarm_triggered
  alias: '[Alarm] Triggered'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'triggered'
  action:
    - service: switch.turn_on
      entity_id: switch.alarm_siren1_switch
    - service: notify.pushbullet
      data:
        message: 'ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][ states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name }}'
#      target: email/[email protected]

- id: alarm_warning
  alias: '[Alarm] Warning'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'warning'
  action:
    - service: notify.pushbullet
      data:
        message: 'ALARM Warning {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][ states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name }}'
#      target: email/[email protected]
#  - data:
#      message: 'Hello, the house alarm has been tripped. Please deactivate'
#    service: notify.example_phone_tts

I think your indentation is off by 2 spaces in the triggers…

- id: alarm_armed_away
  alias: '[Alarm] Away Mode Armed'
  trigger:
    - platform: state
      entity_id: alarm_control_panel.house
      to: 'armed_away'
  action:

I just edited the file and tried again but it still errors… (i have taken a few details out)

2017-11-16 10:40:56 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected a dictionary. Got OrderedDict([(‘homeassistant’, OrderedDict([(‘name’, ‘Home’), (‘latitude’, -xx.886), (‘longitude’, xxx.923), (‘elevation’, 16), (‘unit_system’, ‘metric’), (‘time_zone’, ‘Australia/Perth’), (‘customize’, OrderedDict([(‘group.all_lights’, OrderedDict()), (‘light.gateway_light_34cexxxxxxxx’, OrderedDict([(‘friendly_name’, ‘Xiaomi Gateway Light’)])), (‘sensor.illumination_34cexxxxxxxx’, OrderedDict([(‘hidden’, True)])), (‘light.kitchen_light_level’, OrderedDict([(‘friendly_name’, ‘Kitchen Light’)… (See ?, line ?). Please check the docs at Automation - Home Assistant

Doesn’t the id need to be some random number…

id: ‘1505613520729’
?

all of that is from the original code I grabbed from the git repo. All i really changed originally was the entity ID of the siren and #'d out some of the notification stuff. When that didnt work I swaped things around so that the service came before data etc, which is opposite to what is in the original.

do the rest of your automations use the - id: ‘kkkkkk’ ?

no, my other automations dont have ID’s at all, they were all created manually. My understanding is that the ID’s are only really used by the Hassio built-in automation generator

Yep that’s right so if you remove them I think it will work :slight_smile: You will need to put - infront of the alias’s.