I was trying to add an alarm card in lovelace, but I want it to control a switch. I build a switch that controls my alarm. Switch on arms the alarm, switch off disarms the alarm.
I could just make a simple switch, but I like the alarm card UI, and maybe I want it to ask for a pincode to disarm the alarm.
But it would not work (as I expected). The alarm card does not accept a switch entity.
I searched the forum, but i could not find anyone with the same idea.
You can turn your switch on and off with automations. e.g.
- alias: 'Switch turn on when alarm is Armed in Away mode'
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: "armed_away"
action:
- service: switch.turn_on
entity_id: switch.your_actual_switch_entity_id_here
There are other examples of triggers (like disarmed to turn off your switch) on the page linked to above.