Jump to content
nxenos83

Plugin for controlling Hue light

Recommended Posts

chef

Excellent idea, but the call off of the library manager

string iType = _libraryManager.GetContentType(e.Item);
No longer exists.

 

Based on what is in webhooks that would make sense.

 

So maybe

 

PlaybackProgressEventArgs e.MediaInfo.Type huh

I will have to check to be certain but that sounds right.

 

if(e.MediaInfo.Type == "Movie")

{

//Do some cool stuff

}

  • Like 1

Share this post


Link to post
Share on other sites
BillOatman

I will have to check to be certain but that sounds right.

 

if(e.MediaInfo.Type == "Movie")

{

//Do some cool stuff

}

Yeah that's what I came up with too but I made the compare case-insensitive, been burned too many times (which is why I'm not a fan of strings for stuff like this :) )

Edited by BillOatman

Share this post


Link to post
Share on other sites
BillOatman

I'd have to check my code, but I think it is "Type", which is a string "Movie", or "Episode".

 

The Playback progress gets triggered quite a few times to do lots of calculation in. Perhaps utilize PlaybackStart event and hold the BaseItem info for reference. Empty the object on PlaybackStop.

 

If you use "EventArgs e", then the information in 'e' is a BaseItem. This should have the information you need.

Yeah good advice.  I'm only hacking this together until @@Biofects makes a new release.  So I don't plan on refactoring anything :)

Share this post


Link to post
Share on other sites
hstamas

Excellent idea, but the call off of the library manager 

string iType = _libraryManager.GetContentType(e.Item);

No longer exists.  

 

Based on what is in webhooks that would make sense.  

 

So maybe 

 

 PlaybackProgressEventArgs e.MediaInfo.Type huh

 

Lets try it @@hstamas :)

 

I think thats got it! Im testing this remotely so I wont be 100% sure its working as expected until this evening (eastern USA time) but my Hue app appears to be triggering as expected.

 

You guys rock! Thank you so much!

Share this post


Link to post
Share on other sites
BillOatman

Great!  You know what sucks though, my house is all recessed floods with wall dimmer switches and an open floor plan.  So [i think anyway] not real conducive to dimming the lights for movies.

But this stuff is kinda cool so I may need to get a bridge and a few lights just to play.  My wife is going to love that ;)

Share this post


Link to post
Share on other sites
hstamas

Great!  You know what sucks though, my house is all recessed floods with wall dimmer switches and an open floor plan.  So [i think anyway] not real conducive to dimming the lights for movies.

But this stuff is kinda cool so I may need to get a bridge and a few lights just to play.  My wife is going to love that ;)

It is addictive and frustrating when it doesn’t work as expected but I’ve found the Hue setup, although expensive, to be very reliable. They do sell recessed light that work with dimmers I believe.

Share this post


Link to post
Share on other sites
hstamas

Tested. Works great!

 

A more streamlined way of controling the individual lights (scenes) would be more desirable compared to the 9 groups I needed to create to get my set up going but you got me a functioning Hue movie set up and for that, once again I say THANK YOU!

Share this post


Link to post
Share on other sites
BillOatman

@hstamas  You are very welcome!

 

@chef  This is probably the preferred way:

bool isMovie =  e.MediaInfo.IsType("Movie");
  • Like 1

Share this post


Link to post
Share on other sites
chef
  • Like 1

Share this post


Link to post
Share on other sites
hstamas

Now that this plugin is working I'm seeing a small glitch in the configuration screen when you go back into it to make an edit etc. See the attached screen shot and look at the STOP sliders across the bottom row. Notice how the slider for the 4th light in from the left (Main living room light) says its at 40% but the slider is at 100%? This light should be 100%. Also the last one "couch light" was set to 50% initially but going back in to the setting lists it at 40%. Ive notice it does this to other lights as well. Haven't had a chance to physically test it to see what percentage it actually goes to on stop but wanted to point it out @@Biofects or @@BillOatman as something to look at for future tweaking.

post-45887-0-36386500-1558102375_thumb.png

Edited by hstamas

Share this post


Link to post
Share on other sites
BillOatman

I don't see anything obviously wrong with it, but I do not have a Hue so I won't be able to debug it.

Knowing if the slider is wrong or the numeric value would be a help though.

Edited by BillOatman

Share this post


Link to post
Share on other sites
pir8radio

This is all fine and dandy if the emby server is in the same location as the hue hub.... But in my case my server is in a data center, and my hue is at home...   Any way to make this work though the hue site like my automation system does?  Not talking to the hub directly?    Hue has a "hue remote api" that uses their cloud servers which is what im looking for.

  • Like 1

Share this post


Link to post
Share on other sites
Luke

It would be better as a standalone mobile app that can communicate with emby server and then perform actions based on what it finds.

  • Like 2

Share this post


Link to post
Share on other sites
hstamas

This is all fine and dandy if the emby server is in the same location as the hue hub.... But in my case my server is in a data center, and my hue is at home...   Any way to make this work though the hue site like my automation system does?  Not talking to the hub directly?    Hue has a "hue remote api" that uses their cloud servers which is what im looking for.

 

Its this exact situation that was having me want a locally controlled plugin. The origins of this thread had the plugin working with webhooks and in my case a call out to IFTTT. Worked at first but then proved very unreliable. Any glitch in talking to the remote server and the plugin fails. Was getting so tired of starting a movie and worrying if the lights would go off or not and if they didnt, spending the entire movie distracted because my OCD wouldnt let me stop thinking about why, once again it didnt work!

Share this post


Link to post
Share on other sites
pir8radio

