homebridge-switchbot icon indicating copy to clipboard operation
homebridge-switchbot copied to clipboard

Bug: Device: undefined with Device Type: undefined, is currently not supported.

Open zsiraph opened this issue 1 year ago • 15 comments

Describe the Bug

All of a sudden a perfectly good config which was bulletproof for more than a year now suddenly gets this message and the bot does not work from homebridge.

The device type is clearly set, yet the plugin does not acknowledges it.

Tried to uninstall and reinstall it, did not help.

To Reproduce

Just try to set up a standard switchbot bot.

Expected Behavior

The device type is set to Bot. The expected behaviour would be that the plugin acknowledges this.

Relevant Log Output

[SwitchBot] Device: undefined with Device Type: undefined, is currently not supported. Submit Feature Requests Here: https://tinyurl.com/SwitchBotFeatureRequest, device: {"configDeviceName":"Switchbot GDoor","deviceId":"xxxxxx","configDeviceType":"Bot","connectionType":"OpenAPI","type":"switch","mode":"press","allowPush":true,"maxRetries":5}

Config for homebridge-switchbot

{
            "name": "SwitchBot",
            "credentials": {
                "token": "yyyy",
                "secret": "zzzzz",
            },
            "options": {
                "devices": [
                    {
                        "configDeviceName": "Switchbot GDoor",
                        "deviceId": "xxxxxxxx",
                        "configDeviceType": "Bot",
                        "connectionType": "OpenAPI",
                        "type": "switch",
                        "mode": "press",
                        "allowPush": true,
                        "maxRetries": 5
                    }
                ]
            },
            "platform": "SwitchBot"
        }

Screenshots

homebridge-switchbot-device-type

Device and Model

SwitchBot Hub Mini V5.7-4.0 & Switchbot V6.6

Node.js Version

v.22.11.0

NPM Version

v10.9.0

Homebridge Version

v1.8.5.

Homebridge Switchbot Plugin Version

v4.1.4.

Homebridge Config UI X Plugin Version

v.4.63.0

Operating System

Raspbian

zsiraph avatar Nov 22 '24 19:11 zsiraph

I’m seeing the exact same issue, with the exact same config.

I did completely remove the bot and reinstall the plugin fresh. Worked for a day then back to the above issue.

I’ve found it to be incredibly unreliable for a number of plug in version.

domre77 avatar Nov 23 '24 18:11 domre77

I have the same issue!

Niklas31 avatar Nov 24 '24 14:11 Niklas31

same issue here with switchbot bot. There has been issues with the API server recently? Every now and then, I can no longer control my switchbot bot based on API.

weim-mkt avatar Nov 24 '24 17:11 weim-mkt

API has been very unreliable for months. This issue is different though, in that the plug thinks it’s an unsupported device and never works.

domre77 avatar Nov 24 '24 18:11 domre77

Sounds like a duplicate of #1107. I've added a workaround there (https://github.com/OpenWonderLabs/homebridge-switchbot/issues/1107#issuecomment-2460441600)

Stausssi avatar Nov 26 '24 13:11 Stausssi

Sounds like a duplicate of #1107. I've added a workaround there (#1107 (comment))

I tried the "fix" but same error. Now even in my curtain:

image

Here is my config:

devices: [
            {
                "configDeviceName": "Cortina 2",
                "deviceId": "C8F115DC060C",
                "configDeviceType": "Curtain",
                "connectionType": "OpenAPI",
                "hide_lightsensor": true,
                "set_min": 5,
                "set_max": 95
            },
            {
                "configDeviceName": "Bot",
                "deviceId": "CE5138DFD63E",
                "configDeviceType": "Bot",
                "connectionType": "OpenAPI",
                "type": "Switch",
                "mode": "press"
            }
        ],

Niklas31 avatar Nov 26 '24 18:11 Niklas31

Well, the solution for me was to ditch the whole plugin and go for a matter supported Hub2 with my bot.

zsiraph avatar Nov 26 '24 19:11 zsiraph

I can confirm the Switch worked for me. Had to restart the home hub though.

bwt615 avatar Nov 28 '24 17:11 bwt615

Resetting plugin, hubs and devices didn't work. Bots are still not recognised.

This plug-in has become very buggy since 2023. Is there proper dev support going forward? The switchbot matter integration is half baked and missing so many features

