gjohansson-ST / sector

Integration to Sector Alarm for Home Assistant
29 stars 16 forks source link

QuickArm without code #170

Open cerede2000 opened 7 months ago

cerede2000 commented 7 months ago

The Sector Alarm application allows you to activate a quick mode that does not require a code to activate the alarm. As an improvement, I suggest checking if this mode is activated and bypassing the mandatory code request.

For this in coordinator.py I added at line 167 after :

data[panel["PanelId"]]["codelength"] = response_getpanel.get(
    "PanelCodeLength"
)

This :

data[panel["PanelId"]]["quickarm"] = response_getpanel.get(
    "QuickArmEnabled"
)

Then in alarm_control_panel.py I modified the check on lines 90 and 119: if (code and len(code) == self.coordinator.data[self._panel_id]["codelength"]) or self._quickarm:

After that activation no longer requires a code when the QuickArm setting is enabled 👍

gjohansson-ST commented 7 months ago

Thanks for providing input. I suppose this is only valid for arm_away?

cerede2000 commented 7 months ago

Hello,

No for two modes 😁

Cordialement B.Cerede, Le 20 nov. 2023 à 23:09 +0100, G Johansson @.***>, a écrit :

Thanks for providing input. I suppose this is only valid for arm_away? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

gjohansson-ST commented 7 months ago

Ok. So valid for both arm_away and arm_home?

cerede2000 commented 7 months ago

Yes

And you can Enable or disable this feature with : https://mypagesapi.sectoralarm.net/api/Settings/SetPanelSettings

{  "Quickarm": true,  "Password": "xxx. ",  "Displayname": "xxxxxx",  "PanelId": "xxxxxxx" }

Cordialement B.Cerede, Le 20 nov. 2023 à 23:16 +0100, G Johansson @.***>, a écrit :

Ok. So valid for both arm_away and arm_home? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

klercker commented 7 months ago

I don’t see this feature in my app, but that might be due to old hardware on my side or regional availability. I generally think that supporting this mode in a potentially open (security/access-wise) system is unwise. I’m assuming that the base feature relates to physical alarm panels in the home, which is sort-of reasonable. But exposing it to the whole net in a generally very insecure system (with mostly non security conscious admins) seems a bit irresponsible, at least for the arm_home mode but actually for both. I think similar security decisions have been made to protect users with codes etc in the integration? My 5 cents.

On Mon, 20 Nov 2023 at 23:20, FidoInformatichien @.***> wrote:

Yes

And you can Enable or disable this feature with : https://mypagesapi.sectoralarm.net/api/Settings/SetPanelSettings

{ "Quickarm": true, "Password": "xxx. ", "Displayname": "xxxxxx", "PanelId": "xxxxxxx" }

Cordialement B.Cerede, Le 20 nov. 2023 à 23:16 +0100, G Johansson @.***>, a écrit :

Ok. So valid for both arm_away and arm_home? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/gjohansson-ST/sector/issues/170#issuecomment-1819897607, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIQDLIABAEN73SDBTWDB63YFPJUNAVCNFSM6AAAAAA7TSHT7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJZHA4TONRQG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cerede2000 commented 7 months ago

Personally I prefer not to put my alarm code in Home Assistant. Having the QuickArm activated means you don't have to do it.

Not adding activation/deactivation is understandable, but at least managing on the activation code side the fact that this option could be activated externally to the integration is just enough.

Don't you agree?

gjohansson-ST commented 7 months ago

Yes And you can Enable or disable this feature with : https://mypagesapi.sectoralarm.net/api/Settings/SetPanelSettings {  "Quickarm": true,  "Password": "xxx. ",  "Displayname": "xxxxxx",  "PanelId": "xxxxxxx" } Cordialement B.Cerede, Le 20 nov. 2023 à 23:16 +0100, G Johansson @.***>, a écrit :

What is Password in the payload?

cerede2000 commented 7 months ago

This is the password which allows access to the API, which is entered initially in the integration configuration