Trying to implement a custom js Lovelace alarm panel card with countdown timer

I’m working on a custom alarm panel Lovelace card, written in javascript. I’m implementing a countdown timer on state change (when arming/pending), but it’s complicated since the manual alarm doesn’t publish its “seconds remaining”. So, I’ve rigged up a solution with a separate global timer entity, which works, but the question is what to set its timer to. I’ve had to just hard code some numbers for now, because I would need to set the timer based on what state the alarm_control_panel was in before it changed state (which isn’t a published attribute), and what the configuration settings are for its delay_time and arming_time (which also aren’t published).

Would it be possible to modify the manual alarm_control_panel to publish an attribute of “seconds_remaining”, which counts down when in the arming/pending state. Or, if it’s considered too expensive (like the Timer entity) to update the attribute every second during arming/pending, then it would be helpful to have just an attribute which shows “seconds for this state”, which updates only on state change.

Thanks for any ideas / suggestions.
-John

screenshot of my current work:

1 Like

I modified the manual component to add a new state_duration attribute, when in the arming/pending state. Sent Pull Request https://github.com/home-assistant/core/pull/41872

My updated custom alarm panel card with countdown timer is at https://github.com/jcooper-korg/AlarmPanel

Hi @johnplanetz I am trying to get the custom alarm panel working as I have just ordered a Konnected board. I have the panel card working but the timer isn’t working. I added the files for the custom component to the custom_components\manual folder and restarted but then can’t find anything in HACs or integrations to add. What is it that I need to do please?
Many thanks and also thanks for putting in the work for this component.

Did you manage to get it going? You won’t see anything in HACS or integrations, but if you’ve set up your configuration properly, you’ll see some entities in the Developer Tools States list.

See the readme doc at GitHub - jcooper-korg/AlarmPanel, and look at the yaml in the ExampleConfig folder.

Hi, I didn’t get it working but I moved on to the custom mqtt android app that someone wrote. But to be honest I’d like to see if I can get either the Ring or Eufy physical keypad to work as they are a bit more tactile than a touch screen (read family friendly) :slight_smile:

Yeah a physical touchpad would be nice!