dampney avatar Dec 03 '24 08:12 dampney

I'm having the same issue. Turning on debug logging reveals what might be the cause in my case:

[06/12/2024, 02:19:10] [SwitchBot] [DEBUG] Got devices: {"statusCode":190,"body":{},"message":"Requests reached the daily limit"}
[06/12/2024, 02:19:10] [SwitchBot] [DEBUG] statusCode: 200
[06/12/2024, 02:19:10] [SwitchBot] [DEBUG] response: {"statusCode":190,"body":{},"message":"Requests reached the daily limit"}

It looks like the plugin is unable to retrieve devices due to hitting API limits. (#1108)

neegool avatar Dec 05 '24 17:12 neegool

I only have a Curtain and just started seeing this issue today, though it may have existed for the last week or so.

I noticed that the log is reporting this error with array values that include configDeviceType, whereas the SwitchBot API documentation only references deviceType. Not sure if that matters, but I thought I’d call it out.

Also, I downgraded to 3.8.3 and immediately started getting the error 190 about too many API calls (#1108) even though my device settings are the 4.1.5 defaults. When I upgrade to 4.1.0 or later, the 190 error goes away, but I get the undefined device type error instead.

Finally, everything happening in that last paragraph is from a clean install of the plugin (though I retained my older API key and Secret…might try to replace those and test again if I have time later tonight…)

Hopefully all of this helps. Thank you!

*** update…either SwitchBot changed something, or resetting my API keys resolved this for me. I just did the API key reset this morning and the error is gone — though unfortunately I didn’t check anything before the reset so I can’t say which one it is ***

seanwalter avatar Dec 15 '24 22:12 seanwalter

Same issue here, even after resetting the Secret Key. Can't reset the actual Token itself though. Curtains work fine. Issue must be exclusive to the Bot. @donavanbecker Will this be fixed anytime soon?

FranciRoosters avatar Dec 28 '24 11:12 FranciRoosters

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jan 13 '25 11:01 github-actions[bot]

Replying because this isn’t fixed. What’s the situation? Is this being worked on, or no longer a priority?

domre77 avatar Jan 14 '25 08:01 domre77

Adding to this some debug logs.

[01/09/2025, 16:53:36] [SwitchBot] [DEBUG] SwitchBot Device Config Set: [{"configDeviceName":"Bot 1F","deviceId":"XXXXXXXXXX","configDeviceType":"Bot","connectionType":"OpenAPI","customBLEaddress":"XXXXXXXXXX","logging":"debug"}]
[01/09/2025, 16:53:36] [SwitchBot] [DEBUG] SwitchBot Devices: [{"configDeviceName":"Bot 1F","deviceId":"XXXXXXXXXX","configDeviceType":"Bot","connectionType":"OpenAPI","customBLEaddress":"XXXXXXXXXX","logging":"debug"}]
[01/09/2025, 16:53:36] [SwitchBot] Device: undefined with Device Type: undefined, is currently not supported. Submit Feature Requests Here: https://tinyurl.com/SwitchBotFeatureRequest, device: {"configDeviceName":"Bot 1F","deviceId":"XXXXXXXXXX","configDeviceType":"Bot","connectionType":"OpenAPI","customBLEaddress":"XXXXXXXXXX","logging":"debug"}
[01/09/2025, 16:53:36] [SwitchBot] [DEBUG] IR Device Config Not Set: undefined
[01/09/2025, 16:53:36] [SwitchBot] [DEBUG] [parseAdvertising.] return null, model "" not available!
[01/09/2025, 16:53:36] [SwitchBot] [DEBUG] [parseAdvertising.XXXXXXXXXX.H] return {"id":"XXXXXXXXXX","address":"XXXXXXXXXX","rssi":-70,"serviceData":{"model":"H","modelName":"WoHand","modelFriendlyName":"Bot","mode":true,"state":true,"battery":100}}

Sankgreall avatar Sep 01 '25 15:09 Sankgreall

Same issue with a new install.

macOS 26.3 Homebridge v1.11.1 homebridge-switchbot v4.3.3

*updating to homebridge-switchbot v5.0.0-beta.69 resolved the issue.

jocamero avatar Dec 29 '25 21:12 jocamero