It would be better as a standalone mobile app that can communicate with emby server and then perform actions based on what it finds.

 

only problem with that, is that the local app would be polling the emby server like every second to get the current play status for a device no?   or are web-sockets usable for this? 

Share this post


Link to post
Share on other sites
BillOatman

Lots of hue experts here so I'll ask ... I currently have a room with multiple ceiling recessed floodlights all controlled by 1 dimmer switch (all direct, non-hue).  Rather than replace all of the bulbs with hue ones, what I would prefer to do is replace the switch with a hue one that takes commands from the bridge or from it's attached switch (a rocker is fine) and control the existing lights.

With a thin form factor like a standard US light switch.  

 

Anyone know of anything like this?  I know this wouldn't be particularly popular with Phillips as it cuts down on their smartbulb sales, but anything even aftermarket that's compatible?

 

I need this, but for Hue :)

 

https://www.smarthome.com/togglelinc-dimmer-insteon-2466dw-remote-control-dimmer-switch-white.html

Edited by BillOatman

Share this post


Link to post
Share on other sites
pir8radio

Lots of hue experts here so I'll ask ... I currently have a room with multiple ceiling recessed floodlights all controlled by 1 dimmer switch (all direct, non-hue).  Rather than replace all of the bulbs with hue ones, what I would prefer to do is replace the switch with a hue one that takes commands from the bridge or from it's attached switch (a rocker is fine) and control the existing lights.

With a thin form factor like a standard US light switch.  

 

Anyone know of anything like this?  I know this wouldn't be particularly popular with Phillips as it cuts down on their smartbulb sales, but anything even aftermarket that's compatible?

 

I need this, but for Hue :)

 

https://www.smarthome.com/togglelinc-dimmer-insteon-2466dw-remote-control-dimmer-switch-white.html

 

they dont make switches like that..   they only sell hue dimmer switches that control hue lights.    The white bulbs are pretty cheap now...   My theater room has like 6 white cans, and 3 color ones for the walkway...  the RGB hues really hit the pocket book lol...    if it didnt need to talk to a hue hub you could use zwave stuff... 

Edited by pir8radio
  • Like 1

Share this post


Link to post
Share on other sites
BillOatman

they dont make switches like that..   they only sell hue dimmer switches that control hue lights.    The white bulbs are pretty cheap now...   My theater room has like 6 white cans, and 3 color ones for the walkway...  the RGB hues really hit the pocket book lol...    if it didnt need to talk to a hue hub you could use zwave stuff... 

Yeah thanks.   I stopped into best buy and talked to a person who owns hue stuff and seemed knowledgeble and she checked around and there aren't even any 3rd party switches that work with the hue hub.  Phillips really wants you to keep buying bulbs I guess.  Insteon has one, and even GE does.  Ahhh well, maybe I'll have a look at making a Insteon plugin.

Edited by BillOatman

Share this post


Link to post
Share on other sites
chef

Yeah thanks. I stopped into best buy and talked to a person who owns hue stuff and seemed knowledgeble and she checked around and there aren't even any 3rd party switches that work with the hue hub. Phillips really wants you to keep buying bulbs I guess. Insteon has one, and even GE does. Ahhh well, maybe I'll have a look at making a Insteon plugin.

If you are even remotely serious about HA, I would not invest in Insteon. Look at Zwave.

Then you could upgrade your place over time. A cheap zwave hub (like Vera which also controls hue products) and a fifty dollar light switch (yep seems a bit expensive) is all you need.

  • Like 1

Share this post


Link to post
Share on other sites
BillOatman

Thanks for the tip.  ZWave api seems to talk to the hub via a serial connection.  Been a long time since I have seen serial used, not sure my Emby server box even has a serial port :)

Edited by BillOatman
  • Like 1

Share this post


Link to post
Share on other sites
chef

Thanks for the tip. ZWave api seems to talk to the hub via a serial connection. Been a long time since I have seen serial used, not sure my Emby server box even has a serial port :)

:) Actually, zwave hubs use http API's. The hub communicates using serial to the different devices in the mesh network. :)

  • Like 1

Share this post


Link to post
Share on other sites
BillOatman

:) Actually, zwave hubs use http API's. The hub communicates using serial to the different devices in the mesh network. :)

Do you have a link to their api's?  The only one I found referenced serial (OpenZwave).

Share this post


Link to post
Share on other sites
chef

Check out Vera

 

getvera.com

Share this post


Link to post
Share on other sites
pir8radio

Yeah thanks.   I stopped into best buy and talked to a person who owns hue stuff and seemed knowledgeble and she checked around and there aren't even any 3rd party switches that work with the hue hub.  Phillips really wants you to keep buying bulbs I guess.  Insteon has one, and even GE does.  Ahhh well, maybe I'll have a look at making a Insteon plugin.

 

Actually, I just came across this...  So there has to be a 120v version... But if you notice the picture it says its good for 100-277 so who knows.

 

https://www.amazon.co.uk/gp/product/B076KPQWFW?ie=UTF8&linkCode=xm2&camp=2025&creative=6738&tag=iconn08-21&creativeASIN=B076KPQWFW&SubscriptionId=

 

So it looks like I was incorrect in my previous post, though hue doesnt sell wall switches as long as it it zibgee light link (ZLL) compatible it will work with a hue hub.

 

https://developers.meethue.com/zigbee-3-0-support-in-hue-ecosystem/

Edited by pir8radio
  • Like 1

Share this post


Link to post
Share on other sites
BillOatman

Thanks I'll have a look!

Share this post


Link to post
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...