iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
386 stars 163 forks source link

Keeps contacting bulb #318

Open mikeMikeymike opened 2 years ago

mikeMikeymike commented 2 years ago

First let me say thanks so much for creating and maintaining this code. I appreciate all the work you have done.

Here's my problem. I have two Lumiman Candelabra bulbs (https://www.amazon.com/gp/product/B08XYZW69W/). One bulb, which I've named "porch-garage", works except that homebridge continues to contact the bulb about once a minute, even if the bulb is off. Here I have restarted homebridge and I haven't sent any commands The homebridge log:

[Tuya] setColorTemperature: 295
[Tuya] Sending porch-garage {"21":"white","23":152}
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] setColorTemperature: 295
[Tuya] Sending porch-garage {"21":"white","23":152}
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] setColorTemperature: 295
[Tuya] Sending porch-garage {"21":"white","23":152}
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] setColorTemperature: 294
[Tuya] Sending porch-garage {"21":"white","23":153}
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] setColorTemperature: 294
[Tuya] Sending porch-garage {"21":"white","23":153}
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] setColorTemperature: 293
[Tuya] Sending porch-garage {"21":"white","23":154}
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] setColorTemperature: 293
[Tuya] Sending porch-garage {"21":"white","23":154}
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8
[Tuya] Heard back from porch-garage with command 8

And it continues on in this pattern.

My config file for both bulbs is the same. I've played with a few different minWhiteColor and maxWhiteColor settings and it hasn't changed anything.

"type": "RGBTWLight",
"name": "porch-garage",
"id": "(redacted)",
"key": (redacted)",
"manufacturer": "Lumiman",
"model": "candelabra",
"dpPower": 20,
"dpBrightness": 22,
"dpColorTemperature": 23,
"minWhiteColor": 0,
"maxWhiteColor": 1000,
"dpMode": 21,
"dpColor": 24,
"colorFunction": "HSB",
"scaleBrightness": 1000,
"scaleWhiteColor": 1000
davida61 commented 2 years ago

Looks like you have adaptive lighting enabled for the bulbs so the colour temperature is changing for the bulbs automatically hence the updates. The adaptive lighting option is the top left "colour" from the colour options for the bulb in the HomeKit app.

You should be able to turn it off from the HomeKit UI but this does seem to not always work as easily as one would expect.

I have managed to disable it by selecting a colour from the Homekit app so the adaptive lighting stops then setting the light back to the colour temp I want from the Tuya app, all seems fine from then on.

No idea if this will work for your bulbs but worth a try....

mikeMikeymike commented 2 years ago

That was the problem. Fiddling around in the Home app managed to correct it, but I'm not sure I could reproduce what I did. Thanks for the help.

davida61 commented 2 years ago

No problems.

Just watch out for automations that may have the old settings saved as they may switch the adaptive lighting back on, delete the light and re-add without the adaptive lighting. It took me ages to find the last one - it was the one that turned on the kitchen light when the fridge door is opened....

mikeMikeymike commented 2 years ago

Thanks for the heads-up. Love your automated frig system!