Arm HA Alarm and Disarm (with pin) through Alexa

Hello,
I’m new to the Home Assistant community, so if you have any advice besides helping me with this problem, I’ll gladly take it.
Concerning the question I’m going to ask, I’ve read a lot and I haven’t found anything that answers my question.

Here is the configuration that I would like to achieve:

  • When I leave my house I say “Alexa arm” or something like that
  • the alarm is armed 60 seconds later.
  • if a door opens Alexa says “Hello”.
  • then I say “Alexa disarm 1234” for this example the password is 1234
  • if I don’t say “Alexa disarm 1234” within 60 s after opening the door Alexa says “I remind you that you have to disarm”.
  • if nothing is done within 30 seconds then alexa sends an alarm and turns on a xiaomi wifi connected socket

Here are the devices I have:

  • I have sensors of detection of opening on my doors model: Aqara Door & Window Sensor version zigbee.
  • A raspberry pi 4 with home assistant and a zigbee key no name plugged on it, this one detects well each opening
  • a xiaomi wifi connected socket where I will install an alarm (siren & lights) that is triggered outside that I would like to integrate

I thank you for your help and for taking the time to help me.

You may want to take a look at the manual alarm integration and use that to provide the framework for your sensors and proposed siren. This will give you an ‘alarm_control_panel’ entity with an appropriate device class that you can then expose to Alexa I assume (we use Google Assistant).
The examples on the page should get you started, but please note that the “state machine” is not quite as documented, see https://github.com/home-assistant/core/issues/42057 for reference. This can be worked around depending on the complexity of your requirements.

I’ve used the manual alarm integration to combine our domestic Texecom alarm system (integrated via a Konnected.io add-on board) providing full HomeAssistant control of the alarm system including Google Assistant arming / disarming with a Pin Code and smart notifications.

Hello, thank you for your kind reply, unfortunately being in France I don’t have a Konnected.io reseller. But I will read the github documentation right away.
Concerning the HA alarm panel, the sensors and Alexa I have installed everything, but I think I have a bad translation of some thermals that prevents me to make everything communicate for the scenario / automation.
Thanks for your help

I guess I’ve not explained myself very well - the konnected.io integration is irrelevant to the manual alarm component - it simply exposes a switch and some sensors representing my actual Texecom alarm for use HomeAssistant.

The manual alarm integration will let you wrap any sensors, actions, notifications etc as an alarm_control_panel entity which will give you an entity representing your “alarm” that you can arm / disarm / trigger etc.

Once it is armed, you can program it so that:

  • your motion sensors trigger the alarm entity
  • your siren sounds when the alarm entity is triggered
  • etc.

Thank you for your answer but I guess I was not clear in my initial question.
I have spent so much time trying to integrate what I wrote earlier that I am disgusted to spend more time on it, I don’t understand. Also my alexa integration just crashed for no reason, I have error messages all over the place, don’t you know of something that serves for beginners on a case by case basis for this alarm context, or a site that includes pre-established scripts for these things. Ah and the alarm also chashed. so I have nothing now

script

alias: Alarm system is it ok to disarm
sequence:
  - choose:
      - conditions:
          - condition: state
            entity_id: person.david
            state: not_home
          - condition: and
            conditions:
              - condition: not
                conditions:
                  - condition: state
                    entity_id: alarm_control_panel.alarm_home_security_control
                    state: disarmed
        sequence:
          - service: alarm_control_panel.alarm_arm_away
            target:
              entity_id:
                - alarm_control_panel.alarm_home_security_control
                - alarm_control_panel.alexa_guard_*****
            data:
              code: '1234'
      - conditions:
          - condition: state
            entity_id: person.whoeve
            state: home
          - condition: and
            conditions:
              - condition: not
                conditions:
                  - condition: state
                    entity_id: alarm_control_panel.alarm_home_security_control
                    state: disarmed
        sequence:
          - service: alarm_control_panel.alarm_disarm
            target:
              entity_id:
                - alarm_control_panel.alarm_home_security_control
                - alarm_control_panel.alexa_guard_*****
            data:
              code: '1234'
      - conditions:
          - condition: state
            state: disarmed
            entity_id: alarm_control_panel.alarm_home_security_control
          - condition: and
            conditions:
              - condition: not
                conditions:
                  - condition: state
                    entity_id: person.whoever
                    state: home
        sequence:
          - service: alarm_control_panel.alarm_disarm
            data:
              code: '1234'
            target:
              entity_id:
                - alarm_control_panel.alarm_home_security_control
                - alarm_control_panel.alexa_guard_*****
      - conditions:
          - condition: state
            entity_id: alarm_control_panel.alarm_home_security_control
            state: disarmed
          - condition: and
            conditions:
              - condition: state
                entity_id: person.whoever
                state: home
        sequence:
          - service: alarm_control_panel.alarm_disarm
            data:
              code: '1234'
            target:
              entity_id:
                - alarm_control_panel.alexa_guard_*****
                - alarm_control_panel.alarm_home_security_control
    default:
      - service: alarm_control_panel.alarm_arm_away
        target:
          entity_id:
            - alarm_control_panel.alarm_home_security_control
            - alarm_control_panel.alexa_guard_*****
        data:
          code: '1234'
mode: single
icon: mdi:security

you can call this script from any automation.
it will check to see if the control panel has been disarmed by code or if there is a presence in the zone of an authorized person. if yes disarm and stop guarding if no keep stay armed and keep guarding. this will also only allow an authorized person to disable the alarm system and Alexa guard by voice command anyone else must key in the code on the security control panel. hope this is what you were looking for

1 Like