Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessory error in 3.5.1 #993

Closed
PaulPizzey247 opened this issue Jun 28, 2024 · 7 comments
Closed

Accessory error in 3.5.1 #993

PaulPizzey247 opened this issue Jun 28, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@PaulPizzey247
Copy link

PaulPizzey247 commented Jun 28, 2024

Describe the Bug

After I have updated to 3.5.1, the Bot I have exposed to the Home app as a switch, now displays as an outlet.

Even if I change it to something else, like a fan or faucet etc in the plugin config, it still appears as an outlet.

I have tried to downgrade, but I get this error.

npm error code ENOTEMPTY
npm error syscall rename
npm error path /var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot
npm error dest /var/lib/homebridge/node_modules/@switchbot/.homebridge-switchbot-cCp4HJsc
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot' -> '/var/lib/homebridge/node_modules/@switchbot/.homebridge-switchbot-cCp4HJsc'

To Reproduce

Install 3.5.1 on Raspberry Pi 4, with hub mini and Bot

Expected Behavior

Bot to be exposed to the Home app as the selected switch.

Relevant Log Output

[28/06/2024, 14:21:49] [SwitchBot] Total SwitchBot Devices Found: 2
[28/06/2024, 14:21:49] [SwitchBot] Restoring existing accessory from cache: HOME-PC deviceId: EC6D55CDE3C7
[28/06/2024, 14:24:30] [SwitchBot] Initializing SwitchBot platform...
[28/06/2024, 14:24:30] [SwitchBot] Initializing child bridge 0E:08:72:D9:D4:44
[28/06/2024, 14:24:30] Loading 2 accessories...
[28/06/2024, 14:24:33] [SwitchBot] Launched child bridge with PID 50461
[28/06/2024, 14:24:33] Loaded 0 cached accessories from cachedAccessories.0EDD2E555048.
[28/06/2024, 14:24:33] Loaded 0 cached accessories from cachedAccessories.0E7B4F9B2994.
[28/06/2024, 14:24:40] [SwitchBot] Loaded @switchbot/homebridge-switchbot v3.5.1 child bridge successfully
[28/06/2024, 14:24:40] Loaded 1 cached accessories from cachedAccessories.0E0872D9D444.
[28/06/2024, 14:24:41] [SwitchBot] Total SwitchBot Devices Found: 2
[28/06/2024, 14:24:41] [SwitchBot] Restoring existing accessory from cache: HOME-PC deviceId: EC6D55CDE3C7
[28/06/2024, 14:32:55] [SwitchBot] Restarting child bridge...
[28/06/2024, 14:32:55] Got SIGTERM, shutting down child bridge process...
[28/06/2024, 14:33:00] [SwitchBot] Child bridge process ended
[28/06/2024, 14:33:00] [SwitchBot] Process Ended. Code: 143, Signal: null
[28/06/2024, 14:33:07] [SwitchBot] Restarting Process...
[28/06/2024, 14:33:07] [SwitchBot] Launched child bridge with PID 52258
[28/06/2024, 14:33:10] Registering platform '@switchbot/homebridge-switchbot.SwitchBot'
[28/06/2024, 14:33:11] [SwitchBot] Loaded @switchbot/homebridge-switchbot v3.5.1 child bridge successfully
[28/06/2024, 14:33:11] Loaded 1 cached accessories from cachedAccessories.0E0872D9D444.
[28/06/2024, 14:33:11] Homebridge v1.8.3 (HAP v0.12.2) (SwitchBot) is running on port 48515.
[28/06/2024, 14:33:12] [SwitchBot] Total SwitchBot Devices Found: 2
[28/06/2024, 14:33:12] [SwitchBot] Restoring existing accessory from cache: HOME-PC deviceId: EC6D55CDE3C7

Config for homebridge-switchbot

