Jump to content

New Plugin - Philips Hue Mood Lighting


BillOatman
Go to solution Solved by Prydwyn,

Recommended Posts

chef
Just now, muppet4k said:

so only problem is that many scenes are twice or more in the list and you dont see to which room or zone it belongs

 

1911700797_Bildschirmfoto2020-06-15um19_59_13.png.a0373caf6706fb52629d2e76befd81d0.png

 

Is the list updatet automatically?

 

The scene request should happen when you open the plugin configuration page.

 

Strange that it is duplicating scenes. 

 

Does it look like that in the hue hub scene list?

 

Link to comment
Share on other sites

muppet4k

maybe a ugly solution to write more details in the hue app:

e.g. Sternenlicht/All 

To see the difference between the other names.IMG_9630.thumb.PNG.dc6d3b15306c39dfa4099e4089c439be.PNG

But how can i update the dropdown list again?

Link to comment
Share on other sites

chef
23 minutes ago, muppet4k said:

maybe a ugly solution to write more details in the hue app:

e.g. Sternenlicht/All 

To see the difference between the other names.IMG_9630.thumb.PNG.dc6d3b15306c39dfa4099e4089c439be.PNG

But how can i update the dropdown list again?

I think I know what is happening. If you clear your browser cache, and then open the configuration page, does the list show as intended?

 

Also, we can definitely add extra data to the naming to better distinguish between scenes. 

Edited by chef
Link to comment
Share on other sites

muppet4k

so it updated the drop down list but i thought its at the end of the list, but its in the middle somewhere 🙂

137624964_Bildschirmfoto2020-06-15um20_51_22.png.0f1dd36bf5daedef7e676943fde6bad5.png

 

That he is dublicating the scenes is normal and your plugin works correct. Maybe one example for better understanding:

First in the App is to create a room/zone:

IMG_9631.thumb.PNG.20f7cd43f4bee7f8904af0eea62fa7fc.PNG

Than you can add the lights which do you want:

IMG_9632.thumb.PNG.9d68c608b836200d2cd7e3f8419d8955.PNG

And than you have some standart scenes from philips which you see double , three times and more in your drop down list. And also create some new Scene based on the room/zone.

Alle (is the zone id in this example)

IMG_9634.thumb.PNG.0fa4fb47f1d10d877ae8caa9543451ff.PNG

Hope thats more clear about hue App working.

Sorry that some scenes are in german 🙂

to Add some extra data between the scenes would be nice, if itisnt difficult 🙂

 

Link to comment
Share on other sites

BillOatman
21 hours ago, chef said:

 

It would be a very indepth project. The project, so far, is on GitHub, so if there was someone who wanted to do it, that would be welcome. 

It's just that there is a lot of configuration code and layout for room implementation, (switching between js and c# ends up being the most time consuming, even with snippets). 

 

@BillOatman I'm remembering the json dictionary weirdness... unique scene IDs as keys...  Which was a headache and a half for this API...LOL😳 why they do that is beyond me...

Would we scrap the scene config and focus on room IDs to trigger groups? 🤔 

I feel like I'd be making some empty promises, if I agreed to it.

Actually @chef, the plugin originally DID operate on rooms and lights.  It was very cumbersome and awkward and I was asked by several people to switch it to scenes instead as it is much simpler conceptually, and it is what scenes were designed for in the first place :)

That group based source code is here.

https://github.com/nxenos83/emby.plugin.HueControl/releases/tag/v0.1

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

Prydwyn

That's unfortunate, as the Hue Bridge stores the scenes by room - so you can have (for example) four scenes all called 'Dimmed' : in my case one in the lounge, one in the hall, and in each of the two bedrooms. When selecting the scenes in the plug in, using the above example, the scene 'Dimmed' appears 4 times (once for each room) but there is no way to work out which one relates to which room (except by trial and error) 

Link to comment
Share on other sites

chef
33 minutes ago, Prydwyn said:

