mkormendy / homebridge-konnected

A Homebridge plugin for Konnected Alarm Panel devices
MIT License
12 stars 1 forks source link

BUG: Keyswitch buggy after update to ios16.2 on phone and homepod #29

Open munyip7 opened 1 year ago

munyip7 commented 1 year ago

Bug Description After updating to iOS 16.2 on iPhone and HomePod, assigned Keyswitch on "Out" zone will switch off when reopen HomeKit app.

Steps To Reproduce Turn on Keyswitch on Homekit app. Minimise app or close app. Reopen app. Keyswitch turned off

Expected Behavior Keyswitch should remain on

Environment (please complete the following information as best possible)

Attach Files to Support Your Experience

Additional Relevant Information

munyip7 commented 1 year ago

even though the keyswitch turned off, the alarm system didn't turn off. Manually turning off the keyswitch will turn off the alarm.

munyip7 commented 1 year ago

restore backup to v1.1.8 and keyswitch working as intended.

mkormendy commented 1 year ago

I need more context … please answer the initial questions and provide details.

munyip7 commented 1 year ago

Bug Description Keyswitch assigned to "Out" on panel. It is used to arm traditional alarm panel. When switch on Keyswitch, it will remained "On", arming my traditional alarm. When keyswitch "Off", my traditional alarm will disarm. Working as intended on v1.1.8

After updating to v1.3.1, along with all the Homebridge updates + iOS16.2, when Keyswitch is used, it will arm my panel as usual. After minimised or close/relaunch the Home App, the keyswitch status will be off. But the alarm is still on. Meaning the "Out" is high state, but the icon display is off.

To disarm, I press the Keyswitch icon to on, then press again to off, only then will disarm (meaning "Out" = low state).

Sorry, if I didn't explain properly.

Steps To Reproduce Turn on Keyswitch on Homekit app. Minimise app or close app. Reopen app. Keyswitch turned off

Expected Behavior Keyswitch should remain on

Environment (please complete the following information as best possible)

Attach Files to Support Your Experience My current working config with v1.1.8

{
    "platforms": [
        {
            "name": "Konnected",
            "panels": [
                {
                    "name": "Konnected Panel 2",
                    "uuid": "",
                    "ipAddress": "192.168.0.115",
                    "port": 15301,
                    "blink": true,
                    "zones": [
                        {
                            "enabled": true,
                            "zoneNumber": "1",
                            "zoneType": "contact",
                            "zoneLocation": "Ceiling"
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "out",
                            "zoneType": "switch",
                            "zoneLocation": "Keyswitch Latch",
                            "switchSettings": {
                                "trigger": "high"
                            }
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "5",
                            "zoneType": "contact",
                            "zoneLocation": "Siren",
                            "binarySensorSettings": {
                                "invert": true,
                                "triggerableModes": [
                                    "1"
                                ]
                            }
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "6",
                            "zoneType": "contact",
                            "zoneLocation": "Armed/Disarmed",
                            "binarySensorSettings": {
                                "invert": true
                            }
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "2",
                            "zoneType": "contact",
                            "zoneLocation": "Master Bedroom Contact"
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "3",
                            "zoneType": "contact",
                            "zoneLocation": "Kid's Room Contact"
                        }
                    ]
                },
                {
                    "name": "Konnected Panel 1",
                    "uuid": "",
                    "ipAddress": "192.168.0.110",
                    "port": 14917,
                    "blink": true,
                    "zones": [
                        {
                            "enabled": true,
                            "zoneNumber": "1",
                            "zoneType": "contact",
                            "zoneLocation": "Entrance"
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "2",
                            "zoneType": "contact",
                            "zoneLocation": "Living Room"
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "3",
                            "zoneType": "contact",
                            "zoneLocation": "Kitchen"
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "4",
                            "zoneType": "contact",
                            "zoneLocation": "Master Balcony Door"
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "5",
                            "zoneType": "contact",
                            "zoneLocation": "Kids' Balcony Door"
                        },
                        {
                            "enabled": true,
                            "zoneNumber": "6",
                            "zoneType": "contact",
                            "zoneLocation": "Ceiling Panel"
                        },
                        {
                            "enabled": false,
                            "zoneNumber": "out",
                            "zoneType": "siren",
                            "zoneLocation": "Study"
                        }
                    ]
                }
            ],
            "platform": "konnected"
        }
    ]
}

Additional Relevant Information I already revert to v1.1.8. Unable to update to reproduce results as I will be away until next week. I will try to update again and try again next week.

munyip7 commented 1 year ago

