Author Topic: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin  (Read 3425 times)

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2795
  • Karma: +183/-8
I was not satisfied with the features and the quality of the Hue plugin so I created this ALTHue plugin. in the same vein as ALTUI, this is the Alternate Edition of the Hue Plugin.

First version is 0.1 and It supports pairing with the hub, creating Hue lamps ( including RGB ) and Hue Motion sensors and make them all appear as Vera devices , ready for your scenes. these are true Vera devices , so using same device types , same device variables and same device Upnp actions.

Install and Setup instructions can be found here : https://github.com/amg0/ALTHue/blob/master/Doc/ALTHue%20Philips%20Hue%20plugin.pdf

Log
v0.9 - IKEA support
v0.8 - ability to show and run HUE scenes
v0.7 - better settings on UI5, hardening of RefreshHueData, list and delete Hue app keys
v0.5 - partial working on UI5 ( not RGB )
v0.4 - proper ArmedTripped behavior for motion sensor
v0.3 - few bug fix, JS code refactor to avoid name clashes
v0.1 - initial release

UPNP actions
- SetDebug( bool ) : to set the debug mode or not
- Refresh( ) : to force a data refresh from Hue
- PairWithHue( )  : to trigger a Pairing request , no action if already paired
- UnpairWithHue( )  : to unpair from hue, no action if not paired
- RunHueScene( hue_scene_id )  : to run a particular Hue Scene ( by its Hue ID )

Sources can be found here:
https://github.com/amg0/ALTHue/

Plugin ID on MCV store is : 9066

Easy install
choose one of the methods below

Supported devices ( not limited to, but seen working )
   Type   Model   Misc   Swversion
Color light   IKEA of Sweden TRADFRI bulb E27 CWS opal 600lm      1.3.002
Color temperature   IKEA of Sweden TRADFRI bulb E27 WS opal 980lm      1.2.217
Color temperature   IKEA of Sweden TRADFRI bulb E14 WS opal 400lm      1.2.217
Color temperature   IKEA of Sweden TRADFRI bulb E14 WS opal 400lm      1.2.217
Color temperature light   Philips LTW001      5.105.0.21536
Daylight   Philips PHDL00   Daylight   1.0
Dimmable light   IKEA of Sweden TRADFRI bulb E27 W opal 1000lm      1.2.214
Dimmable light   IKEA of Sweden TRADFRI bulb GU10 W 400lm      1.2.214
Dimmable light   Philips LWB010      1.29.0_r21169
Dimmable light   Philips LWB010      1.29.0_r21169
Dimmable light   Philips LWB010      1.29.0_r21169
Dimmable light   Philips LWB010      1.29.0_r21169
Extended color light   Philips LST002      5.105.0.21169
ZLLLightLevel   Philips SML001   Light Sensor   6.1.0.18912
ZLLPresence   Philips SML001   Motion Sensor   6.1.0.18912
ZLLTemperature   Philips SML001   Temp Sensor   6.1.0.18912

« Last Edit: April 14, 2018, 12:18:05 pm by amg0 »

Offline akbooer

  • Master Member
  • *******
  • Posts: 5725
  • Karma: +246/-69
  • "Less is more"
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #1 on: March 28, 2018, 05:20:43 pm »
More Karma to you (again!!)
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 2x Philips Hue
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +70/-30
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #2 on: March 29, 2018, 04:56:05 am »
Nice.
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline jeubanks

  • Full Member
  • ***
  • Posts: 108
  • Karma: +2/-0
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #3 on: March 30, 2018, 12:51:52 am »
I may have to give this a try.  I pulled my Hue lights out of Vera and into Home Assistant because the Vera plugin kept dropping the Hub.

Any chance of a revamped Lutron Caseta plugin???.  The RadioRA2 is ok... but not great.  I have a Caseta and Caseta PRO hub, so thankfully I'm good to go with Vera with RadioRA2 from the PRO hub.  But it would be nice to have the option of the other hub as well.
« Last Edit: March 30, 2018, 12:53:48 am by jeubanks »

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2795
  • Karma: +183/-8
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #4 on: March 30, 2018, 02:24:51 am »
I may have to give this a try.  I pulled my Hue lights out of Vera and into Home Assistant because the Vera plugin kept dropping the Hub.

Any chance of a revamped Lutron Caseta plugin???.  The RadioRA2 is ok... but not great.  I have a Caseta and Caseta PRO hub, so thankfully I'm good to go with Vera with RadioRA2 from the PRO hub.  But it would be nice to have the option of the other hub as well.

I am not familiar with lutron and I can only realistically adresse plugin for devices that I own

Regarding althue, it is very stable for me right now I have 4 lamps including one led strip and 1 motion sensor
« Last Edit: March 30, 2018, 06:13:47 am by amg0 »

Offline ChrisTheC

  • Full Member
  • ***
  • Posts: 125
  • Karma: +3/-1
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #5 on: March 30, 2018, 07:33:20 am »
. . .
Install and Setup instructions can be found here : https://github.com/amg0/ALTHue/blob/master/Doc/ALTHue%20Philips%20Hue%20plugin.pdf


