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 51 forks source link

Bot shown as light is always on #1039

Open FranciRoosters opened 1 week ago

FranciRoosters commented 1 week ago

Describe Your Problem

Every time I turn my bot on from the Home app the tile always shows as "on" thereafter. It never automatically reverts to "off".

Relevant log output

Bot: Luci Removing any leftover Fan Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Lock Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Door Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Faucet Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Outlet Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Window Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Garage Door Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Window Covering Service
[02/09/2024, 12:33:11] [SwitchBot] Bot: Luci Removing any leftover Stateful Programmable Switch Service

Config for homebridge-switchbot

{
    "name": "SwitchBot",
    "credentials": {
        "token": "token",
        "secret": "secret",
        "notice": "Keep your Token & Secret a secret!"
    },
    "options": {
        "devices": [
            {
                "deviceId": "deviceId",
                "configDeviceName": "Cucina",
                "configDeviceType": "Curtain",
                "connectionType": "OpenAPI",
                "curtain": {
                    "set_minStep": 5,
                    "set_max": 95,
                    "setOpenMode": "0",
                    "setCloseMode": "0",
                    "hide_lightsensor": true
                }
            },
            {
                "deviceId": "deviceId",
                "configDeviceName": "Salotto",
                "configDeviceType": "Curtain",
                "connectionType": "OpenAPI",
                "curtain": {
                    "set_minStep": 5,
                    "set_max": 95,
                    "setOpenMode": "0",
                    "setCloseMode": "0",
                    "hide_lightsensor": true
                }
            },
            {
                "deviceId": "deviceId",
                "configDeviceName": "Camera",
                "configDeviceType": "Curtain",
                "connectionType": "OpenAPI",
                "curtain": {
                    "set_minStep": 5,
                    "set_max": 95,
                    "setOpenMode": "0",
                    "setCloseMode": "0",
                    "hide_lightsensor": true
                }
            },
            {
                "deviceId": "deviceId",
                "configDeviceName": "Luci",
                "configDeviceType": "Bot",
                "connectionType": "OpenAPI",
                "bot": {
                    "mode": "press",
                    "deviceType": "switch"
                }
            }
        ]
    },
    "platform": "SwitchBot"
}

Screenshots

Screenshot 2024-09-02 at 21 13 23

Device & Model

Bot

Node.js Version

20.16.0

NPM Version

most recent

Homebridge Version

4.57.1

Homebridge SwitchBot Plugin Version

3.7.0

Homebridge Config UI X Plugin Version

No response

Operating System

Raspbian

sonsongithub commented 1 week ago

This issue has caused on my environment.

Node.js Version

20.16.0

NPM Version

most recent

Homebridge Version

4.57.1

Homebridge SwitchBot Plugin Version

3.7.0

Homebridge Config UI X Plugin Version

No response

Operating System

Raspbian

donavanbecker commented 1 week ago

Can you try the latest beta:

npm version

Click here to find out how to install Beta

FranciRoosters commented 1 week ago

Problem isn’t with the most recent stable release, but with Homebridge. I solved by removing the cached item from Homebridge settings. However, another couple of issues have arisen. The bot’s arm won’t reach the switch even though battery is charged. I’ve tried resetting it to factory settings in the SwitchBot app but that didn’t help. Most of the time the connection drops and I can’t trigger the bot, even from the SwitchBot app. Upon re-adding the bot to the app, the same name of the previous configuration appears and there doesn’t seem to be a way to delete cached files from the app. I’ve contacted SwitchBot support in regards to all of this, but my request has gone unanswered. Maybe you can help?Thanks!

sonsongithub commented 1 week ago

I tried beta 11, but this issue has still continued.

  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 automatically changes to "powered off".
  6. But, the real light is not powered off.
[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
donavanbecker commented 1 week ago

Can you try the latest beta:

npm version

Click here to find out how to install Beta

sonsongithub commented 1 week ago

I've tried it, now. But, this issue has still continued.

sonsongithub commented 1 week ago

I tried 3.5.1 and 3.6.0. They both does not work. 3.4.0 works.

donavanbecker commented 5 days ago

Can you try the latest beta:

npm version

Click here to find out how to install Beta

sonsongithub commented 4 days ago

I tried 3.8.0 and 3.7.1 beta29.

But, it does not work well for ceiling lights.

donavanbecker commented 4 days ago

I tried 3.8.0 and 3.7.1 beta29.

But, it does not work well for ceiling lights.

this issue is about bots not ceiling lights.... please open a different issue.