diyhue / diyHue

Main diyHue software repo
https://diyhue.org/
Other
1.56k stars 279 forks source link

(Ambilight+Hue) - Transition time can't be disabled/changed when using Zigbee2Mqtt #872

Open joaquinvacas opened 1 year ago

joaquinvacas commented 1 year ago

Describe the bug

Running latest diyHue stable version, Docker container, no issues at all, working flawlessly with Ambilight+Hue on a Philips TV for months.

Problem here is that the entertainment mode can't adjust transition time, it seems to be hard-coded.

I mean, using a WiFi bulb (tried a Tasmota bulb I had at home) the transitions between changes are instant, with no transition time. Which makes the experience feel real good, as diyHue can sync the bulb color at the same time than the TV, as it was expected in a real Hue Bridge with Ambilight+Hue.

When using Zigbee2mqtt, Philips Hue bulbs set with transition at 0, it keeps making some "fade" transition between all states.

Tried everything, but diyHue UI doesn't show any kind of config for changing this.

Steps to Reproduce

  1. Add Zigbee2mqtt color bulb to diyHue
  2. Pair diyHue to Philips Ambilight + Hue on TV
  3. Watch some content

Expected behavior Sync at time, with no fade/transition, as other bulbs do.

Logs No logs.

Docker Info (please complete the following information):

Checklist

Additional context

mariusmotea commented 1 year ago

Hi,

Supporting multiple types of lights with entertainment protocol required lot of tuning because some lights types are faster than other. ZigBee lights are somewhere in the middle, they can play nicely if the lights have good connection to the coordinator or bad if they using multiple proxy devices to reach the coordinator. Looking at the code i notice that we put a transitiontime value, but i think some lights may ignore it:

https://github.com/diyhue/diyHue/blob/master/BridgeEmulator/services/entertainment.py#L204-L207

I recommend you to mount this file from host in the container and try various values (restart the container on every change).

Also note that in order to create a better entertainment experience with slow protocols we created a function that skip the frames that don't differ too much from the previews one and this can be tuned here:

https://github.com/diyhue/diyHue/blob/master/BridgeEmulator/services/entertainment.py#L12-L13

GitHub
diyHue/entertainment.py at master · diyhue/diyHue
Main diyHue software repo. Contribute to diyhue/diyHue development by creating an account on GitHub.
GitHub
diyHue/entertainment.py at master · diyhue/diyHue
Main diyHue software repo. Contribute to diyhue/diyHue development by creating an account on GitHub.
mariusmotea commented 1 year ago

Also feel free to create a pull request if you find better values for this protocol so with the future updates you don't need to apply manual changes.