merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
364 stars 62 forks source link

Device not working properly in HomeKit #540

Closed 350d closed 7 months ago

350d commented 8 months ago

Describe the bug For some reason it shows with black color in HomeKit and color temperature selector are red. Can't change both parameters in HomeKit.

Expected behavior Both params should be visible and adjustable in HomeKit

Your config.json

                {
                    "name": "Desk Lamp",
                    "ip": "192.168.....",
                    "token": "*********",
                    "deviceId": "11231231231",
                    "model": "philips.light.candle2",
                    "pollingInterval": 3600,
                    "deepDebugLog": false,
                    "micloud": {
                        "username": "",
                        "password": "",
                        "country": "cn",
                        "forceMiCloud": true
                    },
                    "buzzerControl": false,
                    "ledControl": false,
                    "childLockControl": false,
                    "modeControl": false
                }

Debug log

[24/10/2023, 00:40:54] [miot] [Desk Lamp] Initializing device services
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Device services: [
  "light"
]
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Initializing device properties
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Device properties: [
  "light:on",
  "light:brightness",
  "light:color-temperature"
]
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Initializing device actions
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Successfully created a Light device! It is a Xiaomi Philips Zhirui Candle Light Bulb (Crystal Version).
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Initializing accessory!
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Accessory successfully initialized!
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Registering 1 accessories!
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Everything looks good! Initiating property polling!
[24/10/2023, 00:40:54] [miot] [Desk Lamp] Log in to MiCloud!
[24/10/2023, 00:40:57] [miot] [Desk Lamp] Successfully connected to MiCloud! Setting up miot device from MiCloud connection!
[24/10/2023, 00:40:58] [miot] [Desk Lamp] Connected to device: philips.light.candle2
[24/10/2023, 00:40:58] [miot] [Desk Lamp] Doing initial property fetch.
[24/10/2023, 00:41:00] [miot] [Desk Lamp] Starting property polling.

Screenshots IMG_4191 IMG_4192

Additional context Device history https://github.com/merdok/homebridge-miot/issues/198 I've tried to manually update device model with philips.light.bulb and it works fine after. I've tried to force MiCloud connection and disable it - doesn't help.

merdok commented 8 months ago

Probably during auto property detection something is going wrong for your device. Would need to check that...

merdok commented 8 months ago

Oh but in the other bug it was confirmed working so not sure why do you see it like that... will check it out

350d commented 8 months ago

Sorry, philips.light.bulb shows ok in HomeKit but doesn't work too!

merdok commented 8 months ago

What does the debug log say?

350d commented 8 months ago

I've enabled deep debug log but there is nothing in Homebridge console about this lamp on any Home App interactions. Also it's acting wired - for example it was at 10% brightness and I set 20%. In home App it will move the slider to 20%, pause a second, move it back to 10%, pause again and move it to 20% finally. Same way with toggle it on/off.

merdok commented 8 months ago

You have to start homebridge in debug mode to see any log. Without that deep debug log will not work. Sounds like the connection to the lamp is quite slow, that might cause the effect.