openLuup: Illumination (Philips Hue/LIFX etc.)

A HUGE thanks for working through this… I really appreciate it…

It’s going to be a real pain as these MCV/user plugins get revised. A great example is the latest Nest plugin, they are now checking to see what equipment it’s running on as well as installed packages (opkg; openssl, curl, ssl libs etc…). I’m permanently removing the Nest plugin off my Vera and installing the ‘original’ files on openLuup. I just don’t see a reason for upgrading as it appears to work. MCV is scheduled to release a new firmware with the revised Philips Hue code. Again, I don’t see what it will bring to the table as I now have control of pretty much everything except gimmicks like making the bulbs alert (breathe for 30 seconds) or performing a color loop.

The real test is getting all these plugins installed on openLuup and watching for any issues long term…

Have I said how much I love openLuup ??

[quote=“akbooer, post:39, topic:189406”]Excellent news… thank goodness for that!

Actually, I’m extremely annoyed at myself because I actually quoted the errant line in this earlier post http://forum.micasaverde.com/index.php/topic,34477.msg255327.html#msg255327, but didn’t recognise it for what it was.

I also now have the dilemma of whether or not to emulate this undocumented behaviour. I also have to see if it holds for other luup calls.

Vera/MiOS never ceases to amaze me (in a bad sort of way.)[/quote]

It started out where MCV asked members to test the beta. For me, it never worked as it was targeted at specific bulbs. Blong patched it for use by Cree and Lux and it worked perfectly for me on Vera. I’ll actually post your fix on the thread for other users.
http://forum.micasaverde.com/index.php/topic,33088.msg244374.html#msg244374

Final thoughts. I need to write some how-to guides so others can get up and running.

[1] Nest (1st release from MCV).
[2] Multi-string.
[3] Philips Hue (patched release from blong; repatched for openLuup).
[4] Google Calendar 3 (push and receive events).
[5] IOS push.
[6] Sonos.

That’s be great. Could put them into a locked thread or on GitHub (or both.)

I’ll work on that this week. Also have an openLuup ‘environment’ install guide to share, waiting on 1 other person to give me feedback before I hand it over.

And here is the Philips Hue by MiOS install package. I’ll start working on the Nest (WWN) by MiOS plugin package next…
Edit: Re-packaged, release 2.

[quote=“CudaNet”]OK, here is an installation of OpenWRT (Chaos Calmer) on a Raspberry Pi 2. I’m also going to include a ‘beta’ installation guide.
I’ve personally tested this (obviously) so it should be good to go. I just need a ‘fresh’ set of eyes to go over it.

For any discrepancies/recommendations etc, please send me a PM.

[code]

root@OpenWrt:/# cat /etc/banner
_____
.-----.-----.-----.-----.| |.–.–.–.–.-----.
| _ | _ | -| || | | | | | _ |
|
| |||||
______||| |
|
| F R E E D O M F R O M V E R A |__|

OpenWRT - CHAOS CALMER (15.05)
Powered by Raspberry Pi 2

  • 1 1/2 oz Gin Shake with a glassful
  • 1/4 oz Triple Sec of broken ice and pour
  • 3/4 oz Lime Juice unstrained into a goblet.
  • 1 1/2 oz Orange Juice
  • 1 tsp. Grenadine Syrup

root@OpenWrt:/#

[/code][/quote]

Cudanet, been trying to set up this plugin for a while with little success on my raspberry pi2. Followed your instructions , cant pair to hue bridge with pair button, tried manual method and get this error message " 11/19/2015, 3:14:29 PM Error in PhilipsHue2.setPhilyHueIp(): TypeError: Utils.trim is not a function" I have the MIOS Hue plugin working on the main vera edge and have the same error message when using the files from that. Any ideas?

David

On the bridge device, click on Variables and change BridgeLink from 0 to 1. Then hit the bridge button again (hue Bridge) then on openLuup, the pair with bridge button. Reload Luup Engine and let’s see what that does.
I had these issues on Ubuntu as well but when I changed over to OpenWRT, things went a lot smoother.

