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
244 stars 53 forks source link

Bug: Indoor/Outdoor ThermoHydrometer throws error with undefined data #770

Closed sushshring closed 1 year ago

sushshring commented 1 year ago

Describe the Bug

Any connected Indoor/Outdoor ThermoHydrometer throws an error and reads incorrect data (0 degrees and 0% humidity)

To Reproduce

Add ThermoHydrometer to switchbot account and refresh homebridge

Expected Behavior

ThermoHydrometer data is provided in Apple Home and Homebridge.

Relevant Log Output

Homebridge v1.6.0 (HAP v0.11.0) (Homebridge CABC) is running on port 51721.
[7/24/2023, 4:55:30 PM] [SwitchBot] Total SwitchBot Devices Found: 3
[7/24/2023, 4:55:30 PM] [SwitchBot] DIY Speaker: Bose Speaker Config: {"connectionType":"OpenAPI","external":true}
[7/24/2023, 4:55:30 PM] [SwitchBot] TV: TV Config: {"connectionType":"OpenAPI","external":true}
[7/24/2023, 4:55:30 PM] [SwitchBot] Restoring existing accessory from cache: Air Conditioner DeviceID: 02-202307131956-27501715
[7/24/2023, 4:55:30 PM] [SwitchBot] Air Conditioner: Air Conditioner Config: {"connectionType":"OpenAPI"}
[7/24/2023, 4:55:30 PM] [SwitchBot] Restoring existing accessory from cache: Air Conditioner bedroom DeviceID: 02-202307181618-68086482
[7/24/2023, 4:55:30 PM] [SwitchBot] Air Conditioner: Air Conditioner bedroom Config: {"connectionType":"OpenAPI"}
[7/24/2023, 4:55:30 PM] [SwitchBot] Total IR Devices Found: 4
[7/24/2023, 4:55:30 PM] [SwitchBot] Restoring existing accessory from cache: Thermometer DeviceID: C2170ABD469C
[7/24/2023, 4:55:30 PM] [SwitchBot] WoIOSensor: Thermometer Config: {"connectionType":"OpenAPI"}
[7/24/2023, 4:55:30 PM] [SwitchBot] WoIOSensor: Thermometer refreshStatus enableCloudService: undefined

Config for homebridge-switchbot

{
            "name": "SwitchBot",
            "credentials": {
                "token": <redacted>,
                "secret": <redacted>
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "logging": "standard"
            },
            "platform": "SwitchBot"
        }

Screenshots

image

Device and Model

Indoor/Outdoor ThermoHydrometer

Node.js Version

v18.13.0

NPM Version

8.19.3

Homebridge Version

1.6.0

Homebridge Switchbot Plugin Version

2.6.2

Homebridge Config UI X Plugin Version

4.50.2

Operating System

Ubuntu 20.04

sushshring commented 1 year ago

Had to enable cloud services in the Switchbot app. It would be good to have a better log output for this case.

donavanbecker commented 1 year ago

Please open PR to add more logging