Yipee! I was ready to buy a Hue system based on your work, but . . . I read the document.
Right off the document says "no UI5"

My Vera3 is UI5 with AltUI (and must remain UI5)
My Raspberry Pi3 is openLuup/AltUI

Does this exclude me from the fun?

Thanks,
Chris

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2795
  • Karma: +183/-8
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #6 on: March 30, 2018, 07:48:47 am »
. . .
Install and Setup instructions can be found here : https://github.com/amg0/ALTHue/blob/master/Doc/ALTHue%20Philips%20Hue%20plugin.pdf


Yipee! I was ready to buy a Hue system based on your work, but . . . I read the document.
Right off the document says "no UI5"

My Vera3 is UI5 with AltUI (and must remain UI5)
My Raspberry Pi3 is openLuup/AltUI

Does this exclude me from the fun?

Thanks,
Chris

UI5 yes ( although the effort should no be that much, probably just writing a UI5 .json file and a small .lua change )
openluup : not tested but it should work nicely.  it does work nicely with ALTUI
 EDIT : v0.5 brings a bit of functionality, all minus RGB devices which are seen as std dimmers
« Last Edit: March 31, 2018, 04:07:39 am by amg0 »

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1080
  • Karma: +110/-36
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #7 on: March 30, 2018, 11:45:54 am »
openluup : not tested but it should work nicely.  it does work nicely with ALTUI

I have tested with the latest openLuup/latest AltUI/Hue v2 bridge, and the the plugin does not work as-is.... It seems that openLuup does not populated the "data_command_url" variable for the javascript environment.

Manually adding the variable definition to the J_ALTHUE.js file (not the correct solution) resolves the problem, and the plugin then works under openLuup.

Code: [Select]
var data_command_url = "/data_request?";


NB: Actually... the "data_command_url" variable should probably be "data_request_url", as the former seems to have been deprecated years ago...
« Last Edit: March 30, 2018, 12:08:53 pm by cybrmage »

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2795
  • Karma: +183/-8
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #8 on: March 30, 2018, 12:20:24 pm »
openluup : not tested but it should work nicely.  it does work nicely with ALTUI

I have tested with the latest openLuup/latest AltUI/Hue v2 bridge, and the the plugin does not work as-is.... It seems that openLuup does not populated the "data_command_url" variable for the javascript environment.

Manually adding the variable definition to the J_ALTHUE.js file (not the correct solution) resolves the problem, and the plugin then works under openLuup.

Code: [Select]
var data_command_url = "/data_request?";


NB: Actually... the "data_command_url" variable should probably be "data_request_url", as the former seems to have been deprecated years ago...

did you take the latest github ALTUI ?. I kind of remember making such a change

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1080
  • Karma: +110/-36
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #9 on: March 30, 2018, 12:29:34 pm »
did you take the latest github ALTUI ?. I kind of remember making such a change

Yes, I did... You seem to have missed one occurrence... line 312.


PS: Wait... I misread... You stated ALTUI, I read ALTHUE...

The ALTUI version I used is from March 25. (your last update to J_ALTUI_api.js was on the 26th - AltUI/openLuup did not notify of an update.)

Although, in J_ALTHUE.js, you have five references to "data_request_url" and one reference to "data_command_url"... a correct fix could be to change the spurious reference. This would resolve the issue for anyone running a slightly older version of AltUI.

« Last Edit: March 30, 2018, 12:38:44 pm by cybrmage »

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2795
  • Karma: +183/-8
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #10 on: March 30, 2018, 12:41:13 pm »
Yes work in progress

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2795
  • Karma: +183/-8
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #11 on: March 30, 2018, 05:55:42 pm »
@ChrisTheC

I have a version for UI5 on github, it sorts of work with the following problems
- RGB lights managed as std dimmer lights, when I use D_DimmableRGBLight1.xml for the device file it crashes so I use the std dimmer on UI5
- the user interface of the settings tab is not nice at all, it needs some rework for UI5 but if you use ALTUI, even on your UI5 box, then the user interface will be proper ( essentially UI5 behaves as UI7 )

cf my UI5 screen shot

Offline jeubanks

  • Full Member
  • ***
  • Posts: 108
  • Karma: +2/-0
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #12 on: March 31, 2018, 12:20:07 am »
Pulled from github and installed.  Working nicely!  Kudo's on the work.

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1080
  • Karma: +110/-36
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #13 on: March 31, 2018, 01:32:55 am »
@amg0

Just a heads-up... Your "RefreshHueData" routine is having trouble processing sensor data. My Hue Brideg has several "phantom" temperature and light level sensors. The device data for these sensors contains null data, and this causes the refresh process to crash. (Note: I am testing under openLuup, but it should be the same issue for a real Vera...)

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2795
  • Karma: +183/-8
Re: New Plugin : ALTHue - the Alternate Edition of the Philips Hue Plugin
« Reply #14 on: March 31, 2018, 03:39:32 am »
Can you please send me the content of the setting tab called ? dump ?