{
    "name": "SwitchBot",
    "credentials": {
        "token": "12345678910",
        "secret": "12345678910",
        "notice": "Keep your Token & Secret a secret!"
    },
    "options": {
        "devices": [
            {
                "deviceId": "EC6D55CDE3C7",
                "configDeviceName": "HOME-PC",
                "configDeviceType": "Bot",
                "connectionType": "OpenAPI",
                "scanDuration": 1,
                "bot": {
                    "mode": "press",
                    "deviceType": "switch",
                    "allowPush": true,
                    "doublePress": 1
                },
                "maxRetry": 25,
                "refreshRate": 360,
                "offline": false,
                "external": false
            }
        ],
        "refreshRate": 360
    },
    "_bridge": {
        "username": "0E:08:72:D9:D4:44",
        "port": 48515
    },
    "platform": "SwitchBot"
}

Screenshots

image

Device and Model

Switch Bot

Node.js Version

29.15.0

NPM Version

10.7.0

Homebridge Version

1.8.3

Homebridge Switchbot Plugin Version

3.5.1

Homebridge Config UI X Plugin Version

4.56.4

Operating System

Homebridge

@PaulPizzey247 PaulPizzey247 added the bug Something isn't working label Jun 28, 2024
@PaulPizzey247 PaulPizzey247 changed the title Can't update to 3.5.1 Accessory error in 3.5.1 Jun 28, 2024
@quentinhayot
Copy link

I have the same issue. And this is in the Homebridge logs at startup:

[7/2/2024, 6:24:30 PM] ====================
[7/2/2024, 6:24:30 PM] ERROR LOADING PLUGIN @switchbot/homebridge-switchbot:
[7/2/2024, 6:24:30 PM] Error: Cannot find package 'node-switchbot' imported from /volume1/homebridge/node_modules/@switchbot/homebridge-switchbot/dist/platform.js
    at new NodeError (node:internal/errors:406:5)
    at packageResolve (node:internal/modules/esm/resolve:789:9)
    at moduleResolve (node:internal/modules/esm/resolve:838:20)
    at defaultResolve (node:internal/modules/esm/resolve:1043:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36)
[7/2/2024, 6:24:30 PM] ====================

@BenSmartHome
Copy link

Hi! I have the same issue since the last update. One Device (Switchbot Bot) appears as two devices and nothing works anymore.

image
image

