Jump to content

New Plugin - Philips Hue Mood Lighting


Go to solution Solved by Prydwyn,

Recommended Posts

Posted (edited)
18 minutes ago, BillOatman said:

Hi.  I'm not sure what you mean by "doesn't work after 12am although the settings say it's up until 4AM".
Can you please give an example of a situation that is not working?  Show your current settings too please.

And please reproduce the situation on your system and attach the Emby log here.

But @chef I suspect this is the problem:


        private static bool ScheduleAllowScene(PhillipsHueSceneEmbyProfile profile)
        {
            if (string.IsNullOrEmpty(profile.Schedule)) return true;

            return (DateTime.Now.TimeOfDay >= TimeSpan.Parse(profile.Schedule + ":00")) &&
                   (DateTime.Now <= DateTime.Now.Date.AddDays(1).AddHours(4));
        }

"DateTime.Now.TimeOfDay >= TimeSpan.Parse(profile.Schedule + ":00"))"  Assuming profile.Schedule is 4:00 as soon as it crosses midnight this won't be true.

 

Yes, you are right @BillOatman, I think the code should be this:

        private static bool ScheduleAllowScene(SavedDevice device, PluginConfiguration config)
        {
            if (string.IsNullOrEmpty(device.SceneSchedule)) return true;            
            return (DateTime.Now.TimeOfDay >= TimeSpan.Parse(device.SceneSchedule + ":00") && DateTime.Now.TimeOfDay <= TimeSpan.Parse("4:00:00"));
        }

What do you think?

 

If we parse the TimeOfDay it won;t matter which day it is it will always run until 4:00am

Edited by chef
BillOatman
Posted (edited)
7 minutes ago, chef said:

Yes, you are right @BillOatman, I think the code should be this:


        private static bool ScheduleAllowScene(SavedDevice device, PluginConfiguration config)
        {
            if (string.IsNullOrEmpty(device.SceneSchedule)) return true;            
            return (DateTime.Now.TimeOfDay >= TimeSpan.Parse(device.SceneSchedule + ":00") && DateTime.Now.TimeOfDay <= TimeSpan.Parse("4:00:00"));
        }

What do you think?

That would return true between "SceneSchedule" and 4am which I think is the reverse of the intent of the setting??

 

Edited by BillOatman
  • Like 1
Posted
Just now, BillOatman said:

That would return true between "SceneSchedule" and 4am which I think is the reverse of the intent of the setting??

 

yeah that is what the setting should do. So that it doesn't run during the day, only after the scheduled time.

That way your living room lights aren't being effected by emby all day, but after the scheduled time (ex. 7:00pm and the kids are  finally to bed), when you watch a movie the lights would run the scene.

Does that sound right?

BillOatman
Posted (edited)
5 minutes ago, chef said:

yeah that is what the setting should do. So that it doesn't run during the day, only after the scheduled time.

That way your living room lights aren't being effected by emby all day, but after the scheduled time (ex. 7:00pm and the kids are  finally to bed), when you watch a movie the lights would run the scene.

Does that sound right?

Yes that sounds right!  But 4am?  My wife gets home from work at 2am or later and its dark until 6am generally :)

Edited by BillOatman
  • Like 1
Posted
5 minutes ago, BillOatman said:

Yes that sounds right!  

Okay, I pushed an update in the catalog and also updated Git.

We'll wait and see if it works alright now.

 

 

(Glad to talk with ya Bill!  Hope you're doin' well during the 2020 clusterf****).

Posted (edited)
20 minutes ago, BillOatman said:

Yes that sounds right!  But 4am?  My wife gets home from work at 2am or later and its dark until 6am generally :)

So should we make the time to stop running scenes configurable by the user as well? @BillOatman or 6. ... Yeah 6 😂

I'll push another change... One sec.

Edited by chef
Posted

Oh no!

when I updated the catalog I made a mistake on the version number. I wrote 1.0.19 instead of 1.0.1.9.

We're gonna hear about this one... Sorry Bill. 😓

Just tell people to install 1.0.2.1 from the catalog to fix the problem, if... when it comes up... Darn! 

BillOatman
Posted (edited)
23 minutes ago, chef said:

Oh no!

when I updated the catalog I made a mistake on the version number. I wrote 1.0.19 instead of 1.0.1.9.

We're gonna hear about this one... Sorry Bill. 😓

Just tell people to install 1.0.2.1 from the catalog to fix the problem, if... when it comes up... Darn! 

Poop Happens :)

Edited by BillOatman
  • Like 1
Bambu Utila
Posted
4 hours ago, BillOatman said:

Hi.  I'm not sure what you mean by "doesn't work after 12am although the settings say it's up until 4AM".
Can you please give an example of a situation that is not working?  Show your current settings too please.

And please reproduce the situation on your system and attach the Emby log here.

