Jump to content

New Plugin - Philips Hue Mood Lighting


BillOatman
Go to solution Solved by Prydwyn,

Recommended Posts

BillOatman

@chef  I was thinking of a different tactic.  Save the time of the last event change per device, when a event change comes in, if the current time is less than some value (5 seconds?) from the saved time, ignore the event.  So stale events would get ignored.

 

Edited by BillOatman
Link to comment
Share on other sites

35 minutes ago, BillOatman said:

@chef  I was thinking of a different tactic.  Save the time of the last event change per device, when a event change comes in, if the current time is less than some value (5 seconds?) from the saved time, ignore the event.  So stale events would get ignored.

 

Okay. a global variable which holds DateTime.Now.AddSeconds(5) as a threshold for each client device. 

I can do that.  :)

Link to comment
Share on other sites

BillOatman
6 hours ago, chef said:

@BillOatman I pushed an update for the plugin in the catalog yesterday, and will update the github next.

 

Great I'll try it tonight.  @Altairletting you know as well :)

Link to comment
Share on other sites

altairr

Thanks! I'm following the topic closely so already installed the new version and did some testing. It doesn't seem to fix the issue on my end. 

Link to comment
Share on other sites

Hey @BillOatman

I've added this logic. Maybe you could tell me what you think.

Instead of writing only the paused session ID to the persisted list, it is now an object which holds the session Id, and the Time it was paused.

https://github.com/chefbennyj1/Emby.PhillipsHue/blob/master/PhillipsHue/ServerEntryPoint.cs#L50

 

Next, when the session gets paused, we create the PausedSession object and add it to the list.

https://github.com/chefbennyj1/Emby.PhillipsHue/blob/master/PhillipsHue/ServerEntryPoint.cs#L93

 

Finally, (when unpaused) we check if the session is in the list,  and if five seconds have also past since the session was paused.

https://github.com/chefbennyj1/Emby.PhillipsHue/blob/master/PhillipsHue/ServerEntryPoint.cs#L110

 

I haven't pushed this to the catalog yet... 

Link to comment
Share on other sites

  • 3 weeks later...
franciscojcrespo
On 6/16/2019 at 10:51 AM, BillOatman said:

I took the HueControl plugin by Biofects and modified it to set scenes defined within the Hue bridge instead of using light groups.  It is now in the Emby plugin catalog!

Additionally I added a couple new features:

 

1) Control for movies only. If checked, only movies will set the scenes.  Not TV Series for example.

2) Control only at night.  If checked, the plugin will only set the scenes between sunset and sunrise in your area.  You will need to set your latitude and longitude for this to work correctly. (Link on settings page)

3) The lights will not be controlled while you are watching live TV.

4) During the playing of trailers/prerolls, the scene will be set to your "paused" scene.

 

Note that when you enter scene names, they do not need to match the case of the scenes defined in the bridge.

That being said, even though the bridge allows you to create multiple scenes with the same name, but different case, you won't want to do that if using this plugin.

 

Feel free to try it out and let me know here if you see any issues.

If you currently use HueControl, I would suggest disabling it if you try this one.  Otherwise you might get a confusing, albeit interesting, light-show :)

 

Also note that transition time needs to be set in the scene for this plugin.  

Apparently not all Hue bridge apps allow this to be set.  

One free one that does for Windows is Huetro.

https://www.microsoft.com/en-us/p/huetro-for-hue/9wzdncrfjj3t?activetab=pivot:overviewtab

 

Version 1.1.0.0 now in the catalog. This version adds a configuration item to set a sunset offset that is used when determining whether or not to control the lights.

Hi. I am new to all this. How do I install this plugin on Emby running on a Synology NAS?

 

Link to comment
Share on other sites

On 2/3/2021 at 9:13 AM, franciscojcrespo said:

Hi. I am new to all this. How do I install this plugin on Emby running on a Synology NAS?

 

It should be in the catalog inside the dashboard 😀

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
jhoff80

So my stop state puts the lights at 100, and my play state puts the lights at 0, due to a projector and needing light control in the room.  I previously used a Kodi plugin, but that's no longer compatible in 19.0, so I started trying this out.  It works well, but is there any way to do a slow (5 second or so) fade up to 100 rather than just flipping the switch from 0 to 100?

Link to comment
Share on other sites

BillOatman
On 2/23/2021 at 1:31 PM, jhoff80 said:

