Jump to content


Photo

Plugin for controlling Hue light

hue hue lights phillips hue home automation ha

  • Please log in to reply
150 replies to this topic

#21 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 16 September 2017 - 09:24 AM

@julianb can you send a copy of your config file (located at %appdata%\plugins\configuration) and a copy of the log file from tour server with debug logging turned on.

#22 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 16 September 2017 - 04:21 PM

 

 
Looks like the maker of this plug-in @nxenos83 has left it for dead :(

 

 

Unfortunately, I've been pulled away from the Emby community with some other projects, and just recently saw the post in this thread. I've reflected a little on this and how Emby should be integrated with smart home devices. I'm willing to devote some time to looking into issue with the plugin and making setup easier if anyone convince my I'm wrong. 

 

Instead of maintaining a plugin that targets one smart home lighting product and performs one action, it makes sense to focus on a method that is highly extensible, easier to maintain, and leverages other projects dedicated to home automation. The webhooks plugin I started on seems to me to be a better route. Using this in conjunctions with a dedicated smart home sever [like home-assistant io (HA)], you can use Emby events to instantaneously trigger an actions that target a miriad of smart home products.  Projects like HA and openHab are dedicated to proving integration with smart home products and are better situated to provide long term maintenance to keep up with changes in smart product APIs. 

 

As an example, with the webhooks, I could potentially dim smart lights (hue lights and zwave switches controlled by a Wink hub), set my Yahama network receiver to the appropriate input and volume, and send a python script command to a network projector to set appropriate aspect ration. All of this by sending a http request to HA triggered by Emby events. The heavy lifting is done by HA and Emby gets to focus on serving up media.

 

I can write up a quick tutorial on how to setup HA and how to integrate with Emby Webhooks if anyone would be interested.

 

 

 

It doesn't even have to be a plugin. It can also be it's own standalone app that uses the emby api.

 

Just as a side note, using emby api is already available by default in HA. The only down side is that HA has to pool emby every few minutes. Using webhooks allows much faster response.



#23 hstamas OFFLINE  

hstamas

    Advanced Member

  • Members
  • 572 posts
  • Local time: 02:58 PM

Posted 18 September 2017 - 03:43 PM

Unfortunately, I've been pulled away from the Emby community with some other projects, and just recently saw the post in this thread. I've reflected a little on this and how Emby should be integrated with smart home devices. I'm willing to devote some time to looking into issue with the plugin and making setup easier if anyone convince my I'm wrong. 

 

Instead of maintaining a plugin that targets one smart home lighting product and performs one action, it makes sense to focus on a method that is highly extensible, easier to maintain, and leverages other projects dedicated to home automation. The webhooks plugin I started on seems to me to be a better route. Using this in conjunctions with a dedicated smart home sever [like home-assistant io (HA)], you can use Emby events to instantaneously trigger an actions that target a miriad of smart home products.  Projects like HA and openHab are dedicated to proving integration with smart home products and are better situated to provide long term maintenance to keep up with changes in smart product APIs. 

 

As an example, with the webhooks, I could potentially dim smart lights (hue lights and zwave switches controlled by a Wink hub), set my Yahama network receiver to the appropriate input and volume, and send a python script command to a network projector to set appropriate aspect ration. All of this by sending a http request to HA triggered by Emby events. The heavy lifting is done by HA and Emby gets to focus on serving up media.

 

I can write up a quick tutorial on how to setup HA and how to integrate with Emby Webhooks if anyone would be interested.

 

 

 

 

Just as a side note, using emby api is already available by default in HA. The only down side is that HA has to pool emby every few minutes. Using webhooks allows much faster response.

 

As long as the setup is user friendly/accessible I am all for it. I have above average computer skills and dont mind tinkering but I have just reached the point in my life where I dont relish sitting at a computer til 3am trying to get automation software working. Sort of the whole reason I paid the premium and purchases Hue lights instead of less expensive alternatives that require a lot of set up.



#24 julianb OFFLINE  

julianb

    Advanced Member

  • Members
  • 125 posts
  • Local time: 08:58 PM
  • LocationNorway

Posted 24 September 2017 - 09:34 AM

Unfortunately, I've been pulled away from the Emby community with some other projects, and just recently saw the post in this thread. I've reflected a little on this and how Emby should be integrated with smart home devices. I'm willing to devote some time to looking into issue with the plugin and making setup easier if anyone convince my I'm wrong. 

 

Instead of maintaining a plugin that targets one smart home lighting product and performs one action, it makes sense to focus on a method that is highly extensible, easier to maintain, and leverages other projects dedicated to home automation. The webhooks plugin I started on seems to me to be a better route. Using this in conjunctions with a dedicated smart home sever [like home-assistant io (HA)], you can use Emby events to instantaneously trigger an actions that target a miriad of smart home products.  Projects like HA and openHab are dedicated to proving integration with smart home products and are better situated to provide long term maintenance to keep up with changes in smart product APIs. 

 

As an example, with the webhooks, I could potentially dim smart lights (hue lights and zwave switches controlled by a Wink hub), set my Yahama network receiver to the appropriate input and volume, and send a python script command to a network projector to set appropriate aspect ration. All of this by sending a http request to HA triggered by Emby events. The heavy lifting is done by HA and Emby gets to focus on serving up media.

 

I can write up a quick tutorial on how to setup HA and how to integrate with Emby Webhooks if anyone would be interested.

 

 

 

 

Just as a side note, using emby api is already available by default in HA. The only down side is that HA has to pool emby every few minutes. Using webhooks allows much faster response.

 

I would love a good solution, cause right now I can't even get my lights to dim automatically anymore :(



#25 julianb OFFLINE  

julianb

    Advanced Member

  • Members
  • 125 posts
  • Local time: 08:58 PM
  • LocationNorway

Posted 24 September 2017 - 09:37 AM

@julianb can you send a copy of your config file (located at %appdata%\plugins\configuration) and a copy of the log file from tour server with debug logging turned on.

removed xml file

Edited by julianb, 24 October 2017 - 06:34 AM.


#26 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 25 September 2017 - 11:12 AM

As long as the setup is user friendly/accessible I am all for it. I have above average computer skills and dont mind tinkering but I have just reached the point in my life where I dont relish sitting at a computer til 3am trying to get automation software working. Sort of the whole reason I paid the premium and purchases Hue lights instead of less expensive alternatives that require a lot of set up.

 

As I was working on a walkthrough, it became clear to me that setting up home-assistant still has many non-user friendly steps. Although they are working on moving more of the setup options into the frontend, the majority of setup requires editing yaml files.

 

Just to get something working, I'll make some updates to the plugin. With the latest server release (3.2.32.0), previous plugins may break.



#27 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 04 October 2017 - 09:26 AM

I've reworked this plugin.  It is now compitable with the latest server release and setup has been streamlined.

 

Place this file in the plugins folder and restart the server.  https://github.com/n...leases/tag/v0.1

 

 

I have not yet figured out a clean way to perform bridge discovery, so you will need to find the IP address for your router or from the Hue App, Go to the settings menu in the app. Go to My Bridge. Go to Network settings. Switch off the DHCP toggle. The ip address of the bridge will show. Note the ip address, then switch DHCP back on.

 

Enter the ip address. Press the button on the Hue Bridge, and then click Get Bridge API. 

 

Select the Emby Device(s) that you want to trigger dimming, and select the Hue group that you want to control.  Set a transition time and save.


  • julianb likes this

#28 hstamas OFFLINE  

hstamas

    Advanced Member

  • Members
  • 572 posts
  • Local time: 02:58 PM

Posted 04 October 2017 - 04:07 PM

Fantastic start @nxenos83! Thanks for doing this.

 

Its still too basic for my needs but server side support for controlling Hue lighting is a really nice addition to the community.

 

Are you open to feature requests?



#29 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 04 October 2017 - 04:22 PM

 

Are you open to feature requests?

 

I'll do my best to accommodate. Ask away.



#30 hstamas OFFLINE  

hstamas

    Advanced Member

  • Members
  • 572 posts
  • Local time: 02:58 PM

Posted 04 October 2017 - 04:54 PM

I'll do my best to accommodate. Ask away.


1. I only want my lights to turn off during a movie, I want them to stay on when viewing a TV show. Can you add an adjustable time threshold so your plugin only activates when the program is of a certain length?

2. Can we have control down to the individual light? I believe your plugin right now just reads the group stored on the Hue hub and affects them all the same. In my setup I want certain lights to stay on when a movie starts. The plugin I used to use with Plex has individual Start - Resume - Stop behaviors that you could set for each individual light.

2A. Could we control the brightness (and color?) of the lights for start and pause behavior? I would assume that we would all want the stop behavior to bring the lights back to their initial settings from when before the plugin activated?

3. I have a color bias light behind my TV that I want to turn ON when a movie starts (related to #2). Can we have it so this light comes on at a random color or be able to choose the color?

#31 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 04 October 2017 - 06:50 PM

1. I only want my lights to turn off during a movie, I want them to stay on when viewing a TV show. Can you add an adjustable time threshold so your plugin only activates when the program is of a certain length?

 

Not a problem. I had this in the plugin before but forgot about it when I did the rebuild. I'll add options for specific content type

 

In my setup I want certain lights to stay on when a movie starts.

 

Couldn't you just remove these lights from the group that is being controlled? Or are you still wanting to control these lights, just not turning them all of the way off?

 

The plugin I used to use with Plex has individual ... Stop behaviors that you could set for each individual light.

​......
I would assume that we would all want the stop behavior to bring the lights back to their initial settings from when before the plugin activated?

Do you see this is separate configuration options? A toggle between  "Reset" or Specific configuration



#32 hstamas OFFLINE  

hstamas

    Advanced Member

  • Members
  • 572 posts
  • Local time: 02:58 PM

Posted 04 October 2017 - 07:25 PM

Couldn't you just remove these lights from the group that is being controlled? Or are you still wanting to control these lights, just not turning them all of the way off?


I would still like to have control of all the lights so removing them from the group wouldn’t work in my case.

Here’s a quick use scenario specific to My set up. Maybe it will give you an idea of what I’m trying to accomplish:

I have four lights in my living room. Three lights are general illumination, one light is a bias colored light behind the TV. When I start a movie, I want the three general lights to turn off. At the same time, I want the colored TV light to turn on (random color would be a bonus).

When I pause the video, I would like the opposite to happen. I would like one or more of the general lights to turn on (possibly at a lower brightness setting) and I would like the color TV light to turn off. When I resume playback, I would like again, the room lights to turn off and the color TV like to turn on.

When I hit stop or when the movie ends, I would like the lights to return to their initial state (The state the lights were on before I ever started watching a movie )

Very specific for sure but this is just to give you an idea of how I’ve been able to control things in the past.

#33 Overseer OFFLINE  

Overseer

    Advanced Member

  • Members
  • 245 posts
  • Local time: 11:58 AM
  • LocationYelm, WA, US

Posted 04 October 2017 - 09:14 PM

Does this work with the .Net Core version of Emby?



#34 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 05 October 2017 - 09:35 AM

Does this work with the .Net Core version of Emby?

 

It should work as it targets  .Net 1.3.  I'll spin up a server running the standalone latest build to test later tonight.



#35 nxenos83 OFFLINE  

nxenos83

    Advanced Member

  • Members
  • 86 posts
  • Local time: 01:58 PM

Posted 05 October 2017 - 10:13 AM

It will take some time to create a web interface to set the brightness, hue, and saturation for each light that also takes into account the varying capabilities of different light bulbs.  So here is what I am thinking. 

In the setup you select the lights you want to control.

Then, through another application (official Hue Apps) you set the lights to the desired value for the pause event. Click a button in the plugin config and it saves the light states of the selected lights. Then set the lights to values you want for the play event and click another button.

This would cover everything besides the color randomization.

 

After that, I'll look into adding web based controls that will allow you to edit the scenes.



#36 hstamas OFFLINE  

hstamas

    Advanced Member

  • Members
  • 572 posts
  • Local time: 02:58 PM

Posted 05 October 2017 - 10:45 AM

It will take some time to create a web interface to set the brightness, hue, and saturation for each light that also takes into account the varying capabilities of different light bulbs.  So here is what I am thinking. 

In the setup you select the lights you want to control.

Then, through another application (official Hue Apps) you set the lights to the desired value for the pause event. Click a button in the plugin config and it saves the light states of the selected lights. Then set the lights to values you want for the play event and click another button.

This would cover everything besides the color randomization.

 

After that, I'll look into adding web based controls that will allow you to edit the scenes.

 

Thats exactly how a current add-on for Kodi works now that I am currently using (https://github.com/m...vice.huecontrol). This certainly works for me short term. Thanks!



#37 julianb OFFLINE  

julianb

    Advanced Member

  • Members
  • 125 posts
  • Local time: 08:58 PM
  • LocationNorway

Posted 18 October 2017 - 02:39 PM

I've reworked this plugin.  It is now compitable with the latest server release and setup has been streamlined.

 

Place this file in the plugins folder and restart the server.  https://github.com/n...leases/tag/v0.1

 

 

I have not yet figured out a clean way to perform bridge discovery, so you will need to find the IP address for your router or from the Hue App, Go to the settings menu in the app. Go to My Bridge. Go to Network settings. Switch off the DHCP toggle. The ip address of the bridge will show. Note the ip address, then switch DHCP back on.

 

Enter the ip address. Press the button on the Hue Bridge, and then click Get Bridge API. 

 

Select the Emby Device(s) that you want to trigger dimming, and select the Hue group that you want to control.  Set a transition time and save.

This worked like a dream! Thank you again! :)
- Btw, would be nice to have the lights dimmed during "intros" and then shut off during movie playback


#38 jhoff80 OFFLINE  

jhoff80

    Advanced Member

  • Members
  • 345 posts
  • Local time: 02:58 PM

Posted 03 December 2017 - 08:03 PM

I get the error "Unable to get light groups.  Check URL."  I have a Hue Bridge v1, would that make a difference? 

 

I'm also using the .Net Core version now so not sure if that's related either.


Edited by jhoff80, 03 December 2017 - 08:12 PM.


#39 julianb OFFLINE  

julianb

    Advanced Member

  • Members
  • 125 posts
  • Local time: 08:58 PM
  • LocationNorway

Posted 21 December 2017 - 02:02 PM

Well, it stopped working for me too now, same error "Unable to get light groups". I don't know if it's the latest Hue update or the Server update, but the plugin does not work anymore :( I think Philips did change something.

 

@nxenos83 do you know what's going on? 



#40 julianb OFFLINE  

julianb

    Advanced Member

  • Members
  • 125 posts
  • Local time: 08:58 PM
  • LocationNorway

Posted 06 January 2018 - 12:20 PM

I've reworked this plugin.  It is now compitable with the latest server release and setup has been streamlined.

 

Place this file in the plugins folder and restart the server.  https://github.com/n...leases/tag/v0.1

 

 

I have not yet figured out a clean way to perform bridge discovery, so you will need to find the IP address for your router or from the Hue App, Go to the settings menu in the app. Go to My Bridge. Go to Network settings. Switch off the DHCP toggle. The ip address of the bridge will show. Note the ip address, then switch DHCP back on.

 

Enter the ip address. Press the button on the Hue Bridge, and then click Get Bridge API. 

 

Select the Emby Device(s) that you want to trigger dimming, and select the Hue group that you want to control.  Set a transition time and save.

 

Do you know why the plugin has stopped working again? I love this plugin so much, my Home Theater is not the same without it.


Edited by julianb, 06 January 2018 - 01:17 PM.






Also tagged with one or more of these keywords: hue, hue lights, phillips hue, home automation, ha

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users