Log when i reproduce the bug ( # denote my action ):

press keyswitch to "on" state

[15/12/2022, 21:00:55] [Konnected] Actuating [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' with payload:
{
  "state": 1,
  "pin": 8
}
[15/12/2022, 21:00:55] [Konnected] Set [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: true
[15/12/2022, 21:00:56] [Konnected] Panel sent update for [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) with value:
 {"state":0,"pin":9} (zone: 6)
[15/12/2022, 21:00:56] [Konnected] [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) as contact inverted state from '0' to '1'
[15/12/2022, 21:00:56] [Konnected] Get default [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: 0
[15/12/2022, 21:00:56] [Konnected] Set [Konnected Alarm] (5DFABE27-E552-43EA-909C-753D76477723) 'securitysystem' target characteristic value: 1
[15/12/2022, 21:00:56] [Konnected] Actuating [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' with payload:
{
  "state": 1,
  "pin": 8
}
[15/12/2022, 21:00:56] [Konnected] Set [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: true
[15/12/2022, 21:00:59] [Konnected] Get [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) as 'contact' characteristic value: 1
[15/12/2022, 21:01:26] [Konnected] Get default [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: 0
[15/12/2022, 21:01:26] [Konnected] Actuating [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' with payload:
{
  "state": 1,
  "pin": 8
}
[15/12/2022, 21:01:26] [Konnected] Set [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: true

#phone went to lock screen when waiting to arm finish. reopen homekit app, keyswitch display as off state

[15/12/2022, 21:01:45] [Konnected] Get default [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: 0
[15/12/2022, 21:01:45] [Konnected] Get [Siren Contact Sensor] (f4cfa26f67a8-5) as 'contact' characteristic value: 0
[15/12/2022, 21:01:45] [Konnected] Get [Konnected Alarm] (5DFABE27-E552-43EA-909C-753D76477723) 'securitysystem' current characteristic value: 1
[15/12/2022, 21:01:45] [Konnected] Get [Kid's Room Contact Contact Sensor] (f4cfa26f67a8-3) as 'contact' characteristic value: 0
[15/12/2022, 21:01:45] [Konnected] Get [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) as 'contact' characteristic value: 1
[15/12/2022, 21:01:45] [Konnected] Get [Master Bedroom Contact Contact Sensor] (f4cfa26f67a8-2) as 'contact' characteristic value: 0
[15/12/2022, 21:01:45] [Konnected] Get [Ceiling Contact Sensor] (f4cfa26f67a8-1) as 'contact' characteristic value: 0
[15/12/2022, 21:01:45] [Konnected] Get [Ceiling Panel Contact Sensor] (f4cfa2698df2-6) as 'contact' characteristic value: 0

#lock phone and unlock phone again, keyswitch still off

[15/12/2022, 21:02:00] [Konnected] Get [Ceiling Panel Contact Sensor] (f4cfa2698df2-6) as 'contact' characteristic value: 0
[15/12/2022, 21:02:00] [Konnected] Get [Siren Contact Sensor] (f4cfa26f67a8-5) as 'contact' characteristic value: 0
[15/12/2022, 21:02:00] [Konnected] Get [Konnected Alarm] (5DFABE27-E552-43EA-909C-753D76477723) 'securitysystem' current characteristic value: 1
[15/12/2022, 21:02:00] [Konnected] Get [Kid's Room Contact Contact Sensor] (f4cfa26f67a8-3) as 'contact' characteristic value: 0
[15/12/2022, 21:02:00] [Konnected] Get [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) as 'contact' characteristic value: 1
[15/12/2022, 21:02:00] [Konnected] Get [Master Bedroom Contact Contact Sensor] (f4cfa26f67a8-2) as 'contact' characteristic value: 0
[15/12/2022, 21:02:00] [Konnected] Get [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: 0
[15/12/2022, 21:02:00] [Konnected] Get [Ceiling Contact Sensor] (f4cfa26f67a8-1) as 'contact' characteristic value: 0

#press keyswitch again to on

[15/12/2022, 21:02:09] [Konnected] Actuating [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' with payload:
{
  "state": 1,
  "pin": 8
}

# press keyswitch to off

[15/12/2022, 21:02:09] [Konnected] Set [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: true
[15/12/2022, 21:02:14] [Konnected] Actuating [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' with payload:
{
  "state": 0,
  "pin": 8
}
[15/12/2022, 21:02:14] [Konnected] Set [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: false
[15/12/2022, 21:02:15] [Konnected] Panel sent update for [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) with value:
 {"state":1,"pin":9} (zone: 6)
[15/12/2022, 21:02:15] [Konnected] [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) as contact inverted state from '1' to '0'
[15/12/2022, 21:02:15] [Konnected] [Armed/Disarmed Contact Sensor] (f4cfa26f67a8-6) as 'contact' changed from its default state of 1 to 0
[15/12/2022, 21:02:15] [Konnected] Get default [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: 0
[15/12/2022, 21:02:15] [Konnected] Set [Konnected Alarm] (5DFABE27-E552-43EA-909C-753D76477723) 'securitysystem' target characteristic value: 3
[15/12/2022, 21:02:15] [Konnected] Actuating [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' with payload:
{
  "state": 0,
  "pin": 8
}
[15/12/2022, 21:02:15] [Konnected] Set [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: false
[15/12/2022, 21:02:16] [Konnected] Get default [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: 0
[15/12/2022, 21:02:16] [Konnected] Actuating [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' with payload:
{
  "state": 0,
  "pin": 8
}
[15/12/2022, 21:02:16] [Konnected] Set [Keyswitch Latch Generic Switch] (f4cfa26f67a8-out) as 'switch' characteristic value: false
munyip7 commented 1 year ago

hope the latest log makes sense. video is i press keyswitch. alarm armed. the contact sensor open is the armed status led from my traditional panel. then i minimise the app. when i reopen the app, the keyswitchis off. but contact sensor is still open. means the actual keyswitch is still ON state coz traditional panel still armed. then i press on again, then off again, the contact sensor close, means alarm panel disarmed. https://user-images.githubusercontent.com/120547451/207869383-41dcbaeb-1718-48cb-b5de-5062d52d6a42.MP4

munyip7 commented 1 year ago

Sorry if confusing. The double keyswitch actuation is because of the automation I run. When Armed contact sensor opens, automation will run Keyswitch On. Coz if I manually arm from my traditional alarm panel, then I want the Keyswitch to be On. Even if i turn off my automations, the keyswitch icon becomes Off still happens.

mkormendy commented 1 year ago

I see the issue and can reproduce now.

This has to do with some sort of change in the handling of the value of the state in the HomeKit characteristic.

I will modify my code now to accommodate this change.