stefanvictora / hue-scheduler

☀ Adjust your Philips Hue and Home Assistant lights to your natural rhythm. With advanced schedules and transitions based on solar times.
Apache License 2.0
19 stars 0 forks source link

Scene sync seems not to work with `interpolate:true` #16

Open jryom opened 3 weeks ago

jryom commented 3 weeks ago

I have enabled scene sync and it seems to not work if within an interpolation window defined with interpolate:true. Example:

Office  sunrise     bri:100%  ct:2700  tr-before:nautical_dawn
Office  22:00       bri:80%   ct:2500  tr-before:sunset
Office  01:00       bri:1%    ct:2200  interpolate:true

Between 22:00 and nautical_dawn, the resulting scene has all lights turned off completely.

stefanvictora commented 3 weeks ago

Could you share your full configuration? Do you have any schedules that turn off your lights? I'm asking because scene sync doesn't look at individual states in isolation; instead, it computes a "full picture" of your configuration. This is necessary since scenes always control all lights in a zone or room, meaning there's no way to control only a few lights via scenes and leave the others as is.

Hue Scheduler tries to be smart about this "full picture", but it gets tricky for overlapping zones. Currently, it handles these cases by prioritizing states based on the zone size: states for smaller zones are treated as more specific and therefore override the light states of larger zones. It's a bit hard to explain without an example, but I hope this provides some insight.

stefanvictora commented 3 weeks ago

I had a closer look and actually found a sync issue with interpolate:true and cross-over states. Those have always been the trickiest to get right. I've pushed a fix with version 0.12.1; please give it a try and let me know if it resolves the issue.

Thanks for bringing this to my attention!