YET another take on an alarm system

I have set up a RF 433 remote control. I want to arm and disarm the alarm, when the remote is activated. How do I arm the alarm by writing an automation. Same question for disprming?

I use these scripts but you could use the services in automation actions:

alarm_arm: # uses exit time
  sequence:
    service: alarm_control_panel.alarm_arm_away
    entity_id: alarm_control_panel.house

alarm_arm_instant:
  sequence:
    service: alarm_control_panel.alarm_arm_away
    entity_id: alarm_control_panel.house
    data:
      code: 'override'

alarm_disarm:
  sequence:
    service: alarm_control_panel.alarm_disarm
    entity_id: alarm_control_panel.house
    data:
      code: !secret alarm_code
# ALARM

# Alarm Armed Away
- id: alarm_armed_away
  alias: '[Alarm] Away Mode Armed'
  hide_entity: true
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: armed_away
  action:
  - service: tts.google_say
    entity_id: media_player.kitchen_speaker
    data:
      message: Away mode set.
      
# Alarm Armed Home
- id: alarm_armed_home
  alias: '[Alarm] Home Mode Armed'
  hide_entity: true
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: armed_home
  action:
  - service: tts.google_say
    entity_id: media_player.kitchen_speaker
    data:
      message: Home mode set.
      
# Alarm Arming Away Pending
- id: alarm_arming_away
  alias: '[Alarm] Away Mode Arming'
  hide_entity: true
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: pending
  action:
  - service: tts.google_say
    entity_id: media_player.kitchen_speaker
    data:
      message: ensure all doors and windows are closed
      
# Alarm Disarmed
- id: alarm_disarmed
  alias: '[Alarm] Disarmed'
  hide_entity: true
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: disarmed
  action:
  - service: mqtt.publish
    data:
      topic: house/alarm/siren/01
      payload: '0'
  - service: tts.google_say
    entity_id: media_player.kitchen_speaker
    data:
      message: Alarm unset
      
# Alarm Triggered
- id: alarm_triggered
  alias: '[Alarm] Triggered'
  hide_entity: true
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: triggered
  action:
  - service: mqtt.publish
    data:
      topic: house/alarm/siren/01
      payload: '1'
  - service: notify.pushbullet
    data:
      title: "Home Alarm"
      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}}
  - service: tts.google_say
    entity_id: media_player.kitchen_speaker
    data:
      message: The police have been called. Lockdown is starting
      
# Alarm Warning
- id: alarm_warning
  alias: '[Alarm] Warning'
  hide_entity: true
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: warning
  action:
  - service: tts.google_say
    entity_id: media_player.kitchen_speaker
    data:
      message: Please input user code.

Those automations are triggered by the alarm state. They do not switch the alarm on or off as was requested.

You remote is easily jammed/intercepted. Donā€™t do that with a RF remote.

Oops so they are, sorry for any confusion caused.

Sorry for the possibly stupid question, am coming late to this project. Have got it all installed but am struggling a little with understanding some (not all) of the options and the differences between the different modes. e.g. Iā€™m looking for a ā€œnight modeā€ and a way to disarm night mode through a particular PIR sensor sensing me before all the rest do (i.e. me coming down the stairs in the morning!). Also wanting some assistance understanding the override column of sensors and what the implications are for a sensor being selected in that column. So anyway Iā€™m coming to a pointā€¦is there any documentation available beyond the installation instructions on GitHub?
Thanks!!

You will have to write an automation for this.

If a sensor is in the override column it will not prevent the alarm from arming if active. Could be handy for an exit door or PIR near the alarm panel. If it is not in this column and is active when trying to arm you will get a warning and the alarm wont arm.

Thanks, Tom. But in terms of a ā€œnight modeā€ isnā€™t this essentially what ā€œhome modeā€ is ? Donā€™t you get two different alarm modes (or even three if you turn on perimeter mode)?

Yes indeed, but if you want to disable it with a PIR that is going to be up to you. Hereā€™s an example of disarming using an automation:

- id: automatic_alarm_disarm
  alias: Automatic Alarm Disarm
  trigger:
    - entity_id: device_tracker.iphonex
      platform: state
      to: 'home'
  condition:
    condition: template
    value_template: "{{ not is_state('alarm_control_panel.house', 'disarmed') }}"
  action:
    service: script.turn_on
    entity_id: script.alarm_disarm

You could change the trigger and add a condition to only do this if armed in home or perimeter mode.

I posted the script above: YET another take on an alarm system

Did you ever get this sorted? Be handy to use Telegram

While it doesnt pass the template editor until something actually triggers the alarm, it works with facebook and telegramā€¦

'Alarm triggered by {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")
          [0]][ states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name }}'

note: the alarm_control_panel.house has to be changed with the one being used by you. By default the control panels name is house, but if you have changed it, you have to use the right one. Just check your states in your dev panel.

1 Like

Just a thought, is there any way this could be integrated with custom_updater? At the moment Iā€™m manually patching bugs based on bug reports and suggested fixes on GitHub.

2 Likes

How do I add in the sensor that tripped the alarm here:

Search the topic? Here

With about 1500 posts in this topic Im sorry if this is asked before. Firstly very good job with this panel, but is it any way to make the control panel more reactive? I tried to use it on a Fire tab 10, and the ā€œkeypadā€ is very slow, at the point if it go from 1-9 with ā€œregular speedā€ it maybe catches 4-5 of the numbers and some of them is just selected with the grey overlay.

Well, on my Acer Iconia 7 it lags sometimes, but not always. Canā€™t say itā€™s super fast, but most of the time it does the job well.
And apparently in the future it might change is the author is slamming to migrate from Polymer to something else, no idea it will impact the things

Just updated to ,88 and get the below error
Thu Feb 21 2019 15:39:50 GMT+1300 (NZDT)

Not passing an entity ID to a service to target all entities is deprecated. Update your call to alarm_control_panel.alarm_disarm to be instead: entity_id: all

Alignment of text and icon in by alarm panel not lining up i.e. away text not in centre of circle it is off to one side

Also on Lovelace ui there is no keypad

Any help would be appreciated

There are a bunch of fixes further up the thread you can make yourself or wait until Gaz releases the next version.

See: 2 bugfixes by akasma74 Ā· Pull Request #69 Ā· gazoscalvertos/Hass-Custom-Alarm Ā· GitHub

and:

and:

also:

and:

More:

I think thatā€™s all of them.