Template Alarm Control Panel

Hi,

I setup a Template Alarm Control Panel using some switches I have setup to control my home alarm.

Config:

alarm_control_panel:
  - platform: template
    panels:
      home_alarm_panel:
        value_template: "{{ states('sensor.alarm_status') }}"
        arm_away:
          service: switch.toggle
          data:
            entity_id: switch.alarm_arm_away
        arm_home:
          service: switch.toggle
          data:
            entity_id: switch.alarm_arm_stay
        disarm:
          - service: switch.toggle
            data:
              entity_id: switch.alarm_disarm

I now have this in my lovelace front end using the Lovelace Alarm Panel card.

My questions is, how can I configure a code for the template alarm panel? It seems the Templace alarm panel doesn’t have an option to define one.

Cheers.

Hi Kanishkaz,

I am not sure if this helps, but why use personalized switches?

Something very simple like:

entity: alarm_control_panel.home_alarm
states:
  - arm_home
  - arm_away
type: alarm-panel

…would give you a full panel as you’d expect it:
image

What are your blockers not to use the alarm integration? :slight_smile:

Some useful reads:

  1. https://www.home-assistant.io/lovelace/alarm-panel/
  2. https://www.home-assistant.io/integrations/manual/
  3. https://www.home-assistant.io/integrations/alarm_control_panel.template/

Hi @ErMejoo,

My alarm has a REST API. I have switches configured in Homeassistant that control the Arm/ Disarm functions.

I’m not sure how I can integrate my alarm since it cannot be integrated natively.

There is no way to use a code directly as you would think. I think this is an oversight in implemention. You have to put it in a condition for your action. See my example here:

https://community.home-assistant.io/t/esphome-alarm-system/

THanks @MatthewFlamm. That looks interesting.

How have you configured your alarm in Lovelace? If I don’t want to use the code at all, can I hide the keypad in Lovelace?

1 Like

Just don’t add it to Lovelace or remove the card?

What I meant was, use the Lovelace alarm card without the keypad section. Maintaining the buttons and status icon.

Not sure if you can do this with the alarm card. Sounds like you only need some buttons and some text.

It might not be a bad idea to use a code here anyway if you will ever give access to your home assistant interface to anyone else. It doesn’t need to match your actual alarm system code if you don’t want it to.

you’ll still need the keypad to disarm it, won’t you?

Not necessarily. As @MatthewFlamm mentioned, I can just use some buttons to achieve this as the REST API call does not need a code to control the alarm.

No worries then.
I think you can use card-mod to set display: none for all unnecessary elements in alarm card, have you tried?

Thanks for the tip. Didn’t know that existed. I’ll check it out.

For anyone who wants to do the same, here’s my Lovelace card with card-mod to hide the Code input and keyboard.

type: alarm-panel
states:
  - arm_home
  - arm_away
entity: alarm_control_panel.home_alarm_panel
name: Home Alarm
style: |
  #keypad, #alarmCode {
    display: none !important;
  }
7 Likes

well done!

I opened an issue here

hello,
I’m facing the same problem, but, unfortunately the style solution didn’t worked for. it have no effect at all.
don’t know if this is due to the last home assistant version. Help will be appreciated.

The style fix still works for me. I’m on 0.118.

Thank you for your reply,
I made a copy paste of the code that you shared, as you can see in the screenshot :

I’m missing something ?

ho ok, my bad, I was not using the plugin https://github.com/thomasloven/lovelace-card-mod
this is working now
thank you

1 Like

hi when he is disarmed
I want the keyboard to be hidden

when is armed_home
I want the keyboard to appear

it is possible?