But @chef I suspect this is the problem:


        private static bool ScheduleAllowScene(PhillipsHueSceneEmbyProfile profile)
        {
            if (string.IsNullOrEmpty(profile.Schedule)) return true;

            return (DateTime.Now.TimeOfDay >= TimeSpan.Parse(profile.Schedule + ":00")) &&
                   (DateTime.Now <= DateTime.Now.Date.AddDays(1).AddHours(4));
        }

"DateTime.Now.TimeOfDay >= TimeSpan.Parse(profile.Schedule + ":00"))"  Assuming profile.Schedule is 4:00 as soon as it crosses midnight this won't be true.

 

I have the plugin set so it starts turning on scenes after 6:30PM.

In the settings it says the settings will be active until 4AM, but if I start watching a series or movie after 12am the scenes don't activate.

I'll haev to wait with reproducing this until it's after midnight, but i can.

Bambu Utila
Posted

ok, seems it's not necessary to reproduce anymore, seems you guys found the problem :)

Thanks for looking into this!!!

Bambu Utila
Posted

I've downloaded the new version.

I will report back after 12am 

Thanks again!

  • Like 1
WilhelmStroker
Posted
6 hours ago, chef said:

Oh no!

when I updated the catalog I made a mistake on the version number. I wrote 1.0.19 instead of 1.0.1.9.

We're gonna hear about this one... Sorry Bill. 😓

Just tell people to install 1.0.2.1 from the catalog to fix the problem, if... when it comes up... Darn! 

yeah ;) Emby keeps thinking that the dll has been updated and keeps prompting to reinstall. What's the best way to resolve it? Wait until 1.0.2.1 hits the catalogue?

Posted
13 minutes ago, WilhelmStroker said:

yeah ;) Emby keeps thinking that the dll has been updated and keeps prompting to reinstall. What's the best way to resolve it? Wait until 1.0.2.1 hits the catalogue?

Go to the catalogue and install 1.0.2.1.

Sorry for the inconvenience.  I messed up.

Bambu Utila
Posted

Had to reboot my computer for a Windows 10 update and now Emby keeps asking me to reboot the server to finish the install of the Hue plugin 1.0.19

After the reboot the message appears again

I have installed 1.0.2.1 on top of it and it indicates this in the plug in settings

But the message on the dashboard keeps popping up to reboot the server to finalize the install of v1.0.19

 

Should i just ignore the message? I've rebooted the Emby server 4 or 5 times but the result is the same

Posted
8 minutes ago, Bambu Utila said:

Had to reboot my computer for a Windows 10 update and now Emby keeps asking me to reboot the server to finish the install of the Hue plugin 1.0.19

After the reboot the message appears again

I have installed 1.0.2.1 on top of it and it indicates this in the plug in settings

But the message on the dashboard keeps popping up to reboot the server to finalize the install of v1.0.19

 

Should i just ignore the message? I've rebooted the Emby server 4 or 5 times but the result is the same

Go to the catalogue and install 1.0.2.1.

Sorry for the inconvenience.  I messed up

Bambu Utila
Posted
9 minutes ago, chef said:

Go to the catalogue and install 1.0.2.1.

Sorry for the inconvenience.  I messed up

I did that, but after the reboot of Emby for that update it keeps telling me that i need to reboot to finalize installing v1.0.19

 

No worries! Just want to make sure i do the right thingdashboard.thumb.PNG.c71f964d7c039979166c11bedf242fe5.PNG

 

1581304937_hueversion.PNG.df76205377280b995bb19e283ab4b7c5.PNG

 

BillOatman
Posted

I think you'll need ot make it 1.1.0.0. This is the hierarchy it shows now @chef

image.png.38a209ed07422b9f880b538b26394ee1.png

  • Like 1
Posted (edited)

Sorry everyone, I can't change version numbers after it's been uploaded.

I've contacted support to help me.

It was a mistake.

I see the issue I'll fix it!

Edited by chef
Posted

Version 1.1.0.0 is there.

 

 

  • Thanks 1
Bambu Utila
Posted

That did the trick!

No more requests for reboot after the first time

Thanks for sorting this out so quickly.

Posted

With the latest version installed (1.1.0.0) my Hue lights don't come on at all anymore now, not even before 12am

I've made sure the connection to the bridge is ok.

It sees the scenes and they are all filled out

But nothing seems to happen now 

WilhelmStroker
Posted

It's still working for me but I actually removed the dll and started all over again. 

Posted
10 hours ago, Bambu Utila said:

With the latest version installed (1.1.0.0) my Hue lights don't come on at all anymore now, not even before 12am

I've made sure the connection to the bridge is ok.

It sees the scenes and they are all filled out

But nothing seems to happen now 

What time have you put in the device schedule?

 

Posted
5 hours ago, chef said:

What time have you put in the device schedule?

 

I have it to turn on at 6:30PM

Posted
Just now, Bambu Utila said:

I have it to turn on at 6:30PM

Okay, I'll take a look at the code, but scenes should only run after 6:30pm.

That isn't happening?

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...