NSPanel_HA_Blueprint icon indicating copy to clipboard operation
NSPanel_HA_Blueprint copied to clipboard

`Enhancement` Show alarm panel when triggered for quick deactivation

Open NiC1305 opened this issue 11 months ago • 11 comments

Enhancement Summary

Show alarm panel when triggered

Detailed Description

Hello, thank you for the project. Would it be possible to bring the alarm control screen to the foreground for deactivation, as long as the alarm is activated and a trigger is activated. In the same way that a trigger wakes up the screen Thanks

Additional Context

No response

NiC1305 avatar Mar 21 '24 10:03 NiC1305

Quoting @edwardtfn in https://community.home-assistant.io/t/sonoff-nspanel-blueprint-configure-your-own-custom-nspanel-easy-via-a-blueprint/500577/800


You can use the open_entity_settings_page to call the alarm page with the alarm entity you wanna show: How to - Call a Page Directly - Entity-Specific Pages 1.

You can then check for the sensor “Current page” to wait for page “alarm” to be visible. Once that page is visible, you can use the service send_command_printf to run command click bt_disarm,0 which will simulate the release of a click on button disarm:

service: esphome.xxxxx_send_command_printf data: cmd: click bt_disarm,0

M0uC0 avatar Mar 21 '24 11:03 M0uC0

In order to make a small improvement, would it be possible for the numeric keypad to take up the entire screen, in fact the number keys are quite small and I think this would be more comfortable to use

NiC1305 avatar Apr 25 '24 11:04 NiC1305

Which model are you using? EU, US or US Landscape?

edwardtfn avatar Apr 25 '24 11:04 edwardtfn

I use EU

NiC1305 avatar Apr 25 '24 11:04 NiC1305

I was able to open the alarm page when i unlock my door, by calling the esphome entity page, as i am using alarmo. However, once the alarm page is opened the "click bt_disarm,0" is not working, i am not able to open the pin pad / disarm page. Ii tried to increase the wait time and other options online, but none seems to work.

PoopingNow avatar May 06 '24 20:05 PoopingNow

Hello.. API has changed since the post.

now u have to use the

ESPHome: "your_nsp_panel"_entity_details_show service..

entity: your_alarm_entity back_page: home

ESPHome: "your_nsp_panel"_command service..

cmd: click bt_disarm,0

and maybe checking the "current page" on automation if it is at alarm.. before the click.

M0uC0 avatar May 06 '24 23:05 M0uC0

Thank you for the prompt reply. Yes i am using the latest API and exactly per the above.

ESPHome: mainpanel_entity_details_show

entity: alarm_control_panel.alarmo back_page: home

At this stage, the alarm panel will load with the option to arm / disarm etc... As per the normal behaviour.

ESPHome: mainpanel_command cmd: click bt_disarm,0

At this stage, the disarm window does not load. I expect it to load the disarm window, where there pin pad is visible for easy capture of the disarm code.

Can point me in the right direction? I could not locate the get current page function in the API list.

PoopingNow avatar May 07 '24 08:05 PoopingNow

What if you call click bt_disarm,1 instead?

edwardtfn avatar May 07 '24 18:05 edwardtfn

Tried that as well. I even added a delay of 100ms before i call click bt_disarm,1. then another delay of 50ms to simulate and actual button press. Then release the button by calling click bt_disarm,0.

I also tried to increase the delay or without the delays as well. Anyway I will leave it as is for now.

PoopingNow avatar May 08 '24 09:05 PoopingNow

An option to prevent any navigation from the disarm screen when the alarm is triggered would be nice (#1361).

denes44 avatar May 13 '24 17:05 denes44

I was finally able to get it working. I guess when using Alarmo you have to call the keyboard page as well, as it will not load automatically. I have not refined the code yet and to test multiple scenarios, but for now the below is working. I am calling this function when I unlock the main door, using an Aqara U100 lock.

ESPHome: mainpanel_entity_details_show entity: alarm_control_panel.alarmo back_page: home

Wait 250ms

ESPHome: mainpanel_command cmd: click bt_disarm,1

Wait 250ms

ESPHome: mainpanel_command cmd: click bt_disarm,0

ESPHome: mainpanel_command cmd: page keyb_num

PoopingNow avatar May 17 '24 18:05 PoopingNow