Philips Hue plugin

Questions and comments specific to a particular plugin should go here.
Aquila
Experienced User
Posts: 92
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Fri Feb 06, 2015 9:35 am

yokel22 wrote:Yep, working well now. I'm still not getting any returns on the getstatus commands. Everything else is working well. I like the subdivisions you threw in too. Is it possible to send toggle commands to the api?
How do you use the "getstatus" command? It is not supposed to print anything, it RETURNS a dictionary with the light object from the bridge. If you want it to print you can use a "Python command" with the command: "print eg.plugins.PhilipsHue.getStatus('1')"
How it looks at my place:
getstatus.JPG
Do you mean toogle on/off? The Hue API does not support a command like that, but I can easily make one for this plugin since I can pull the state of the light and send a command depending on the result. I will add it in the next version. :)

User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Philips Hue plugin

Post by yokel22 » Fri Feb 06, 2015 12:41 pm

Thanks, that's what i was missing. I wasn't sure how you were getting it to return values from the command. The python command has it returning values now. I meant toggle On/Off. I wasn't sure if it was in the command set. I just remember seeing a toggle command in the tasker plugin autohue. Getstatus is sufficient for the task.

Aquila
Experienced User
Posts: 92
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Fri Feb 06, 2015 10:11 pm

Great then we have solved that question. I have a working version of toggleLight and toggleGroup in my build now. If you want I can publish now. Currently I'm working more on handeling connectionerrors in the eventthread. I get random connectionerrors at my place, and I would like to fix it before next release.

Any other requests?

User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Philips Hue plugin

Post by yokel22 » Sat Feb 07, 2015 5:29 pm

No rush from me. I actually got toggle working with a little less logic. Pictured example for anyone interested.
Attachments
toggle example.png

Aquila
Experienced User
Posts: 92
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Sat Feb 07, 2015 5:47 pm

I have published a new version, 0.2.2.

Changes from 0.2.1:
- New function: "getSensorStatus", returns dictionary of one sensor.
- Cleand up some code. (hue() returns dictionary instead of json)
- Fixed bug in configdialog for "ChangeLight".
- New function: "toggleGroup", toggles lights in group on/off.
- New function: "toggleLight", toggles light on/off.
- Fixed bug in connectionerror handeling in eventthread.
- Catches connection error at plugin startup.

Aquila
Experienced User
Posts: 92
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Sat Feb 07, 2015 5:50 pm

yokel22 wrote:No rush from me. I actually got toggle working with a little less logic. Pictured example for anyone interested.
This will work as long as all commands are received and no other interface changes the status of the lights. I have published a new version, it has toggleLight command. The toggleLight commands checks the status of the light before it changes it. :)

User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Philips Hue plugin

Post by yokel22 » Sat Feb 07, 2015 8:35 pm

Def. not ideal just a thought that occurred to me. I'll give 2.2 a run here tonight.

Everything is working great! There's a little bit a weirdness happening in the dropdown menu within the group commands. Probably because i only have two groups created @ the moment. The only other thing i can think of (which your probably already working on) is to add a change light command to grouped bulbs. IE color,sat,brightness changes to an entire group. Really great work.
Attachments
dropdown.png

Aquila
Experienced User
Posts: 92
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Sat Feb 07, 2015 10:21 pm

Hmm, the group thing I think is because the "create group" command has been run many times. There will be a "deleteGroup" and "editGroup" in a future version.

You are correct to guess that change all lights in group is a command I'm working on. This will probably be ready for next version. I have copied my list of planed additions under. Please feel free to request other changes.

Planed changes in next version:
- More errorhandeling.
- Implement scenes. (see Hue API)
- More group functions: deleteGroup, renameGroup, editGroup, changeGroup, customGroupCommand, isGroupOn, getGroupStatus, standardWhiteGroup, pulseGroup, colorloopGroup.
- Allow commands to multiple lights in commands to selected light. (see Hue API)
- Better layout for configdialogs.

User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Philips Hue plugin

