Author Topic: Philips Hue plugin by MiOS (BETA)  (Read 45965 times)

andreimios

  • Guest
Philips Hue plugin by MiOS (BETA)
« on: July 20, 2015, 04:22:51 am »
Hi all,

Here is the beta version of Philips Hue plugin by MiOS, all you need to do in order to install it is to replace _IP_ with your gateway's IP and run it in your browser.
Code: [Select]
_IP_:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8162&Version=28058
Features :

- lights support;
- groups support;
- scenes support (create, edit, favorite);

Known issues :

- auto-detection feature on VeraEdge is not working properly;
- Hue Lux implementation may be defective (not fully tested);
- Hue Beyond, Entity, Impulse and Phoenix may be defective(need your help on testing it);
- Vera scenes support is limited.

Plugin configuration :

In order to pair your bridge with plugin you will need to go to "Device Settings page\ Configure tab" for the bridge device created by plugin. Auto detection feature may or may not work so there are two situations:

- if the bridge is detected (info messages can be found in "Link Status" section of Configure tab) all you need to do is to press the pair button on the bridge and then click on "Pair with Bridge" button.

- if the bridge is no automatically detected, you can enter the bridge IP and click on "Save" button. Wait for engine to reload and  then press the pair button on the bridge and then click on "Pair with Bridge" button.

After pairing, the plugin will create light and group devices for each light/group found on the bridge.
You can create,save to favorites and edit scenes for "Scene List" tab.

For any issue/suggestion you have, please contact me via email : andrei at mios dot com.

Best Regards,

- Andrei -


Offline helraiser

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +2/-0
Re: Philips Hue plugin by MiOS (BETA)
« Reply #1 on: July 20, 2015, 06:47:15 pm »
I tried it in UI5 and it installs well however when it asks to press the "Pair with Bridge" button, nothing happens in MIOS. Now I'm not sure if I need to remove the previous philips hue plugin and/or upnp proxy.

It had created a new device but that device is hidden. It shows up under the devices created by a plugin when I click the plugin but yeah, nothing else.

Anyway, if you're looking for someone to keep testing in UI5 let me know to proceed or I'll just remove it :)

Cheers

Edit:

