YET another take on an alarm system

A coupe of things not working as expected however. I can’t seem to get the clock to display even though I have it set to true in alarm.yaml.

Do you have a sensor.time defined in Home Assistant?

Also is there a way of changing the delay to disable the siren once its been triggered? there seems to be about a 5 second delay between disarming the alarm to when the siren stops.

Could you post your disarm automation? What type of siren do you use? My x3 zwave sirens stop immediately.

I managed to get the time displayed thanks to the post from @tremebundo who mentioned adding the sensor.time.

I use a MQTT siren I made. Very responsive from within HA and HomeKit app (Home). I’m also using the standard disarm automation except for the change of siren name, see below:

- 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.siren
  - data:
      message: 'The house alarm has been Deactivated'
    service: notify.example_phone_tts

I’ve just realised that I’ve left extra notifications in that aren’t being used, maybe they are causing the delay?

I suspect HA executes the automations sequentially so it will wait until it has completed your pushbullet notification before switching off your siren.

Try placing them the other way around.

1 Like

That’s exactly what’s happening.

Ok so I tweaked the automation and removed notifications I don’t have (pushbullet) the alarm arms etc but the siren will not trigger. There seems to be an automation formatting error but for the life of me can’t work it out as the .YAML validates fine and I’m getting the notifications I have set fine… Can someone cast their eye other it?:

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

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

- 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.all_iphones

- id: alarm_disarmed
  alias: '[Alarm] Disarmed'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'disarmed'
  action:
  - service: switch.turn_off
    entity_id: switch.siren
  - data:
      message: 'The house alarm has been Deactivated'
    service: notify.all_iphones

- 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.siren
    service: notify.all_iphones
    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 }}'

- id: alarm_warning
  alias: '[Alarm] Warning'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'warning'
  action:
  - service: notify.all_iphones
    data:
      message: 'Hello, the house alarm has been tripped. Please deactivate'
    service: notify.all_iphones

try adding a hyphen at the start of your service action:

  -  service: notify.all_iphones

Silly question but is your siren named switch.siren?

1 Like

Ok I’ll check this out and get back to you

I’ll give that a try, network down at the moment.

Yes it’s called switch.siren :slight_smile:

  - service: notify.all_iphones
    data:
      message: 'Hello, the house alarm has been tripped. Please deactivate'
    service: notify.all_iphones  <------------------------

You have an extraneous service call here in - id: alarm_warning

Use below format:

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


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


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


- id: alarm_disarmed
  alias: '[Alarm] Disarmed'
  trigger:
    - platform: state
      entity_id: alarm_control_panel.house
      to: 'disarmed'
  action:
    - service: switch.turn_off
      entity_id: switch.siren
    - service: notify.all_iphones      
      data:
        message: 'The house alarm has been Deactivated'


- 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.siren
    - service: notify.all_iphones
      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 }}'

- id: alarm_warning
  alias: '[Alarm] Warning'
  trigger:
    - platform: state
      entity_id: alarm_control_panel.house
      to: 'warning'
  action:
    - service: notify.all_iphones
      data:
        message: 'Hello, the house alarm has been tripped. Please deactivate'
1 Like

Thats great thanks, my formatting was a little off :slight_smile:

I’m maybe doing something wrong, again, but I’ve trying to trigger the alarm automations from the Alexa Cloud. I can see the automations in Alexa and I can say ‘turn on away mode’ for example, Alexa says ‘OK’ but nothing happends. I get no UI change in the Alarm front end, no notifications on my iOS device (they happen if I arm the alarm normally)

I’m guessing the alarm UI changes only happen when you are triggering via the Alarm panel? is there anyway to build this into a future version so that when you run the armed automation you see the changes in the UI.

Many thanks.

Has anybody used this in conjunction with HADashboard or something similar? Curious if I could use one tablet with my HADashboard and switch to the alarm panel as needed.

The UI responds as soon as the alarm mode has changed irrespective of device/method used to set the alarm.

For example I can use a mobile device to set the alarm either via the interface or using an android app utilizing MQTT and the UI on a wall mounted panel will change instantly.

I have not tried alexa cloud but I’m interested as I have several dots scattered around the house so will have a play. Google assistant works just fine

There’s no reason why you can’t

Ok I think I’ve been trying to trigger it via the automations not the ‘alarm_control_panel.house’. What domain would I include to trigger it via Alexa, Switch? and would the states be simple ‘arm’ ‘disarm’?

The domain is alarm_control_panel

The service is which ever state you wish to set so ‘alarm_arm_away’ for example

You also need to set an entity which will be the name of your alarm ie ‘alarm_control_panel.house’

I’m not sure how this maps to Alexa, I’ll take a look when I get a chance, sill ploughing through new interface (wish I hadn’t started to be honest!)

1 Like

Hi
Yes you can use in HADasboard, i use it myself

You can activate alarm away, alarm home, disarmed by call the script from alexa and google assistant.

1 Like

Which Script?