That's unfortunate, as the Hue Bridge stores the scenes by room - so you can have (for example) four scenes all called 'Dimmed' : in my case one in the lounge, one in the hall, and in each of the two bedrooms. When selecting the scenes in the plug in, using the above example, the scene 'Dimmed' appears 4 times (once for each room) but there is no way to work out which one relates to which room (except by trial and error) 

Okay, what we can do (for the meantime) is  add extra data to the scene selection to better outline which scene is which.

Eventually we can group the information in the scene drop-down boxes, into room headings. This should help organize the information coming back from the API better and make the configuration more intuitive. 

I'll start on this right away.

Edited by chef
  • Thanks 1
Link to comment
Share on other sites

muppet4k
42 minutes ago, chef said:

Okay, what we can do (for the meantime) is  add extra data to the scene selection to better outline which scene is which.

Eventually we can group the information in the scene drop-down boxes, into room headings. This should help organize the information coming back from the API better and make the configuration more intuitive. 

I'll start on this right away.

That would help a lot 🙂

if you need me for some test or anything else let me know 😉

Link to comment
Share on other sites

BillOatman
1 hour ago, Prydwyn said:

That's unfortunate, as the Hue Bridge stores the scenes by room - so you can have (for example) four scenes all called 'Dimmed' : in my case one in the lounge, one in the hall, and in each of the two bedrooms. When selecting the scenes in the plug in, using the above example, the scene 'Dimmed' appears 4 times (once for each room) but there is no way to work out which one relates to which room (except by trial and error) 

It has been a while since I looked, but I don't think that is true.  At least it's not shown that way in the app that I use.  I'll open that app tonight, maybe I'm remembering wrong or the app is playing some games.  

Edited by BillOatman
Link to comment
Share on other sites

BillOatman

Yeah it's as I remembered. Scenes are their own entity, not tied to a room.  At least in the Huetro Windows app.  You define a stand alone scene, and assign lights etc to the scene.

I highly recommend this app for creating scenes and other Hue related configuration.    Huetro for Windows

image.thumb.png.00759f3e17557f33ce45870395fc036a.png

  • Like 1
Link to comment
Share on other sites

muppet4k

so hope you can put some more details in the dropdown list 🙂

never heart about huetro and i have no windows. 

Phillips Hue has is own app to configure over IOS and Android and also syncs with Google Alexa und Apple Homekit.

I think that make sense because the are the most operating systems actually. 🙂

 

Link to comment
Share on other sites

Prydwyn

So I have downloaded Huetro (and paid for the premium version)... and I can now see the major flaw in the plugin. 

It works brilliantly, and I genuinely love it... however, it should not require anyone to download any additional apps apart from the official Hue app. It looks like it has been designed on the assumption that the end user is prepared to, (or even able to) download 3rd party apps that are not officially associated with Phillips Hue. 

