Jump to content

New Plugin - Philips Hue Mood Lighting


BillOatman
Go to solution Solved by Prydwyn,

Recommended Posts

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
Link to comment
Share on other sites

BillOatman
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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

BillOatman
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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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! 

Link to comment
Share on other sites

BillOatman
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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

WilhelmStroker
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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Bambu Utila

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Bambu Utila
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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Bambu Utila

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 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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?

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