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
247 stars 54 forks source link

Bug: Curtain shows motion sensor #797

Closed AndrewRed67 closed 1 year ago

AndrewRed67 commented 1 year ago

Describe the Bug

Switchbot Curtain shows a motion sensor, which is always Triggered. This motion sensor accessory should not be present.

To Reproduce

Did some updating and housekeeping on my installation. Showed up after updating to the most recent version, 2.7.1. Also present on most recent beta which can be installed through Homebridge UI.

Expected Behavior

The motion sensor should not be present in Homebridge / HomeKit.

Relevant Log Output

[8/18/2023, 1:53:55 PM] [Homebridge UI] Homebridge restart request received
[8/18/2023, 1:53:55 PM] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[8/18/2023, 1:53:55 PM] [Homebridge UI] Sending SIGTERM to Homebridge
[8/18/2023, 1:53:55 PM] Got SIGTERM, shutting down Homebridge...
[8/18/2023, 1:54:00 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[8/18/2023, 1:54:05 PM] [HB Supervisor] Restarting Homebridge...
[8/18/2023, 1:54:05 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /volume1/homebridge/node_modules --strict-plugin-resolution
[8/18/2023, 1:54:05 PM] [HB Supervisor] Started Homebridge v1.6.1 with PID: 15531
[8/18/2023, 1:54:06 PM] Loaded config.json with 2 accessories and 3 platforms.
[8/18/2023, 1:54:06 PM] Loaded 1 cached accessories from cachedAccessories.
[8/18/2023, 1:54:06 PM] ---
[8/18/2023, 1:54:06 PM] Loaded plugin: homebridge-eufy-robovac-sefa@1.1.0
[8/18/2023, 1:54:06 PM] Registering accessory 'homebridge-eufy-robovac-sefa.Eufy RoboVac'
[8/18/2023, 1:54:06 PM] ---
[8/18/2023, 1:54:06 PM] Loaded plugin: homebridge-samsung-tizen@5.2.6
[8/18/2023, 1:54:06 PM] Registering platform 'homebridge-samsung-tizen.SamsungTizen'
[8/18/2023, 1:54:06 PM] ---
[8/18/2023, 1:54:07 PM] Loaded plugin: homebridge-xiaomi-mi-air-purifier@2.0.2
[8/18/2023, 1:54:07 PM] Registering accessory 'homebridge-xiaomi-mi-air-purifier.XiaomiMiAirPurifier'
[8/18/2023, 1:54:07 PM] ---
[8/18/2023, 1:54:09 PM] Loaded plugin: @switchbot/homebridge-switchbot@2.7.1
[8/18/2023, 1:54:09 PM] Registering platform '@switchbot/homebridge-switchbot.SwitchBot'
[8/18/2023, 1:54:09 PM] ---
[8/18/2023, 1:54:09 PM] Loading 3 platforms...
[8/18/2023, 1:54:09 PM] [SwitchBot] Initializing SwitchBot platform...
[8/18/2023, 1:54:09 PM] [SamsungTizen] Initializing SamsungTizen platform...
[8/18/2023, 1:54:09 PM] Loading 2 accessories...
[8/18/2023, 1:54:09 PM] [Air Purifier] Initializing XiaomiMiAirPurifier accessory...
[8/18/2023, 1:54:09 PM] [Air Purifier] Air Purifier finished initializing!
[8/18/2023, 1:54:09 PM] [Vacuum] Initializing Eufy RoboVac accessory...
[8/18/2023, 1:54:09 PM] [Vacuum] Vacuum finished initializing!
Setup Payload:
X-HM://0024Q5IKPHMRX
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ XXX-XX-XXX │     
    └────────────┘     

[8/18/2023, 1:54:09 PM] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge D96C) is running on port 51714.
[8/18/2023, 1:54:09 PM] Frame TV 4DE1 is running on port 32928.
[8/18/2023, 1:54:09 PM] Please add [Frame TV 4DE1] manually in Home app. Setup Code: XXX-XX-XXX
[8/18/2023, 1:54:10 PM] [Air Purifier] Connected to "Air Purifier" @ [IP censored]!
[8/18/2023, 1:54:10 PM] [SwitchBot] Total SwitchBot Devices Found: 2
[8/18/2023, 1:54:10 PM] [SwitchBot] Restoring existing accessory from cache: Curtain DeviceID: C8E937298BA2
[8/18/2023, 1:54:10 PM] [SwitchBot] Curtain: Curtain Config: {"set_min":2,"set_max":98,"setOpenMode":"1","setCloseMode":"1","hide_lightsensor":false,"connectionType":"OpenAPI","external":false,"logging":"standard"}

Config for homebridge-switchbot

{
    "name": "SwitchBot",
    "credentials": {
        "token": "[Token censored]",
        "secret": "[Secret censored]",
        "notice": "Keep your Token & Secret a secret!"
    },
    "options": {
        "devices": [
            {
                "deviceId": "C8E937298BA2",
                "configDeviceName": "Curtain",
                "configDeviceType": "Curtain",
                "connectionType": "OpenAPI",
                "curtain": {
                    "set_min": 2,
                    "set_max": 98,
                    "setOpenMode": "1",
                    "setCloseMode": "1",
                    "hide_lightsensor": false
                },
                "history": true,
                "external": false,
                "logging": "standard"
            }
        ]
    },
    "platform": "SwitchBot"
}

Screenshots

No response

Device and Model

SwitchBot Curtain

Node.js Version

v18.17.0

NPM Version

v9.5.0

Homebridge Version

v3.0.17

Homebridge Switchbot Plugin Version

v2.7.1

Homebridge Config UI X Plugin Version

v4.50.4

Operating System

Synology DSM 7

donavanbecker commented 1 year ago

I don't have motion sensor as a service for curtains, I think you will have to clear your device's cache by either hiding it or using Homebridge UI Settkngs.

AndrewRed67 commented 1 year ago

I have done the following:

  1. Cleared the accessory's cache
  2. Cleared all accessories' caches
  3. Removed and reinstalled the SwitchBot plugin
  4. Hid the item from the Homebridge UI Settings (which does not affect HomeKit)
  5. Running the plugin in its own child bridge

This had no effect, the motion sensor is still there (and is gone if the plugin is removed).

banboobee commented 1 year ago

Motion sensor for a curtain device is required for EVE history feature . Setting "history" to false to disable the sensor. Clearing the cache also may be required.

AndrewRed67 commented 1 year ago

Setting EVE history to off, and removing all cached accessories seemed to make the motion sensor accessory disabled. Thanks for the tip, I could not have found this in the documentation thus far.