iklein99 / homebridge-smartthings

This is a plugin to Homebridge to connect your Smartthings network into Apple Home Kit.
Apache License 2.0
150 stars 52 forks source link

Switch on/off state switches back and forth in Home app #51

Closed PatrickDanino closed 1 year ago

PatrickDanino commented 1 year ago

Describe The Bug:

When I toggle the state of a switch, or even more often a lock, the Home app appears to get temporarily confused about the current state of the device. Sometimes it remains in the right state, but other times it either switches back and to the original state for a few seconds or in the case of my August lock, shows that the device is not responding.

To Reproduce:

Expected behavior:

When turning on a switch, state of the switch should remain on until it is turned off

Current behavior:

When turning on the switch, the UI appears to show it on for a second, only to switch to off a second later, then back to on a few seconds after that

Logs:

The issue happened with the device "Coffee machine", which I turned on, then turned off a minute later. The issue happened when the device was turned on, but not when it was turned off.

[10/22/2022, 1:09:51 PM] [Smartthings Plug (IK)] Radio Switch polling...
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Main Floor Fireplace
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Bedroom Light Virtual Switch
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Top Floor Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Entrance Corridor Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Bedroom Fireplace
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Living Room Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Coffee Lamp
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Living TV Light
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Entrance Door Light
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Bedroom Main Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Kitchen Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Main Floor Stairs Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received getCurrentState() event for Front Door Lock
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Coffee Machine
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Kitchen Counter Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Office Bathroom Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Office Main Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Bedroom Closet Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Kitchen Table Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Bedroom Bathroom Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Office Desk Light
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Entrance Stairs Lights
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for Zen Lamp
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received onGet() event for iPhone
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Received getContact() event for Radio Switch
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Top Floor Lights. value = off
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Top Floor Lights polling...
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Living Room Lights. value = on
[10/22/2022, 1:09:55 PM] [Smartthings Plug (IK)] Living Room Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Entrance Door Light. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Entrance Door Light polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Main Floor Stairs Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Main Floor Stairs Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Bedroom Light Virtual Switch. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Bedroom Light Virtual Switch polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Main Floor Fireplace. value = on
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Main Floor Fireplace polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Entrance Corridor Lights. value = on
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Entrance Corridor Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Bedroom Fireplace. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Bedroom Fireplace polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Coffee Machine. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Coffee Machine polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Coffee Lamp. value = on
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Coffee Lamp polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Living TV Light. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Living TV Light polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Bedroom Main Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Bedroom Main Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Office Main Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Office Main Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Kitchen Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Kitchen Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Bedroom Bathroom Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Bedroom Bathroom Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Reset Front Door Lock to 1
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Front Door Lock. value = locked
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Front Door Lock polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Zen Lamp. value = on
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Zen Lamp polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Kitchen Counter Lights. value = on
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Kitchen Counter Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Office Bathroom Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Office Bathroom Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Bedroom Closet Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Bedroom Closet Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Kitchen Table Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Kitchen Table Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Office Desk Light. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Office Desk Light polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for Entrance Stairs Lights. value = off
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Entrance Stairs Lights polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Motion value from Radio Switch: closed
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] Radio Switch polling...
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for iPhone. value = present
[10/22/2022, 1:09:56 PM] [Smartthings Plug (IK)] iPhone polling...
[10/22/2022, 1:10:00 PM] [Smartthings Plug (IK)] Received onGet() event for iPhone
[10/22/2022, 1:10:00 PM] [Smartthings Plug (IK)] Received getContact() event for Radio Switch
[10/22/2022, 1:10:01 PM] [Smartthings Plug (IK)] onGet() SUCCESSFUL for iPhone. value = present
[10/22/2022, 1:10:01 PM] [Smartthings Plug (IK)] iPhone polling...
[10/22/2022, 1:10:01 PM] [Smartthings Plug (IK)] Motion value from Radio Switch: closed
[10/22/2022, 1:10:01 PM] [Smartthings Plug (IK)] Radio Switch polling...

Plugin Config:

{
            "name": "Smartthings Plug (IK)",
            "BaseURL": "https://api.smartthings.com/v1/",
            "AccessToken": "***",
            "GarageDoorMaxPoll": 40,
            "PollLocksSeconds": 10,
            "PollDoorsSeconds": 10,
            "PollSensorsSeconds": 5,
            "PollSwitchesAndLightsSeconds": 10,
            "platform": "HomeBridgeSmartThings"
        }

Screenshots: N/A

Environment:

iklein99 commented 1 year ago

I'm aware of the issue. I will be fixing it soon.

iklein99 commented 1 year ago

Please test in 1.4.8. Let me know.

PatrickDanino commented 1 year ago

Just updated, will keep testing. Already seems to be more responsive to state changes. Thanks!

PatrickDanino commented 1 year ago

Might be unrelated, but I noticed that the plugin failed on my Homebridge server. Unfortunately I needed to restart it before getting the logs, but thought i'd mention it. I'll keep testing.