OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://openwonderlabs.github.io/homebridge-switchbot/
ISC License
239 stars 52 forks source link

Bug: Ceiling Light's Status on HomeBridge Always "Off". #1047

Open sonsongithub opened 5 days ago

sonsongithub commented 5 days ago

Describe the Bug

  1. Ceilling light is powered off.
  2. I switch on the light by using Home.app.
  3. Home.app's button of the light is powered on.
  4. The real light is switched on.
  5. For a while, the button's status on HomeKit automatically changes to "powered off".
  6. But, the real light is not powered off, still powered on.

To Reproduce

I wrote above.

Expected Behavior

After the ceiling light is switched on, the button status of it on HomeKit is "ON".

Relevant Log Output

[04/09/2024, 22:03:13] [SwitchBot] Ceiling Light: Studio Light No Changes, Set On: true
[04/09/2024, 22:03:13] [SwitchBot] Ceiling Light: Studio Light openAPIpushChanges
[04/09/2024, 22:03:13] [SwitchBot] Ceiling Light: Studio Light SwitchBot OpenAPI bodyChange: "{\"command\":\"turnOn\",\"parameter\":\"default\",\"commandType\":\"command\"}"
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light statusCode: 200, deviceStatus: {"statusCode":100,"body":{"items":[{"deviceID":"E41389C0D7B3","code":100,"status":{"fold":6,"model":"sun","wifiMac":"083a8dcdd6fc","power":"on","brightness":77,"colorTemperature":4425},"message":"success"}]},"message":"success"}
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light statusCode: 200, deviceStatus: {"statusCode":100,"body":{"items":[{"deviceID":"E41389C0D7B3","code":100,"status":{"fold":6,"model":"sun","wifiMac":"083a8dcdd6fc","power":"on","brightness":77,"colorTemperature":4425},"message":"success"}]},"message":"success"}
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic On: true
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light On context before: off
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light On context after: true
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic Brightness: 77
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Brightness context before: 77
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Brightness context after: 77
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic ColorTemperature: 226
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light ColorTemperature context before: 226
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light ColorTemperature context after: 226
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic Hue: 0
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Hue context before: 0
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Hue context after: 0
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic Saturation: 0
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light On: true
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Saturation context before: 0
[04/09/2024, 22:03:14] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Saturation context after: 0
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light Brightness: 77
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light pushBrightnessChanges
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light No changes (pushBrightnessChanges), Brightness: 77, BrightnessCached: 77
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light ColorTemperature: 226
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light pushColorTemperatureChanges
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light No changes (pushColorTemperatureChanges), ColorTemperature: 226, ColorTemperatureCached: 226
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light Hue: 0, Saturation: 0
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light pushHueSaturationChanges
[04/09/2024, 22:03:14] [SwitchBot] Ceiling Light: Studio Light No changes (pushHueSaturationChanges), Hue: 0, HueCached: 0, Saturation: 0, SaturationCached: 0
[04/09/2024, 22:03:29] [SwitchBot] Ceiling Light: Studio Light openAPIRefreshStatus
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"E41389C0D7B3","deviceType":"Ceiling Light","hubDeviceId":"E41389C0D7B3","power":"on","brightness":77,"colorTemperature":4425,"version":"V1.3-0.4"},"message":"success"}
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light statusCode: 200, deviceStatus: {"statusCode":100,"body":{"deviceId":"E41389C0D7B3","deviceType":"Ceiling Light","hubDeviceId":"E41389C0D7B3","power":"on","brightness":77,"colorTemperature":4425,"version":"V1.3-0.4"},"message":"success"}
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light openAPIparseStatus
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light (power, brightness, colorTemperature) = OpenAPI:(on, 77, 4425), current:(true, 77, 226)
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light On: on
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light Brightness: 77
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light ColorTemperature: 226
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light Firmware Version: 1.3
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light version: 1.3
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic On: on
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light On context before: true
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light On context after: on
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic Brightness: 77
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Brightness context before: 77
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Brightness context after: 77
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light ColorTemperature context before: 226
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light ColorTemperature context after: 226
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic ColorTemperature: 226
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic Hue: 0
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Hue context before: 0
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Hue context after: 0
[04/09/2024, 22:03:31] [SwitchBot] Ceiling Light: Studio Light updateCharacteristic Saturation: 0
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Saturation context before: 0
[04/09/2024, 22:03:31] [SwitchBot] [DEBUG] Ceiling Light: Studio Light Saturation context after: 0

Config for homebridge-switchbot

{
    "bridge": {
        "name": "Homebridge 6313",
        "username": "",
        "port": 51092,
        "pin": "",
        "advertiser": "avahi"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "SwitchBot",
            "credentials": {
                "token": "",
                "secret": "",
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "",
                        "configDeviceType": "Hub 2",
                        "connectionType": "OpenAPI"
                    }
                ]
            },
            "platform": "SwitchBot"
        }
    ]
}

Screenshots

No response

Device and Model

HubMini

Node.js Version

v20.17.0

NPM Version

10.8.2

Homebridge Version

v1.8.4

Homebridge Switchbot Plugin Version

v.3.8.1

Homebridge Config UI X Plugin Version

v4.58.0

Operating System

Raspbian

donavanbecker commented 5 days ago

The logs you provided. Is that from when you turned the light on in the Home App, and then till the light automatically turns off?

sonsongithub commented 4 days ago

Yes. But the "real" light does not turn off. The status of the light on HomeBridge turns off. Only status. The real light still turns on.