02      07/20/15 19:46:18.331   ^[[33;1mJobHandler_LuaUPnP::FetchMissingFiles need to download S_PhilipsHue2.xml^[[0m <0x2b8c9000>
02      07/20/15 19:46:18.332   ^[[33;1mJobHandler_LuaUPnP::m_sMissingFile_set S_PhilipsHue2.xml^[[0m <0x2b8c9000>
01      07/20/15 19:46:18.487   ^[[31;1mDevice_LuaUPnP::LoadDeviceDoc can't load /etc/cmh-lu//D_PhilipsHue2.xml^[[0m <0x2b8c9000>
02      07/20/15 19:46:18.488   ^[[33;1mJobHandler_LuaUPnP::m_sMissingFile_set /etc/cmh-lu//D_PhilipsHue2.xml^[[0m <0x2b8c9000>
01      07/20/15 19:46:18.488   ^[[31;1mJobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 108/D_PhilipsHue2.xml so device 108 is offline^[[0m <0x2b8c9000>
01      07/20/15 19:46:18.952   ^[[31;1mDevice_LuaUPnP::CreateServices Aborting device 108 because the topmost device has no interface^[[0m <0x2b8c9000>
01      07/20/15 19:46:18.952   ^[[31;1mJobHandler_LuaUPnP::CreateAllServices failed to create 108^[[0m <0x2b8c9000>

The files are in cmh-ludl but I don't see them in cmh-lu. The double forward slash is also curious.
« Last Edit: July 20, 2015, 10:18:32 pm by helraiser »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3226
  • Karma: +180/-8
Re: Philips Hue plugin by MiOS (BETA)
« Reply #2 on: July 21, 2015, 06:14:46 am »
Congratulations on joining the watou Club, intveltr!

But seriously... I've looked at the code.  It's nice and clean and well structured.  I'm considering whether I should switch to using it.

One bug, I think, is that the code assumes brightness=0 means "off".  On the hue bridge, it isn't: brightness=0 is the dimmest "on" value (and brightness=254 is the brightest "on" value).  I use this lowest brightness value in my wakeup scene; it's a fair bit dimmer than brightness=1.  I'd be sad to give it up.  (I realize that you have to map the 255 "on" brightnesses and one "off" state to a 0-100 scale for the UPnP Dimmer device.)

A stylistic niggle: Philips always spells hue with a lower case H.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3226
  • Karma: +180/-8
Re: Philips Hue plugin by MiOS (BETA)
« Reply #3 on: July 21, 2015, 06:55:48 am »
More feedback:

Discovery worked automatically. Pairing worked first time and all of my lamps were detected (GU10, A19, Bloom and Strips), also all of my groups.

The plugin does not seem to poll, so if I change a lamp through my phone (or intveltr's plugin, or OpenHab, or IFTTT) then the lamp device in Vera doesn't change.  (Or did it just need an extra Luup restart?) Edit: It seems that it does poll, but only after I interact with each device once (e.g., turn it on).  Thereafter it is fairly responsive in updating when I make changes on another device.  I'm guessing that a variable isn't getting a default value on device creation and something's being compared against nil.

There are no presets as in intveltr's plugin.  I assume that bridge scenes will take over this role but I cannot access them in the new plugin (yet).

"Scene List"/"Settings"/"Logs"/"Delete Device" are inaccessible on the top level device.  They appear then disappear before I can click them.

When I try to set the brightness of a lamp in the detail view I get this in the log:
Code: [Select]
08 07/21/15 20:50:09.928 JobHandler_LuaUPnP::HandleActionRequest device: 115 service: urn:upnp-org:serviceId:Dimming1 action: SetLoadLevelTarget <0x30558680>
08 07/21/15 20:50:09.929 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=115 <0x30558680>
08 07/21/15 20:50:09.929 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:Dimming1 <0x30558680>
08 07/21/15 20:50:09.929 JobHandler_LuaUPnP::HandleActionRequest argument action=SetLoadLevelTarget <0x30558680>
01 07/21/15 20:50:09.931 luup_variable_set interface 0x1066298 no LoadLevelStatus/(null) <0x2ad20000>
01 07/21/15 20:50:09.931 luup_variable_set interface 0x1066298 no LoadLevelTarget/(null) <0x2ad20000>
01 07/21/15 20:50:09.932 LuaInterface::CallFunction_Job device 115 function SDimming1_Dimming1_SetLoadLevelTarget_job failed [string "module("L_PhilipsHue2", package.seeall)..."]:196: attempt to compare number with nil <0x2ad20000>
01 07/21/15 20:50:09.932 Lua_Job::Run job#60 : dev:115 (0x1520c18) P:50 S:0 failed <0x2ad20000>
04 07/21/15 20:50:09.933 <Job ID="60" Name="" Device="115" Created="2015-07-21 20:50:09" Started="2015-07-21 20:50:09" Completed="2015-07-21 20:50:09" Duration="0.2848000" Runtime="0.1668000" Status="Failed" LastNote=""/> <0x2ad20000>
« Last Edit: July 21, 2015, 07:13:14 am by futzle »

Offline intveltr

  • Hero Member
  • *****
  • Posts: 1668
  • Karma: +92/-5
Re: Philips Hue plugin by MiOS (BETA)
« Reply #4 on: July 21, 2015, 06:59:36 am »
I have installed it in UI7 (will try UI5 later). 

It found my Hue bridge and paired on the first try.  After restart, the device shows a green icon indicated a successful pairing.  It did not create any light devices however; from the log files it looks like the plugin chokes on a Living White bulb that doesn't report any color data.

(I've mailed detailed logs and Hue config data)

@futzle, thanks :)  "nice and clean and well structured" sounds like they started from scratch, which is just as well.  I'm a messy programmer, and I don't have the time to properly maintain this plugin; I wrote it out of necessity.  By the way, Vera Ltd was nice enough to drop me a heads-up email a few days ago about their intentions and reasons for publishing this plugin. 
HomeWave is available in the App Store!  Turn your iPhone/iPad into an easy-to-use remote control for Vera.

Offline intveltr

  • Hero Member
  • *****
  • Posts: 1668
  • Karma: +92/-5
Re: Philips Hue plugin by MiOS (BETA)
« Reply #5 on: July 21, 2015, 09:04:48 am »
The Living White bulb is recognized after a behind the scenes fix, and all my lights appeared in the UI.  The basic functionality works on all lights.

Not having color presets in Vera isn't a huge deal if there is an easy way to set the color directly from Scenes, even if it's by specifying numerical Hue / Sat or Color temp values.

Not ure what is going on with polling.  It seemed to work fine until I restarted the Hue hub (to install new firmware), then the plugin would not poll anymore until I restarted the Luup engine.  Controlling the lights worked fine as soon as the hub came back up though.
HomeWave is available in the App Store!  Turn your iPhone/iPad into an easy-to-use remote control for Vera.

andreimios

  • Guest
Re: Philips Hue plugin by MiOS (BETA)
« Reply #6 on: July 21, 2015, 11:07:16 am »
Hi all,

Here is the link for the plugin version that includes the fix mentioned buy intveltr :

Quote
_IP_:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8162&Version=28151

I forgot to mention in my first post that the minimum firmware version required for using "Bridge Scenes" features is 1.7.619 for Vera 3/Light and 1.7.1248 for Vera Edge

Best Regards,

- Andrei -

Offline intveltr

  • Hero Member
  • *****
  • Posts: 1668
  • Karma: +92/-5
Re: Philips Hue plugin by MiOS (BETA)
« Reply #7 on: July 21, 2015, 12:05:58 pm »
I noticed the Hue, Sat and othr color vars can be set directly from a Vera scene using the Advanced feature.  This also allows you to execute Hue scenes, though I haven't tried that yet; the scenes list appears to be a bit messed up.  I have several entries in the list with the same name.
HomeWave is available in the App Store!  Turn your iPhone/iPad into an easy-to-use remote control for Vera.

Offline helraiser

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +2/-0
Re: Philips Hue plugin by MiOS (BETA)
« Reply #8 on: July 21, 2015, 12:37:50 pm »
Thanks for the clarification on what firmware version to try it with, Andrei.

Offline intveltr

  • Hero Member
  • *****
  • Posts: 1668
  • Karma: +92/-5
Re: Philips Hue plugin by MiOS (BETA)
« Reply #9 on: July 24, 2015, 12:55:04 pm »
I tried installing the plugin on my Vera 3 running UI5 (my production machine), and got the same result as @helraiser: a device was created by the plugin but it did not show up in the UI.

I have not uninstalled the old Hue plugin yet, and it uses similarly named files (I_PhilipsHue1.xml)  Could there be a naming collision between the two plugins?

HomeWave is available in the App Store!  Turn your iPhone/iPad into an easy-to-use remote control for Vera.

Offline BOFH

  • Sr. Hero Member
  • ******
  • Posts: 2310
  • Karma: +107/-135
Re: Philips Hue plugin by MiOS (BETA)
« Reply #10 on: July 24, 2015, 03:36:00 pm »
Gonna have to dust off and connect my Hue hub and link  my 2 GE bulbs to it.
Vera3 UI5 UI7 Edge Plus
Trane TZEMT400AB32 | Schlage BE369 FE599 | GE 45601 45602 45603 45604 45606 45609 45631 | Intermatic HA01C HA03C HA05C HA07C CA600 CA3000 | Aeon DSC06106 | Telguard GDC1 | Foscam FI8910W FI8905W FI9821W | D-Link 930L | Wanscam JW0011 | ZModo ZPIBH13W

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3226
  • Karma: +180/-8
Re: Philips Hue plugin by MiOS (BETA)
« Reply #11 on: July 24, 2015, 09:11:45 pm »

Could there be a naming collision between the two plugins?

I don't think so; I've got both installed side by side and they both function as designed.

Offline CudaNet

  • Hero Member
  • *****
  • Posts: 1335
  • Karma: +36/-10
  • Chimichanga !
Re: Philips Hue plugin by MiOS (BETA)
« Reply #12 on: August 05, 2015, 08:07:17 pm »
Hmm.... No discovery, nothing but this (Vera3 running most recent UI7 fw)...

Code: [Select]
01      08/05/15 19:00:00.705   LuaInterface::CallFunction_Startup-1 device 313 function PhilipsHueStartup failed [string "module("L_PhilipsHue2", package.seeall)..."]:610: attempt to index field 'xy' (a nil value) <0x2be3c680>
01      08/05/15 19:00:00.706   LuImplementation::StartLua running startup code for 313 I_PhilipsHue2.xml failed <
openLuup, AltUI, Zway and HomeWave, enough said...

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3226
  • Karma: +180/-8
Re: Philips Hue plugin by MiOS (BETA)
« Reply #13 on: August 05, 2015, 10:39:31 pm »

Hmm.... No discovery, nothing but this (Vera3 running most recent UI7 fw)...

What models of lamps have you associated with your hue bridge? Any hue lux or an off-brand lamp that cannot have its colour temperature changed, perchance?

Offline CudaNet

  • Hero Member
  • *****
  • Posts: 1335
  • Karma: +36/-10
  • Chimichanga !
Re: Philips Hue plugin by MiOS (BETA)
« Reply #14 on: August 05, 2015, 11:14:13 pm »
Hue (A19, GU10), Hue Lux (A19) and Bloom... Cleaned up files on my V3 and attempted to re-install from the 2nd link provided by MCV and still get the following:

CreatePlugin&PluginNum=8162&Version=28151

Code: [Select]
50      08/05/15 22:05:58.461   luup_log:314: (Hue2 Plugin)::(checkInitialStatus) : Philips Hue Connected! <0x2c156680>
01      08/05/15 22:05:58.509   LuaInterface::CallFunction_Startup-1 device 314 function PhilipsHueStartup failed [string "module("L_PhilipsHue2", package.seeall)..."]:610: attempt to index field 'xy' (a nil value) <0x2c156680>
01      08/05/15 22:05:58.510   LuImplementation::StartLua running startup code for 314 I_PhilipsHue2.xml failed <
« Last Edit: August 05, 2015, 11:21:33 pm by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...