Post by yokel22 » Sun Feb 08, 2015 1:45 am

Your probably right. I did create multiple groups before it started populating the list. Full scene control would be sweet. If your feeling crazy, mood controls or moods that respond to sound(IE: somethhing similar to huemaniac or huedisco on android). & how 'bout a macro to remove unused dev. accounts from the bridge.

RiseUp
Posts: 20
Joined: Mon Nov 24, 2014 3:28 am

Re: Philips Hue plugin

Post by RiseUp » Mon Feb 09, 2015 1:05 am

Thank you so much, Aquila! I am installing this right now! :D

Aquila
Experienced User
Posts: 92
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Mon Mar 09, 2015 4:05 pm

I have posted a new version in the first post. :)

The rest of the group commands is now avilable, including scenes. I made a major rework of the code with a change from "requests" to "httplib". This seems to make the plugin less prone to lags. I have also worked much on errorhandeling, mostly to keep the eventthread alive on connectionerrors. I have reduced the pull frequency because on some systems the earlier pull frequency of 1 second overloaded the bridge and/or network. Please give feed back on this change. There is a lag in the Philips Bridge API, so you could anyways never get instant events.

Changelog:
0.3.0 by Aquila 2015-03-09
- Change from "requests" to "httplib"
- Changed eventthread pull frequency to 2 seconds (earlier 1 second) to prevent overloading the bridge.
0.2.3 by Aquila 2015-02-10
- Reorganized grouping of actions.
- New function: "modifyScene", modifys scene settings for a light.
- New function: "createScene", creates new or edits existing scenes.
- New function: "useScene", uses scene on spesific group.
- New function: "colorLoopGroup", sends colorloop command to group.
- New function: "pulseGroup", sends puls/alert command to group.
- New function: "standardWhiteGroup", changes all lights in group to standard (varm) white.
- New function: "getGroupStatus", returns status of group as a dictionary.
- New function: "isGroupOn", return if group is set to off (return False) or on (retirn True).
- New function: "customCommandGroup", send custom command to a group of lights.
- New function: "editGroup", edit Group (rename and change lights in group).
- Fixed bug in connectionerror handeling in eventthread.
- New function: "deleteGroup", deletes one or more groups.
- New function: "changeGroup", changes light from a group of lights.

nikeb
Posts: 9
Joined: Fri Dec 19, 2014 12:09 pm

Re: Philips Hue plugin

Post by nikeb » Fri Mar 13, 2015 6:46 pm

Hi guys

I always would love to be able to control my Philips Hue with EventGhost,
i already found a python script to control them but i always dreamed about find a real plugin

At the moment when i run the "registered on bridge" action i get this strange error:

Philips Hue: Register with Bridge
[{u'error': {u'type': 2, u'description': u'body contains invalid json', u'address': u''}}]

This happens after i press the Hue button AND even if i don't do that.

The IP is correct, everything is fine.
Any clue?

I m available for all the kinds of beta test you want to try (i had 5 hue lamps and a bloom)

Nice work anyway!

Aquila
Experienced User
Posts: 92
Joined: Wed Jan 28, 2015 2:49 am

Re: Philips Hue plugin

Post by Aquila » Fri Mar 13, 2015 7:46 pm

Sorry about that! I forgot to comment out a line. I have fixed the bug now, new version in first post.

Please report back if you find the plugin to your liking. :)

nikeb
Posts: 9
Joined: Fri Dec 19, 2014 12:09 pm

Re: Philips Hue plugin

Post by nikeb » Fri Mar 13, 2015 8:09 pm

Perfect!
Works like a charm

nikeb
Posts: 9
Joined: Fri Dec 19, 2014 12:09 pm

Re: Philips Hue plugin

Post by nikeb » Sun Mar 15, 2015 7:02 pm

i m testing every single command and his combos and it s working great.

may i suggest to add an option command to set up the transition time for the commands?

would be awesome!

i can provide you the python code with the parameter that needs to be set.

Post Reply