[quote=“dsroberts1945, post:47, topic:189406”]Cudanet, been trying to set up this plugin for a while with little success on my raspberry pi2. Followed your instructions , cant pair to hue bridge with pair button, tried manual method and get this error message " 11/19/2015, 3:14:29 PM Error in PhilipsHue2.setPhilyHueIp(): TypeError: Utils.trim is not a function" I have the MIOS Hue plugin working on the main vera edge and have the same error message when using the files from that. Any ideas?

David[/quote]

No variables on variable tab !

Just curious, have you reloaded Luup ? If so, you might need to halt the engine (id=exit), remove the logs. Start openLuup and post that log. I just want to see if the plugin is doing once the system starts up.

OK run openluup with barebones startup file, log file attached.

This log entry doesn’t look good, and would explain the lack of anything on the variables tag:

2015-11-19 17:41:19.720   openLuup.context_switch::  ERROR: error loading module 'L_PhilipsHue2' from file './L_PhilipsHue2.lua':
	./L_PhilipsHue2.lua:1006: 'end' expected (to close 'function' at line 193) near '<eof>'

…look like an incomplete file copy ?

It was. downloaded L_PhilipsHue2.lua from my vera edge and replaced the damaged one. Can get the plugin to connect to HUE BRIDGE but still can’t see any of my bulbs.

My apologies, I just checked and it appears the file has always had an error (from the original author). I checked it using Zerobrane and it’s missing an end. That’s odd as I don’t have any issues running this… I guess I’ll patch it and re-release the package. But I want to re-test on my system at home before I re-release.

Edit: @dsroberts1945

I’m curious as to what version you copied from your Vera. We have to be very careful as the version I’ve packaged was originally adjusted by Blong (2nd release from MCV) and then Akbooer discovered the polling issue which was line 973 (L_PhilipsHue2.lua). This latest issue whereby it has a compilation error has always been there.

I’ve tested with the newer versions released by MiOS and could NEVER get them to work (it wouldn’t pair no matter what I did). Add that to the fact that they’ve since removed functionality such as group support. So basically all of these issues kept me from working with the latest/newest releases.

Compilation error on line 1006:

[quote=“CudaNet”]You don’t want to use the one from you’re Vera, the package I posted has a patched L_PhilipsHue2.lua within it. I’ll check to see if it’s trunc’d.

It was the latest one from MIOS, I will wait for your patch.

Ouch, yeah that one never worked for me. I even semi-tricked it into linking and it gave me bulbs but when I tried to control them. Error’s all over the place.
I’ll try again when they release the final one but I think the one I’m using will suffice as it works well and has group support.

Packaged updated. Please install all plugin files (/etc/cmh-ludl) and icon files (/etc/cmh/skins/default/icons).

The modification to line 952 of the Lua file fixes a bug in the original code (wrong variable name), but still works on a real Vera because of an undocumented feature of Luup.

Release 6 of openLuup now includes that feature - nil device parameter in luup.variable_set() and get - so the patch is not strictly necessary… but perhaps worth keeping just for documentation’s sake?

Anyway, great stuff!

cudanet

downloaded version 2 still getting message in logfile waiting for end in line 193. added at end of function reloaded getting this message

“2015-11-20 13:33:05.838 luup_log:4: (Hue2 Plugin)::(Startup) : Initiating
2015-11-20 13:33:05.896 openLuup.context_switch:: ERROR: ./L_PhilipsHue2.lua:208: attempt to index global ‘lul_settings’ (a nil value)
2015-11-20 13:33:05.896 openLuup.scheduler:: job aborted : ./L_PhilipsHue2.lua:208: attempt to index global ‘lul_settings’ (a nil value)”
no variables shown again

David

I’ll retest this weekend and report back.

[quote=“akbooer, post:58, topic:189406”]Release 6 of openLuup now includes that feature - nil device parameter in luup.variable_set() and get - so the patch is not strictly necessary… but perhaps worth keeping just for documentation’s sake?

Anyway, great stuff![/quote]