OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://www.switch-bot.com/
ISC License
229 stars 47 forks source link

Bug: Bug: latest update has broken Custom IR devices #981

Open thatpaulallen opened 4 weeks ago

thatpaulallen commented 4 weeks ago

Describe the Bug

Anytime I try to use a Custom IR device I get this error…

106/06/2024, 20:49:1411@switchbot/homebridge-switchbot] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside write handler for characteristic: Cannot set properties of undefined (setting 'On'). See https://homebridge.io/w/JtMGR for more info.

To Reproduce

This is an example of how I have my custom IR device set up. Just FYI: these worked perfectly before the latest update.

IMG_1497 IMG_1499

Expected Behavior

I expected it to work and not throw an error.

Relevant Log Output

[06/06/2024, 20:54:20] [@switchbot/homebridge-switchbot] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside write handler for characteristic: Cannot set properties of undefined (setting 'On'). See https://homebridge.io/w/JtMGR for more info.

Config for homebridge-switchbot

{
            "name": "SwitchBot",
            "credentials": {
                "token": "REDACTED",
                "secret": "REDACTED",
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "irdevices": [
                    {
                        "deviceId": "02-202308301151-29602846",
                        "configDeviceName": "AUX",
                        "hide_device": false,
                        "configRemoteType": "Others",
                        "connectionType": "OpenAPI",
                        "customize": true,
                        "customOn": "On",
                        "customOff": "Off",
                        "disablePushOff": false,
                        "other": {
                            "deviceType": "switch"
                        }
                    },
                    {
                        "deviceId": "02-202308301149-50310440",
                        "configDeviceName": "EQ",
                        "configRemoteType": "Others",
                        "connectionType": "OpenAPI",
                        "customize": true,
                        "customOn": "On",
                        "customOff": "Off",
                        "disablePushOn": false,
                        "disablePushOff": false,
                        "other": {
                            "deviceType": "switch"
                        }
                    },
                    {
                        "deviceId": "02-202309250925-22506214",
                        "configDeviceName": "HDMI-ARC",
                        "configRemoteType": "Others",
                        "connectionType": "OpenAPI",
                        "customize": true,
                        "customOn": "On",
                        "customOff": "Off",
                        "disablePushOff": true,
                        "other": {
                            "deviceType": "switch"
                        }
                    },
                    {
                        "deviceId": "02-202308301147-41281781",
                        "configDeviceName": "Power",
                        "configRemoteType": "Others",
                        "connectionType": "OpenAPI",
                        "customize": true,
                        "customOn": "On",
                        "customOff": "Off",
                        "other": {
                            "deviceType": "switch"
                        }
                    },
                    {
                        "deviceId": "02-202401231437-10926103",
                        "configDeviceName": "HDMI In",
                        "hide_device": true,
                        "configRemoteType": "Others",
                        "connectionType": "OpenAPI",
                        "customize": true,
                        "customOn": "On",
                        "customOff": "Off",
                        "disablePushOn": false,
                        "disablePushOff": false,
                        "other": {
                            "deviceType": "switch"
                        }
                    },
                    {
                        "deviceId": "02-202401281632-59518813",
                        "configDeviceName": "Options",
                        "hide_device": true,
                        "configRemoteType": "Others",
                        "connectionType": "OpenAPI",
                        "customize": true,
                        "customOn": "On",
                        "customOff": "Off",
                        "other": {
                            "deviceType": "switch"
                        }
                    },
                    {
                        "deviceId": "02-202401281633-61969554",
                        "configDeviceName": "Up",
                        "hide_device": true,
                        "configRemoteType": "Others",
                        "connectionType": "OpenAPI",
                        "customize": true,
                        "customOn": "On",
                        "customOff": "Off"
                    }
                ]
            },
            "platform": "SwitchBot"

Screenshots

No response

Device and Model

Raspberry Pi 3b+

Node.js Version

20.12.1

NPM Version

No clue

Homebridge Version

1.8.2

Homebridge Switchbot Plugin Version

3.5.0

Homebridge Config UI X Plugin Version

No response

Operating System

Raspbian

failbit commented 1 week ago

I have this issue aswell. Trying to downgrade.

donavanbecker commented 1 week ago

Can you try the latest beta?

thatpaulallen commented 1 week ago

Can you try the latest beta?

Just installed it. It nearly fixes my issue, but now all my devices appear as switches AND plugs in the Home app. The plugs work while the switches still throw an error in the Homebridge log.

In the meantime I'm downgrading to 3.4, which woks flawlessly.

IMG_1523

failbit commented 1 week ago

Can confirm. 3.4 works flawless after downgrade.

donavanbecker commented 1 week ago

v3.5.1 has been released, please install and let me know if this has been resolved.

thatpaulallen commented 6 days ago

v3.5.1 has been released, please install and let me know if this has been resolved.

It didn’t work. I still have a plug and a switch for each device for some reason (I only want a switch).

I get errors when I use the switch. The plug appears to work for the most part. I’m not sure what I’m looking at, but here’s my log…

in the meantime I’m going back to 3.4

IMG_1552

thatpaulallen commented 6 days ago

Not sure if this is helpful information or not, but both times I’ve rolled back my firmware I had to go back to 3.3 and then forward to 3.4 to get the plugs on each device to disappear.

The plugs remained if I merely rolled back to 3.4.