So my stop state puts the lights at 100, and my play state puts the lights at 0, due to a projector and needing light control in the room.  I previously used a Kodi plugin, but that's no longer compatible in 19.0, so I started trying this out.  It works well, but is there any way to do a slow (5 second or so) fade up to 100 rather than just flipping the switch from 0 to 100?

Yes, this plugin uses scenes that are defined in the hue hub.  Define the fade/delay in the scene and the lights will behave as you expect.

Note that not all hue clients let you set the delay (I have no idea why). But the windows app Huetro does.

Edited by BillOatman
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
MagicDoubleM

Any chance for integrating support for the HueSync box? There's an (beta-)api for that and I'd love to start synching only when playback starts, also autoswitch between video and music mode would be cool...

Link to comment
Share on other sites

  • 9 months later...
BillOatman

I decided to revive this thing and I believe I have it working.  At least it hasn't messed up on me so far.

If anyone wants to try it out, feel free and let me know good or bad.  If bad things happen restart emby, turn on debug logging, recreate, download the log, turn off debug logging.  Send me the log, and describe what it is you did, what it did, and what you expected it to do.

It is built to work with release Emby, not sure if it will work with beta or not.

@chef  I have a branch cleverly named Bill.  I get a 403 forbidden error when I try and push to it.

 

PhillipsHue.dll

Edited by BillOatman
  • Like 1
Link to comment
Share on other sites

maegibbons

Hi

 

What have you actually revived?

I have been using the original plug in with beta for ages.

What changes are in this zip?

Krs

 

Mark

Link to comment
Share on other sites

BillOatman
2 hours ago, maegibbons said:

Hi

 

What have you actually revived?

I have been using the original plug in with beta for ages.

What changes are in this zip?

Krs

 

Mark

It always had trouble for me because it got multiple events from Emby,.  Sometimes it would miss a command like unpause.  I reworked a fair amount of the logic to deal with that. I also updated to the latest release emby dll.  You can wait if you are happy.  I will push my branch up when @chef is ready and he can decide to release or not.

Oh I also corrected the spelling of Philips where it wouldn't be too disruptive, and changed the logo in the plugin page.  @cheffeel free to not use it if you like the original better.  An artist I am not :)

Edited by BillOatman
Link to comment
Share on other sites

pir8radio
On 1/4/2022 at 12:26 PM, BillOatman said:

It always had trouble for me because it got multiple events from Emby,.  Sometimes it would miss a command like unpause.  I reworked a fair amount of the logic to deal with that. I also updated to the latest release emby dll.  You can wait if you are happy.  I will push my branch up when @chef is ready and he can decide to release or not.

Oh I also corrected the spelling of Philips where it wouldn't be too disruptive, and changed the logo in the plugin page.  @cheffeel free to not use it if you like the original better.  An artist I am not :)

nice ill have to check it out...  been using the other forever.. never had it miss a command..     will i have to set it up again or just update the plugin

 

Link to comment
Share on other sites

BillOatman
1 hour ago, pir8radio said:

nice ill have to check it out...  been using the other forever.. never had it miss a command..     will i have to set it up again or just update the plugin

 

I'm going to put in a pull request that @chef will look at and release if he likes it. But it would end up as an update and would not need to reconfigure anything,

Link to comment
Share on other sites

jachin99

I just started using the original plugin about a week ago and I did notice it missed or was slow to react to commands.  I might check this out, thanks

Link to comment
Share on other sites

  • 1 month later...

great plugin....but i only miss one thing .....the lights that i want to use...for example ..select only livingroom lights..so i can select or deselect lights

 

Link to comment
Share on other sites

BillOatman
7 hours ago, Sebasje said:

great plugin....but i only miss one thing .....the lights that i want to use...for example ..select only livingroom lights..so i can select or deselect lights

 

Hi, you setup a scene in the hub and that defines all of the various lights and their settings.

Link to comment
Share on other sites

  • 5 months later...
binarygeek119

hey could some of the work thats been put into introskip/credits, mainly the credits part be used to find the right part to call a new scene (

Movies Credit Scene) and get the right timing for each movie/series credits (Movies Credit Length). i know it doesnt work 100% right now because blackdetect cant work in all cases. but what if we combine it with scene change (sc_detect) blackdetect + scene change. plus the text recognition proof of concept could work great aswell along will blackdetect + scene change .
what do you think just thinking out loud here?

Edited by binarygeek119
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...