Logfile:
[5.7.2024, 13:34:04] [SwitchBot] Restarting child bridge...
[5.7.2024, 13:34:04] Got SIGTERM, shutting down child bridge process...
[5.7.2024, 13:34:09] [SwitchBot] Child bridge process ended
[5.7.2024, 13:34:09] [SwitchBot] Process Ended. Code: 143, Signal: null
[5.7.2024, 13:34:16] [SwitchBot] Restarting Process...
Error: from server 192.168.x.x:37832 Error: connect ECONNREFUSED 192.168.x.x:37832
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '192.168.x.x',
port: 37832
}
[5.7.2024, 13:34:17] [SwitchBot] Launched child bridge with PID 30553
[5.7.2024, 13:34:21] Registering platform '@switchbot/homebridge-switchbot.SwitchBot'
[5.7.2024, 13:34:21] [SwitchBot] Loaded @switchbot/homebridge-switchbot v3.5.1 child bridge successfully
[5.7.2024, 13:34:21] Loaded 4 cached accessories from cachedAccessories.0E1CB8CA5871.
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Using Config Logging: debug
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Plugin Version: 3.5.1
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Finished initializing platform: SwitchBot
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Verifying Config
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Platform Config: {"logging":"debug"}
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Config OK
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Loading accessory from cache: Eingang
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Loading accessory from cache: Außentemperatur
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Loading accessory from cache: Schlafzimmer
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Loading accessory from cache: Kaffeemaschine
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Executed didFinishLaunching callback
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Retry Count: 0
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Using Default Refresh Rate (2 minutes).
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Using Default Push Rate.
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Using Default Max Retries.
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Using Default Delay Between Retries.
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Max Retries: 3
[5.7.2024, 13:34:21] [SwitchBot] [DEBUG] Delay Between Retries: 3000
[5.7.2024, 13:34:21] Homebridge v1.8.3 (HAP v0.12.2) (SwitchBot) is running on port 37832.
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] statusCode: 200
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] devicesAPI: {"statusCode":100,"body":{"deviceList":[{"deviceId":"C1CF5D401A9D","deviceName":"Außentemperatur","deviceType":"WoIOSensor","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"D9D551F4E029","deviceName":"Hub Wohnzimmer","deviceType":"Hub Mini","enableCloudService":false,"hubDeviceId":"000000000000"},{"deviceId":"DAA2B819AA5C","deviceName":"Kaffeemaschine","deviceType":"Bot","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"E3FB2940A824","deviceName":"Schlafzimmer","deviceType":"MeterPlus","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"F2EF1A91C518","deviceName":"Keypad","deviceType":"Keypad Touch","enableCloudService":true,"hubDeviceId":"D9D551F4E029","lockDeviceId":"FDFD217C8715","keyList":[{"id":11,"name":"","type":"permanent","status":"normal","createTime":1689599307000,"password":"","iv":""}]},{"deviceId":"FDFD217C8715","deviceName":"Eingang","deviceType":"Smart Lock","enableCloudService":true,"hubDeviceId":"D9D551F4E029"}],"infraredRemoteList":[]},"message":"success"}
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] devicesAPI Body: {"deviceList":[{"deviceId":"C1CF5D401A9D","deviceName":"Außentemperatur","deviceType":"WoIOSensor","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"D9D551F4E029","deviceName":"Hub Wohnzimmer","deviceType":"Hub Mini","enableCloudService":false,"hubDeviceId":"000000000000"},{"deviceId":"DAA2B819AA5C","deviceName":"Kaffeemaschine","deviceType":"Bot","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"E3FB2940A824","deviceName":"Schlafzimmer","deviceType":"MeterPlus","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"F2EF1A91C518","deviceName":"Keypad","deviceType":"Keypad Touch","enableCloudService":true,"hubDeviceId":"D9D551F4E029","lockDeviceId":"FDFD217C8715","keyList":[{"id":11,"name":"","type":"permanent","status":"normal","createTime":1689599307000,"password":"","iv":""}]},{"deviceId":"FDFD217C8715","deviceName":"Eingang","deviceType":"Smart Lock","enableCloudService":true,"hubDeviceId":"D9D551F4E029"}],"infraredRemoteList":[]}
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] devicesAPI StatusCode: 100
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] statusCode: 200 & devicesAPI StatusCode: 100
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] DeviceLists: [{"deviceId":"C1CF5D401A9D","deviceName":"Außentemperatur","deviceType":"WoIOSensor","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"D9D551F4E029","deviceName":"Hub Wohnzimmer","deviceType":"Hub Mini","enableCloudService":false,"hubDeviceId":"000000000000"},{"deviceId":"DAA2B819AA5C","deviceName":"Kaffeemaschine","deviceType":"Bot","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"E3FB2940A824","deviceName":"Schlafzimmer","deviceType":"MeterPlus","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"F2EF1A91C518","deviceName":"Keypad","deviceType":"Keypad Touch","enableCloudService":true,"hubDeviceId":"D9D551F4E029","lockDeviceId":"FDFD217C8715","keyList":[{"id":11,"name":"*******","type":"permanent","status":"normal","createTime":1689599307000,"password":"
","iv":""}]},{"deviceId":"FDFD217C8715","deviceName":"Eingang","deviceType":"Smart Lock","enableCloudService":true,"hubDeviceId":"D9D551F4E029"}]
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] DeviceLists Length: 6
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] SwitchBot Device Config Set: [{"deviceId":"DAA2B819AA5C","configDeviceName":"Kaffeemaschine ","configDeviceType":"Bot","connectionType":"OpenAPI","bot":{"mode":"press","deviceType":"switch"},"logging":"standard"}]
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] SwitchBot Devices: [{"deviceId":"C1CF5D401A9D","deviceName":"Außentemperatur","deviceType":"WoIOSensor","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"D9D551F4E029","deviceName":"Hub Wohnzimmer","deviceType":"Hub Mini","enableCloudService":false,"hubDeviceId":"000000000000"},{"deviceId":"DAA2B819AA5C","configDeviceName":"Kaffeemaschine ","configDeviceType":"Bot","connectionType":"OpenAPI","bot":{"mode":"press","deviceType":"switch"},"logging":"standard","deviceName":"Kaffeemaschine","deviceType":"Bot","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"E3FB2940A824","deviceName":"Schlafzimmer","deviceType":"MeterPlus","enableCloudService":true,"hubDeviceId":"D9D551F4E029"},{"deviceId":"F2EF1A91C518","deviceName":"Keypad","deviceType":"Keypad Touch","enableCloudService":true,"hubDeviceId":"D9D551F4E029","lockDeviceId":"FDFD217C8715","keyList":[{"id":11,"name":"","type":"permanent","status":"normal","createTime":1689599307000,"password":"
","iv":"****************"}]},{"deviceId":"FDFD217C8715","deviceName":"Eingang","deviceType":"Smart Lock","enableCloudService":true,"hubDeviceId":"D9D551F4E029"}]
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Discovered WoIOSensor: C1CF5D401A9D
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Discovered Hub Mini: D9D551F4E029
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Discovered Bot: DAA2B819AA5C
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Discovered MeterPlus: E3FB2940A824
[5.7.2024, 13:34:23] [SwitchBot] Device: Keypad with Device Type: Keypad Touch, is currently not supported.
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Discovered Smart Lock: FDFD217C8715
[5.7.2024, 13:34:23] [SwitchBot] Total SwitchBot Devices Found: 6
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] IR Device Config Not Set: undefined
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Total IR Devices Found: 0
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Außentemperatur registerDevice: true
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Kaffeemaschine registerDevice: true
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Schlafzimmer registerDevice: true
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Eingang registerDevice: true
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Außentemperatur connectionType: OpenAPI, will display in HomeKit
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Kaffeemaschine connectionType: OpenAPI, will display in HomeKit
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Schlafzimmer connectionType: OpenAPI, will display in HomeKit
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Device: Eingang connectionType: OpenAPI, will display in HomeKit
[5.7.2024, 13:34:23] [SwitchBot] Restoring existing accessory from cache: Außentemperatur deviceId: C1CF5D401A9D
[5.7.2024, 13:34:23] [SwitchBot] Restoring existing accessory from cache: Kaffeemaschine deviceId: DAA2B819AA5C
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Bot uuid: DAA2B819AA5C-Bot, (8e46d5f6-9ac2-4066-8610-971bbbed93d0)
[5.7.2024, 13:34:23] [SwitchBot] Restoring existing accessory from cache: Schlafzimmer deviceId: E3FB2940A824
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] MeterPlus uuid: E3FB2940A824-MeterPlus, (4bb98194-3b9e-43f3-b371-095e11b17415)
[5.7.2024, 13:34:23] [SwitchBot] Restoring existing accessory from cache: Eingang deviceId: FDFD217C8715
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] Smart Lock uuid: FDFD217C8715-Smart Lock, (542c2a1a-7bb4-4568-bd7d-49b8522a47bf)
[5.7.2024, 13:34:23] [SwitchBot] [DEBUG] WoIOSensor uuid: C1CF5D401A9D-WoIOSensor, (597172a9-525d-4833-921c-d26db944d863)

Before the Bot was Nice, because it showed the press funktion in the home app. So a few seconds after i clicked on my "Kaffeemaschine" the switch in home app turned off again. like the bot.

can you please implement this functionallity again?

@donavanbecker
Copy link
Collaborator

Can you try the latest beta:

npm version

Click here to find out how to install Beta

@BenSmartHome
Copy link

Thank you! Is there any problem with switchbot lock? Because i can't find it under supported devices.

@donavanbecker
Copy link
Collaborator

Thank you! Is there any problem with switchbot lock? Because i can't find it under supported devices.

not sure what you mean by that?

@Bgoshua
Copy link

Bgoshua commented Jul 6, 2024

Thanks @donavanbecker, duplicates removed, bots are responding and all errors are gone for me with beta.4 🫡🙌

@donavanbecker
Copy link
Collaborator

v3.6.0 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants