• 1
  • 25
  • 26
  • 27
  • 28(current)
  • 29
Philips hue integration or add-on
(2019-06-18, 23:43)koekiemonster Wrote: you guessed correctly :-) And nope, I'm not active on the dutch htforum.

good news: I figured out how to make stuff happen on player status changes (playback started/stopped/paused/resumed/etc). It is not too complex, but it does require a separate companion plugin (I'm now writing it). Once that is finished I'll improve the github page and make a separate thread.

My plan for setting things up (input welcome):
The hue controller plugin will stay as is: it shows your hue setup and allows you to toggle rooms and apply scenes. In addition to this the scenes will get a context menu, with options to set the selected scene as "apply when starting/resuming video playback", "apply when pausing video playback", "apply when stopping video playback". If you select one of these options, they get stored in the plugin configuration.
The companion plugin (currently called script.service.hue.events) will then look up and apply these scenes whenever playback status is changed.

Other options I'm thinking about are:
- a toggle for only changing the lighting if it is actually on (I have no need for movie lighting when the sun is up)
- a speed setting for the transition time when applying scenes

Once I've got this working I'll take a peek at windows support (sorry, low priority because I'm mostly running Linux)
Thanks for the reply. Win10 is my test machine. The main cinema I use pure Libreelec x86 and the music Libreelec Raspberry 3 Pi B + where I did not test. If it does and will be fully functional it will be perfect. Thanks again for your work.
Reply
Tested on Libreelec x86, current base functions work perfectly (load HUE, scenes to switch on with Kodi driver)
Reply
(2019-06-18, 23:43)koekiemonster Wrote: you guessed correctly :-) And nope, I'm not active on the dutch htforum.

good news: I figured out how to make stuff happen on player status changes (playback started/stopped/paused/resumed/etc). It is not too complex, but it does require a separate companion plugin (I'm now writing it). Once that is finished I'll improve the github page and make a separate thread.

My plan for setting things up (input welcome):
The hue controller plugin will stay as is: it shows your hue setup and allows you to toggle rooms and apply scenes. In addition to this the scenes will get a context menu, with options to set the selected scene as "apply when starting/resuming video playback", "apply when pausing video playback", "apply when stopping video playback". If you select one of these options, they get stored in the plugin configuration.
The companion plugin (currently called script.service.hue.events) will then look up and apply these scenes whenever playback status is changed.

Other options I'm thinking about are:
- a toggle for only changing the lighting if it is actually on (I have no need for movie lighting when the sun is up)
- a speed setting for the transition time when applying scenes

Once I've got this working I'll take a peek at windows support (sorry, low priority because I'm mostly running Linux)

Great news!
Truly superb! Thx a lot, looking forward to
Reply
any target date to release this?
(able to stop, play and pause)
Reply
Probably somewhere next week. I already have it working, but it needs a bit of cleanup and some more work. (todo: only change lights if they were on at the start of playback, and create context menus to select scenes for the events)
Reply
(2019-06-22, 13:20)koekiemonster Wrote: Probably somewhere next week. I already have it working, but it needs a bit of cleanup and some more work. (todo: only change lights if they were on at the start of playback, and create context menus to select scenes for the events)

wow thats quick
nice!

thank you
Reply
Hi,

I've actually been working on a plugin of my own something for a couple months and was going to see if there was any interest before starting a new thread. I've been using the previous plugins for years and pretty much rewrote them. Perhaps you guys can try it out and tell me what you think?

https://github.com/zim514/script.service...-0.2.7.zip


A couple notes:
- Trigger hue scenes on start, stop or pause of playback
- Create or delete a multi-room scene, with a transition time
- Disable during daytime, activate at sunset, based on Hue's sunrise & sunset times.

A couple caveats:
- I've only tested this on a windows machine and a Libreelec setup
- This is my first python project and first kodi add-on, and it's unfinished. Expect bugs.
- No ambilight support. I need to find a good algorithm to convert the screenshot to colours. It's more complicated math than I'm used to
- Only supports nUPNP discovery : which means the add-on will only find your bridge if it can connect to Hue's servers. 


If you try it out and run into any issues, I added an option to save debug logs to a seperate file in addon_data. 

koekiemonster, I haven't looked at what you did yet but if you (or any once), wants to collaborate, DM me!
Reply
@koekiemonster, I tried your add-on and I like what you did. It works on windows on my 'dev' machine just fine, but I had to change the addon.xml platform to 'all' since you have it set to 'linux' right now. 

I like what you did - it's nice to have manual control of scenes in the UI while watching movies, as my add-on only supports automatic control based on playback.

There are some things I approached differently, mainly because of my home set up. My kitchen lights reflect on my TV, and I like turning them on when I pause a movie to grab a beer from the fridge, so I wanted scenes that could apply to multiple Rooms/Zones/Group. Therefore I'm not using the scenes associated to rooms, but the scenes that can apply to multiple rooms of the type "LightScene". Unfortunately, you can't recall those scenes with a transition time unless you configure the transition time in the scene itself when you create it...

My bridge scenes get super messy, and with only 10 hue lights and 4 rooms I have a bajillion scenes on my bridge. Many have the same name, some of them get auto-deleted by the Hue app, some of them the Hue docs say will eventually be deprecated, some of them are for routines, hue labs etc. I also have mystery rooms and groups with nonsense names that get created and no idea where they come from. It's not great.

Because of that I ended up filtering out and only showing the "LightScene" type that are set to not recycle, since Hue's documentation says those can get deleted without warning.

It works perfectly for scenes triggered by events, but is probably too limited for other features.

I had come across pHue but found another lib called qhue. It's more of an API wrapper. I chose it mostly because it would support the newer hue features without modifications and looks like it might be more recent.

Discoverhue looks like a nice solution I hadn't come across. I only implemented Hue's n-pnp thing since it was the easiest and quickest for me. My bridge is on a separate 'IoT' subnet and I'm not sure how SSDP and mDNS deal with that and didn't feel like finding out. I think I may look into implementing this lib as my next step. I'm thinking that adding more compatibility is probably needed before more users can try it on their set ups

Let me know what you think!
Reply
Hi all,

good news: I got bored today and made some big changes to the plugin. It now also applies scenes on playback events (start/pause/stop).
For more details, see the github page: https://github.com/rlKoekie/hue.controller
Setup works via context menu, so simply browse your Hue configuration in the add-on, open the context menu on a scene (C key by default in kodi), and select it for a playback event.
The plugin also has a couple of other options in the add-on settings menu.
I've also changed the platform selection to "all", so everybody can try it out wherever they want. (thanks for the tip Snapcase!)

@Snapcase: I took a quick peek at your code, it looks impressive! I'm not sure if our projects are easy to merge into a single one, but we can certainly look into sharing some code. I'll also take a peek at the qhue api, as I'm already hitting the limits of phue (scene transition time seems not to work for example). I have to admit that I also had to clean up my Hue configuration to get rid of most duplicate scene entries and all kind of weird auto-generated scenes. I might need to look into this a bit more later on, thanks for the "LightScene" recycle tip!

I'm tired now, so making a separate thread for this thing will have to wait :-)
Reply
Hiya!

I ended up starting a new thread for mine and posting it here: 344886 (thread)
Reply
(2019-06-22, 22:24)koekiemonster Wrote: Hi all,

good news: I got bored today and made some big changes to the plugin. It now also applies scenes on playback events (start/pause/stop).
For more details, see the github page: https://github.com/rlKoekie/hue.controller
Setup works via context menu, so simply browse your Hue configuration in the add-on, open the context menu on a scene (C key by default in kodi), and select it for a playback event.
The plugin also has a couple of other options in the add-on settings menu.
I've also changed the platform selection to "all", so everybody can try it out wherever they want. (thanks for the tip Snapcase!)

@Snapcase: I took a quick peek at your code, it looks impressive! I'm not sure if our projects are easy to merge into a single one, but we can certainly look into sharing some code. I'll also take a peek at the qhue api, as I'm already hitting the limits of phue (scene transition time seems not to work for example). I have to admit that I also had to clean up my Hue configuration to get rid of most duplicate scene entries and all kind of weird auto-generated scenes. I might need to look into this a bit more later on, thanks for the "LightScene" recycle tip!

I'm tired now, so making a separate thread for this thing will have to wait :-)
Hi
I've tested the latest available versions and works perfectly for my needs (simple user setup is great).
I have a few questions:
1 if the lights are not turned on nothing happens - is it right?
2 if I turn on the lights and deactivate for playback, the lights are still on - is it correct?
3 if I turn on the lights and activate only during playback (start, stop, pause) works perfectly and the transition time can be set in another application
4 I did not find out how to turn off the lights during playback because only the scene can be selected (the lights on the scene always shine to a minimum of 1%) - this function is not yet or am I doing something wrong?
Thanks for the great work
Reply
(2019-06-22, 22:24)koekiemonster Wrote: Hi all,

good news: I got bored today and made some big changes to the plugin. It now also applies scenes on playback events (start/pause/stop).
For more details, see the github page: https://github.com/rlKoekie/hue.controller
Setup works via context menu, so simply browse your Hue configuration in the add-on, open the context menu on a scene (C key by default in kodi), and select it for a playback event.
The plugin also has a couple of other options in the add-on settings menu.
I've also changed the platform selection to "all", so everybody can try it out wherever they want. (thanks for the tip Snapcase!)

@Snapcase: I took a quick peek at your code, it looks impressive! I'm not sure if our projects are easy to merge into a single one, but we can certainly look into sharing some code. I'll also take a peek at the qhue api, as I'm already hitting the limits of phue (scene transition time seems not to work for example). I have to admit that I also had to clean up my Hue configuration to get rid of most duplicate scene entries and all kind of weird auto-generated scenes. I might need to look into this a bit more later on, thanks for the "LightScene" recycle tip!

I'm tired now, so making a separate thread for this thing will have to wait :-)

Thank you! Running good on my OSMC Vero 4K with Kodi 18.2
Reply
@Pet09 : For your last points about lights not going fully off in scenes, while working on my version I found out that Hue has different scene types that behave differently, and I only found out with trial and error. LightScenes, GroupScenes, legacy scenes, v2 scenes, etc. It's an issue for all Hue apps and scripts.

The v1 scenes don't seem to support having lights that are "off". If you recreate the scene with a more recent app it should work. 

I found this useful tool to inspect what's on my bridge: https://silind.github.io/Hue-Debugger-UI/  It should let you see which of your scenes support LightStates with lights that are on or off instead of low brightness.
Reply
(2019-06-25, 17:45)Snapcase Wrote: @Pet09 : For your last points about lights not going fully off in scenes, while working on my version I found out that Hue has different scene types that behave differently, and I only found out with trial and error. LightScenes, GroupScenes, legacy scenes, v2 scenes, etc. It's an issue for all Hue apps and scripts.

The v1 scenes don't seem to support having lights that are "off". If you recreate the scene with a more recent app it should work. 

I found this useful tool to inspect what's on my bridge: https://silind.github.io/Hue-Debugger-UI/  It should let you see which of your scenes support LightStates with lights that are on or off instead of low brightness.
Thanks for advice.
I used another application that enabled to set the scene to turn off the lights + set the delay time and now it works great
Reply
Wow much news here since my last visit.
Will have to try

Can someone please post the difference between the app from cookiemonster and snapcase...
In a simple way :p

i only need 1 working and continous support on it
Reply
  • 1
  • 25
  • 26
  • 27
  • 28(current)
  • 29

Logout Mark Read Team Forum Stats Members Help
Philips hue integration or add-on0