I appreciate that this might make it easier for you to actually design the app in the first place, but makes it very restrictive otherwise. I can see that with the Huertro app that I can do what I want to do, but not everybody has Windows (and I don't know what is available for a Mac), and I can't find an equivalent app on Android (and I don't use iOS). 

In my genuinely humble opinion, and I do appreciate all the work that has been done, the plugin does really need to be designed around the assumption that the user is only using the official Hue app.

I hope you take my comments in the constructive way that they are intended.

 

Link to comment
Share on other sites

chef

I finally got a moment during this PITA pandemic reopening to look at some code. 

 

There isn't a whole lot of extra stuff I can put into scenes from the API. 

 

It does give me light numbers (example: 1,2)

But I'm not sure that is much more help to differentiate the scenes if they are named the same.

 

Is there any way you could uniquely name your scenes?

Link to comment
Share on other sites

muppet4k

Good Morning,

i looked a little bit in the documentation and tried the get started stuff e.g.

https://XXXIPADRESS/api/lrizpbkD3olbpssK7coQ3sCtT9LtNUzAYpE539ir/groups

And then you get the rooms/zones like:

 

{"1":{"name":"Steh Wohn","lights":["12"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Living room","action":{"on":false,"bri":55,"hue":59010,"sat":66,"effect":"none","xy":[0.4117,0.3350],"ct":292,"alert":"select","colormode":"xy"}},"2":{"name":"Flur","lights":["7"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Other","action":{"on":false,"bri":77,"ct":366,"alert":"select","colormode":"ct"}},"3":{"name":"schlafzimmer","lights":["8"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Living room","action":{"on":false,"bri":254,"alert":"select"}},"4":{"name":"Wall","lights":["17"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Studio","action":{"on":false,"bri":55,"hue":35785,"sat":135,"effect":"none","xy":[0.2643,0.3843],"ct":153,"alert":"none","colormode":"xy"}},"5":{"name":"Background","lights":["14","15"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":90,"hue":37346,"sat":189,"effect":"none","xy":[0.2170,0.3521],"ct":153,"alert":"none","colormode":"xy"}},"9":{"name":"Säule","lights":["6","13","11"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":7524,"sat":254,"effect":"none","xy":[0.4748,0.3480],"ct":225,"alert":"select","colormode":"ct"}},"10":{"name":"Küche","lights":["16"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Dining","action":{"on":false,"bri":254,"ct":230,"alert":"select","colormode":"ct"}},"12":{"name":"Line","lights":["6"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":7524,"sat":254,"effect":"none","xy":[0.4748,0.3480],"ct":294,"alert":"none","colormode":"xy"}},"13":{"name":"Side","lights":["18"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":37843,"sat":147,"effect":"none","xy":[0.2531,0.3489],"ct":153,"alert":"none","colormode":"xy"}},"14":{"name":"Alle","lights":["14","15","6","11","17","18","12"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":59010,"sat":66,"effect":"none","xy":[0.4117,0.3350],"ct":292,"alert":"select","colormode":"xy"}}}

Will this help?

 

Link to comment
Share on other sites

BillOatman

To explain this better, I have attached the scene related  API  documentation from the Hue developers web site that @chef is working with.  It should explain how scenes are created, modified, and set (made active).  Hopefully it clears this up.

Hue Scene API.pdf

Link to comment
Share on other sites

chef
10 hours ago, muppet4k said:

Good Morning,

i looked a little bit in the documentation and tried the get started stuff e.g.

https://XXXIPADRESS/api/lrizpbkD3olbpssK7coQ3sCtT9LtNUzAYpE539ir/groups

And then you get the rooms/zones like:

 

{"1":{"name":"Steh Wohn","lights":["12"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Living room","action":{"on":false,"bri":55,"hue":59010,"sat":66,"effect":"none","xy":[0.4117,0.3350],"ct":292,"alert":"select","colormode":"xy"}},"2":{"name":"Flur","lights":["7"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Other","action":{"on":false,"bri":77,"ct":366,"alert":"select","colormode":"ct"}},"3":{"name":"schlafzimmer","lights":["8"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Living room","action":{"on":false,"bri":254,"alert":"select"}},"4":{"name":"Wall","lights":["17"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Studio","action":{"on":false,"bri":55,"hue":35785,"sat":135,"effect":"none","xy":[0.2643,0.3843],"ct":153,"alert":"none","colormode":"xy"}},"5":{"name":"Background","lights":["14","15"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":90,"hue":37346,"sat":189,"effect":"none","xy":[0.2170,0.3521],"ct":153,"alert":"none","colormode":"xy"}},"9":{"name":"Säule","lights":["6","13","11"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":7524,"sat":254,"effect":"none","xy":[0.4748,0.3480],"ct":225,"alert":"select","colormode":"ct"}},"10":{"name":"Küche","lights":["16"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Dining","action":{"on":false,"bri":254,"ct":230,"alert":"select","colormode":"ct"}},"12":{"name":"Line","lights":["6"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":7524,"sat":254,"effect":"none","xy":[0.4748,0.3480],"ct":294,"alert":"none","colormode":"xy"}},"13":{"name":"Side","lights":["18"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":37843,"sat":147,"effect":"none","xy":[0.2531,0.3489],"ct":153,"alert":"none","colormode":"xy"}},"14":{"name":"Alle","lights":["14","15","6","11","17","18","12"],"sensors":[],"type":"Zone","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Downstairs","action":{"on":false,"bri":55,"hue":59010,"sat":66,"effect":"none","xy":[0.4117,0.3350],"ct":292,"alert":"select","colormode":"xy"}}}

Will this help?

 

I wish that return data had a corasponding scene ID to make the connection for groups or rooms.  There seems to be an array light ID's, and the "class" which is the group.

 

It could be possible to access that endpoint and do a search for individual scene light ID's that appear in each group, and tag each scene with a "class" value?

 

What if the scene has lights from two different groups? 

 

 

Edited by chef
Link to comment
Share on other sites

  • 1 month later...
judgey

Hey sorry if this has been asked before...

 

I have emby on a server in France and hue at home in the uk... is this something i can use?

Link to comment
Share on other sites

Prydwyn

I don't think that is possible. When you first set up the plug in you have to connect it to your Hue Bridge by pushing the big button on the middle of the bridge (assuming you have a v2 bridge). This is a security feature to ensure you are authorising access to your Hue. The Bridge and the device (in this case your server) have to be on the same network for this initial step. 

  • Like 1
Link to comment
Share on other sites

chef

When I was testing out the API for the plugin one of the other users allowed me access to their hub. I'm in Canada and he was in the States.

 

Inside the configuration XML the IP address is saved. You could try...maybe.. opening the hubs port to the internet, and switch the IP in the configuration to the WAN address. 

 

Probably not secure in anyway... If that works at all, which I'm not sure about.

Link to comment
Share on other sites

  • 3 weeks later...

Love the plugin.  It was exactly what I as looking for in Hue support.

I'm having an issue though where it randomly stops working.  I haven't found any pattern to it.  Last night it happened when a video I was watching ended and and when I hit play on the next episode it stayed in my stopped scene and didn't go to the playing scene.  I've had this happen to me a number of times over the last few months.  When it happens the configuration page doesn't list any of my scenes when I select any of the states in the configuration screen.  The only fix I've found so far is to reboot the server.  Are there any logs or anything that I can check or send in to try to figure out what's causing it?  I'm running the Emby server on a Synology NAS btw if that makes a difference.  

Link to comment
Share on other sites

Bambu Utila

Plugin works great, but the functionality doesn't work after 12am although the settings say it's up until 4AM

Any chance this could get fixed in the next version? Or even better, let us choose the start and end time in stead of just the start time

I'm using v1.0.1.6 which should be the latest version

Edited by Bambu Utila
Link to comment
Share on other sites

  • 2 weeks later...
Bambu Utila

Hi, is somebody still developing this addon?

Just wonder if it's possible to adjust it so that it works after 12am :)

Other than that it works perfect for me, just wish it would work after midnight. Now it feels like my computer is telling me to go to bed :(

Being shamed is never fun ;)

 

Link to comment
Share on other sites

BillOatman
On 8/31/2020 at 9:35 AM, Bambu Utila said:

Plugin works great, but the functionality doesn't work after 12am although the settings say it's up until 4AM

Any chance this could get fixed in the next version? Or even better, let us choose the start and end time in stead of just the start time

I'm using v1.0.1.6 which should be the latest version

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.

 

Edited by BillOatman
Link to comment
Share on other sites

9 hours ago, Bambu Utila said:

Hi, is somebody still developing this addon?

Just wonder if it's possible to adjust it so that it works after 12am :)

Other than that it works perfect for me, just wish it would work after midnight. Now it feels like my computer is telling me to go to bed :(

Being shamed is never fun ;)

 

What value is in the device setup "schedule  time"?

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