NiklasReiche / ad-spotify-mood-lights-sync

AppDaemon app that synchronizes rgb lights to the mood of the currently playing spotify song in Home Assistant.
MIT License
35 stars 5 forks source link

Dynamically select destination light (group) #7

Closed K4CZP3R closed 2 years ago

K4CZP3R commented 2 years ago

Is there any way to dynamically select the light which will be used with this app?

Why? I would like to have different mood lights based on time of the day.

PS: Thanks for this great and fun app!

NiklasReiche commented 2 years ago

While this is not a feature implemented directly by the app, you should be able to accomplish this behaviour with AppDaemon's built-in callback constraints. You would then need multiple config entries for this app, one for each of your sets of lights. You can then specify suitable constrain_start_time and constrain_end_time values for each config (see https://appdaemon.readthedocs.io/en/latest/APPGUIDE.html#time) in addition to any other constraints you may have set.

The only thing that would need an additional workaround is if you wanted to control light behaviour during the exact transition from the end time of one light group to the start time of another light group. With the current app implementation the lights stay on the last synced value when the app is turned off by its constraints (last time I checked, AppDaemon does not communicate this shutoff to the apps, so I haven't found a way to intercept the signal for implementing custom shutdown logic).

NiklasReiche commented 2 years ago

Hey @K4CZP3R, did you manage to achieve what you were looking for with the constraints solution? If so, I'd like to close this issue.