VoxCommando
VoxNastics (User Guides and Mods) => Integration Ideas => Topic started by: Casmo on March 06, 2014, 09:00:13 AM
-
Hi all,
I realise no official plugin for hue is being developed (understandably so being a niche and expensive product) but im just wondering if anyone here is a hue user and has found a way to get vox commando talking to it?
I did come across this http://www.everyhue.com/vanilla/discussion/161/winhue-windows-application/p1 and hoped I could use cmd line arguments to control my lights but I cant seem to get it working and the project doed not appear to be very active.
-
Did you make any progress? From looking at the project website, it looks like others have had some success with this program. It also looks like there is active discussion taking place.
-
Hi,
Some progress made! Using this http://bahamas10.github.com/hue-cli/ I can send commands to the lights from the command window. What I'm not sure of is how to call this from an action. As in if I add a 'hidden launch', I'm not what to put as path & arguments.. I'm sure it's very simple, I'm just not a scripter..
would hugely appreciate some pointers as I'm close...
Thanks in advance
-
I'm a bit confused because what you linked to does not look like a Windows command line interface.
But assuming you are able to issue commands from a windows command prompt, just tell us what you are typing into the command line.
If using the Launch command, it is extremely simple. You don't need to be a scripter (whatever that means).
If you add a "Launch.Hidden" action to a VC command it accepts two parameters (These are clearly indicated within the LCB and if you watch any of the tutorials on building commands in VC, or if you read the wiki you will already know how to create actions and how to figure out what the parameters are for an action). Here is a view of the Launch.Hidden from the action selection tree:
1st parameter is path (path to application) which is going to be something like c:\somefolder\myhueproggy.exe
2nd parameter is the command line params to send to the application. I don't know what these are.
here is action info for Launch on our wiki: http://voxcommando.com/mediawiki/index.php?title=Actions#Launch
-
Thanks for the reply. Pardon my ignorance, my terminology is probably all wrong.
The command line interface I installed allows me to open the cmd window, type 'hue lights 1 off' and the command is sent to the bridge. The exe is installed 'globally' (not sure what this means) so I'm not clear as to what the path is.
-
The command line interface I installed...
Can you explain what the "commandline interface" is (maybe the hue programm?).
...allows me to open the cmd window,
Do you mean the CMD.exe from windows?
Is it possible to post a screenshot?
-
Hi Casmo,
It's definitely confusing for those of us not familiar with how these things might work.
Can I assume that you followed the instructions on that site, downloaded the node.js and then followed their instructions by entering "npm install -g hue-cli" in the command prompt window?
The question is where you ran that installer, because that's the file path you'll need.
For me, the path is c:\users\[myusername]
If you can figure that out, then place the batch file I've attached here into that directory. Then you create your Vox commands according to the examples they give. You won't be able to access results, but you should be able to *send* commands.
[EDIT FOR FUTURE READERS: *** Later we figured out that the hue-cli commands are executable globally, so you can put the attached test.bat file directly in your VC directory, and then no filepath is needed in the first parameter, just the filename "test.bat". ***]
Here is a command group with 2 sample commands, based on the command examples provided at your link. I can't test them, obviously:
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="hue" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="271" name="turn on hue lights on or off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Launch.RawParam</cmdType>
<cmdString>c:\users\[yourusername]\test.bat&&lights {1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>turn hue lights</phrase>
<payloadList>on, off</payloadList>
</command>
<command id="292" name="change light colour" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} refers to the light number
{2} to the colour">
<action>
<cmdType>Launch.RawParam</cmdType>
<cmdString>c:\users\[yourusername]\test.bat&&lights {1} {2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>turn hue light</phrase>
<payloadRange>1,10</payloadRange>
<phrase>to</phrase>
<payloadList>red, green, blue</payloadList>
</command>
</commandGroup>
Try selecting and copying all of the above, pasting into your tree, and then you will have to put the attached batch file in the proper directory and change the file path I have used in my commands to the correct path for your installation.
I hope this helps you to get started.
Note that if/when you have your commands working, you can change from RawParam to Launch.Hidden so that the command prompt window no longer appears.
-
The above 2 commands use the command line examples:
hue lights on
and
hue lights 1 red
The batch file already has the "hue" in it so we are just adding the "lights x y z" parameters in our VC command.
-
We have never used node.js so we are all a bit ignorant. :D
If you can run hue in a command window regardless of what directory you are in, then the simplest is probably to but the batch file directly in your VC folder. Then you can call it using Launch.rawparams -- test.bat -- params
In our tests this works, but since we don't have a bridge to test with all we can do is test using the params: search
This keeps the window open for a few seconds, then it returns "0 stations found" and then the window closes immediately.
So I think this method should work for you.
The reason you need to use a batch file, is that VC looks for a file to execute and can't find a file by the name of hue, so it throws an error. It can find the batch file though, and the batch file doesn't mind calling a file that isn't there, apparently.
-
Using this api directly seems like it would be much easier / and much better.
http://developers.meethue.com/index.html
Is there some reason why you can't use this? You should be able to test the basic function by entering the correct URL into the address bar of your web browser.
Are you able to control your hue through this api? It seems like you just need to find the IP address of your bridge, and know your username and then you can enter URLs like this example which returns a list of lights:
192.168.xxx.xxx/api/YOURUSERNAMEHERE/lights
I don't know what steps you might need to take on the hue itself to enable this functionality. If this works it would be much much better than trying to do it through a (pseudo) command line interface.
-
Excellent, thanks a lot for the imput guys. Really appreciate it.
I wasnt even aware of that API. If it works as described, thats definately the way to go. I'll do some experimenting tonight and let you know.
Thanks again
-
For starters, just try to get the "get" api methods working with the "Scrape" action in VC, or in your web browser.
The "put" and "post" methods probably won't work. I will be adding Scrape.Put and Scrape.Post actions to the next VC2 release.
-
Am i right in thinking that scape is only required to return the output of the command i.e. if I send a comaand to turn on light 1, VC can then TTS "light 1 turned on"?
Also, what kind of vc action do I need to use to call "ip address /api/<username>/lights/<id>/state" (e.g. 10.1.0.1/api/computer/light/1/on)? If I use Launch.OpenURL, will that not open a webpage?
-
I can't help but feel that you did not read my last post very carefully.
The scrape action performs an http get as if you entered an URL into your browser, and returns whatever the server returns. You don't have to use what is returned though, if you don't want to. Most servers (eg: VC, XMBC, iTach, Halx etc.) will allow you to perform actions using http get calls by passing data on an URL. but HUE requires us to use PUT for some methods.
Also, what kind of vc action do I need to use to call "ip address /api/<username>/lights/<id>/state" (e.g. 10.1.0.1/api/computer/light/1/on)? If I use Launch.OpenURL, will that not open a webpage?
That is a put method. As I mentioned in my last post, you will need Scrape.Put which does not exist yet. That is why I said: The "put" and "post" methods probably won't work. I will be adding Scrape.Put and Scrape.Post actions to the next VC2 release.
If you use Launch it will be the same as using scrape except that it will open a window and you won't get anything back in LastResult.
-
See the Scrape discussion here: http://voxcommando.com/mediawiki/index.php?title=Home_Automation
-
Without wishing to complicate matters, it seems like for now it should be possible to combine the two separate methods described above to control your Hue lights, assuming you do actually have that command line program working properly.
1. Use the scrape command to get status information about your lights.
So, if you were able to get the IP address etc. as per the instructions in the HUE REST API documentation, then you could get information about whether or not lights are on or off -- anything that is listed as a "get" command. If you have the ID numbers for your lights and know the proper URL, you can try the following to get feedback about whether a specific light is on or off:
<?xml version="1.0" encoding="utf-16"?>
<command id="266" name="Get status of light {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} = id number for the light. (Later you can make a payload xml file that associates ID numbers with friendly names, so that instead of saying the number of the light, you can say "bedroom light" or whatever.)

The first & second OSD.ShowText actions can be deleted. I've put them here just to show you what information is being returned. If you want to see the complete information that is being scraped from a given URL, change the 1st OSD.ShowText from 0 to 1. It should look like the documentation that they include on the Hue website (http://developers.meethue.com/1_lightsapi.html).">
<action>
<cmdType>Scrape</cmdType>
<cmdString>http://<bridge ip address>/api/<username>/lights/{1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>Results.RegEx</cmdType>
<cmdString>"on": (.*?),</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>The results scraped from this URL say that "on" is "{Match.1}". Therefore:</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>{Match.1}&&true</ifParams>
<then>
<action>
<cmdType>OSD.AddText</cmdType>
<cmdString>Light {1} is on.</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Light {1} is on.</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>OSD.AddText</cmdType>
<cmdString>Light {1} is off.</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>Light {1} is off.</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<phrase>Get status of light</phrase>
<payloadRange>1,10</payloadRange>
</command>
2. Use your command line utility to try to change the state of your lights, as per the examples we provided earlier in the thread using the batch file etc.
Those commands assume that you have already successfully used the command line interface thingee (without VC) to change the state of your lights. If that isn't working, then obviously adding VC to the mix is not going to help.
There are no guarantees, but in theory these solutions should work. That is the extent of the information or assistance that we can provide, since we don't have the hardware. :bonk It's all hypothetical, based on the documentation that those sites have posted.
No doubt some experimentation, problem solving, and learning will be involved on your end. Hopefully you'll eventually have some fun results to share with other Hue owners here on the forum!
-
Hi All,
Quick update. I had another look at using .bat files with the Hue-cli interace and its working perfectly. "all light on" " all lights red" etc. working flawlessly. I didnt have a lot of time so I need to create some more bat files for individual lights, scenes etc but im very happy with the results so far.
The downside is needing to create a new action and file for each light /colour combination rather than using payloads which would be a lot cleaner. I will have another look at the official api when I get some time.
In reality though, I only need maybe 6-10 commands to cover the most used functions.
Really cool stuff.
*now what will I get voxcommando to do next*
-
Hi Casmo, can you please post a example of a .bat file. Thanks
Looks like the content of the bat file in this way?
hue %1 %2 %3 %4 %5 %6
-
Sure. So, turn on kitchen light is;
hue lights 2 on
All off is;
hue lights all off
A "sci fi" scheme
hue lights 2 blue
hue lights 1 mediumturquoise
hue lights 3 dodgerblue
etc etc. Simple as that. Ive saved the .bats to vc folder so its the action is just OpenBat all off.bat etc.
-
Yeah, that is it ;D
So I can show you a way, in which you need only one batch file for all your commands and this batch is created automatically by VoxCommando. ;)
Give me some minutes to create a "Test" group for you and let us know if it works.
-
Nime5ter already gave you a sample showing you how to to all commands with payloads all with a single batch file. ::club
-
OK, here we go: This commands create the "huetest.bat" with the value for your Hue in VC Mainfolder and execute it. The file will be overwritten for every new command ;)
1. Save the hueID.xml, huecolor.xml and hueScene.xml in the VC payload folder.
2. Drag and drop the followed code to your VC command tree.
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="hue test" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="690" name="change hue colours" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Write</cmdType>
<cmdString>{Path.VC}\huetest.bat&&{1} {2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenBat</cmdType>
<cmdString>{Path.VC}\huetest.bat</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>I have set the {1} to colour {2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>switch, put, turn</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\hueID.xml</payloadFromXML>
<phrase optional="true">to</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\huecolor.xml</payloadFromXML>
</command>
<command id="691" name="hue scenes" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Write</cmdType>
<cmdString>{Path.VC}\huetest.bat&&{1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenBat</cmdType>
<cmdString>{Path.VC}\huetest.bat</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>I have set the hue to {PF.1} scheme</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>hue scheme</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\hueScene.xml</payloadFromXML>
</command>
</commandGroup>
Have fun!
-
Excellent, I look forward to trying this later.
Many thanks All
-
Oh just one other thing. I created .bats for lights up/down
hue lights all +20
hue lights all -20
The 20 of course is another variable.
How would i best incorporate this into the script/xmls?
-
sigh.
You only need one batch file, and you don't need to do anything fancy with generating new batch files etc.
Everything you need is here: http://voxcommando.com/forum/index.php?topic=1436.msg12519#msg12519
just read it.
Using this simple method you can do lights up with this command, and you don't need any more batch files. Just the one.
<?xml version="1.0" encoding="utf-16"?>
<command id="292" name="lights up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} refers to the light number
{2} to the colour">
<action>
<cmdType>Launch.RawParam</cmdType>
<cmdString>test.bat&&lights all +20 </cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>lights up</phrase>
</command>
-
Yes, James is right, I have tested nime5ter's command group and it works also perfect!
You can use both ways! I think nime5ster's is easier to understand.
If you still want to do it my way you can use the following:
Drag and drop this command in the "hue test group" - so you can say: "dim {hueID} {down/up} to {X} percent. The curly brackets represent the payloads - to and percent is marked as optional phrases.
<?xml version="1.0" encoding="utf-16"?>
<command id="704" name="dim Hue" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Write</cmdType>
<cmdString>{Path.VC}\huetest.bat&&{1} {3}{2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenBat</cmdType>
<cmdString>{Path.VC}\huetest.bat</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>I have dim {1} to {2} percent</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>dim</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\hueID.xml</payloadFromXML>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\huecolor.xml</payloadFromXML>
<phrase optional="true">to</phrase>
<payloadRange>1,100</payloadRange>
<phrase optional="true">percent</phrase>
</command>
-
Thanks a lot folks.
To clarify James, I understand that only one batch file is required. I was referring to how I was doing lights up/down previously and how to achieve this in the xml script.
Im honeslty not trying to test your patience, im genuinely trying to understand this stuff as a total novice..
-
I think at this point, rather than trying to figure out every command for the Hue, what's missing is an understanding of how VC works.
So, what might make the most sense is to take the first 2 commands that were provided as examples and just explore those: poke around. Try to understand the elements.
By dissecting those two initial commands within VoxCommando's command tree and the Logical Command Builder (the macro editor), you are more likely to have the tools you need to create all the other commands that you're now trying to build. If we keep posting more and more xml, I think it will only confuse matters.
Break those two commands and then fix them. Turn off the individual actions within a command and turn them back on, etc. Figure out how the command "sentence structure" is composed, develop more of an understanding of what payloads are and the different options you have for those.
I think at this point we are all only confusing matters by posting more and more examples and options of how things can be done.
-
In case you haven't seen this yet: http://voxcommando.com/mediawiki/index.php?title=Payloads
There are some video tutorials regarding building commands and payloads and the like as well.
-
Hi,
So the change color command as post by kalle is working perfectly,very impressive.
On the change scene one, its appears to be only changing the first light e.g. light 3 below
hue lights 2 blue{CR}hue lights 1 mediumturquoise{CR}hue lights 3 dodgerblue
I've checked that the below work in a bat file so im not sure what the problem is with the above
hue lights 2 blue
hue lights 1 mediumturquoise
hue lights 3 dodgerblue
The dim command doesnt appear to be working correctly either. I've been working through how the commands
are built, on this one im not sure why the huecolors xml is being called. When executed the TTS is saying for example "kitchen light dimmed by blue %" (though it doesnt actually dim)
-
Oh I've also noticed this:
"Brightness of the light. This is a scale from the minimum brightness the light is capable of, 0, to the maximum capable brightness, 255. Note a brightness of 0 is not off "
So presumably it cant be changed by %
-
Can you please post the xml that you're using in a code block? That is, for each command that you're having problems with, please post the xml that is currently in your command tree.
http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum#Posting_Your_Code_to_the_Forum
And if you're using payload xml files for those commands, please attach those too.
If changing brightness to 0 doesn't turn a light off in Hue syntax, then probably a separate lights off command will be needed.
-
Oh the zero doesn't mean off is not an issue, i was more referring to the range of 1 - 255
The code i used is as per posted by kalle
<?xml version="1.0" encoding="utf-16"?>
<command id="704" name="dim Hue" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Write</cmdType>
<cmdString>{Path.VC}\huetest.bat&&{1} {3}{2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenBat</cmdType>
<cmdString>{Path.VC}\huetest.bat</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>I have dim {1} to {2} percent</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>dim</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\hueID.xml</payloadFromXML>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\huecolor.xml</payloadFromXML>
<phrase optional="true">to</phrase>
<payloadRange>1,100</payloadRange>
<phrase optional="true">percent</phrase>
</command>
-
OK. And you've made no changes to his xml and you're using the payload xml files he posted as is?
-
Thats right, using the code exactly as posted. I changed bulb names in the hueid xml as I had misnamed them and added a few colors to the huecolors ml but that is all.
-
On the change scene one, its appears to be only changing the first light e.g. light 3 below
hue lights 2 blue{CR}hue lights 1 mediumturquoise{CR}hue lights 3 dodgerblue
Sounds like it is only executing the last line then. It's hard to know what you mean when you say that you tested these "work in a batch file". What do you mean when you say that they work?
The dim command doesnt appear to be working correctly either. I've been working through how the commands
are built, on this one im not sure why the huecolors xml is being called. When executed the TTS is saying for example "kitchen light dimmed by blue %" (though it doesnt actually dim)
The TTS announcement is not actually checking to see whether the earlier actions have been executed, it is just stating that "I have dim {1} to {2} percent". A TTS announcement can't do anything other than talk.
Take a look at the dim Hue command in your tree, or in the xml that you posted for me. Which payload is payload 1, and which payload is payload 2?
-
The dim command should not be using the hue colour payload xml.
Based on Kalle's description of how the command is supposed to work, I suspect that he meant to use a different payload xml file there but forgot to change that line and provide you with the necessary payload file. But since it's not my xml I will leave that to you guys to figure out.
-
"Brightness of the light. This is a scale from the minimum brightness the light is capable of, 0, to the maximum capable brightness, 255. Note a brightness of 0 is not off "
So presumably it cant be changed by %
Although the command uses the phrase "percent", that's just talk. In the end, we're using the syntax that the developers provided. So you could either do some math and figure out how you might change the scale of 0 to 255 to percentages and then have a payload xml file do the conversion for you, or map a set of values from 0 to 255 to phrases in your payload xml (e.g value "0" to phrase "lowest setting" 110 = "medium bright" 255="maximum brightness). Or you simply use a command like "dim light X to 255" / "dim light X to 0" as your way of telling it to go to maximum brightness or the dimmest setting.
-
nime is right, I've changed something in the payloads and forget to upload it - so sorry :bonk
Here is the command group again and also all changed payloads.
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="hue test new" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="690" name="change hue colours" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Write</cmdType>
<cmdString>{Path.VC}\huetest.bat&&{1} {2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenBat</cmdType>
<cmdString>{Path.VC}\huetest.bat</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>I have set the {1} to colour {2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>switch, put, turn</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\hueID.xml</payloadFromXML>
<phrase optional="true">to</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\huecolor.xml</payloadFromXML>
</command>
<command id="691" name="hue scenes" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Write</cmdType>
<cmdString>{Path.VC}\huetest.bat&&{1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenBat</cmdType>
<cmdString>{Path.VC}\huetest.bat</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>I have set the hue to {PF.1} scheme</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>hue scheme</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\hueScene.xml</payloadFromXML>
</command>
<command id="704" name="dim Hue" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>File.Write</cmdType>
<cmdString>{Path.VC}\huetest.bat&&{1} {3}{2}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.OpenBat</cmdType>
<cmdString>{Path.VC}\huetest.bat</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<cmdString>I have dim {1} to {3} percent</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>dim</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\hueID.xml</payloadFromXML>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\huecolor.xml</payloadFromXML>
<phrase optional="true">to</phrase>
<payloadRange>1,100</payloadRange>
<phrase optional="true">percent</phrase>
</command>
</commandGroup>
-
Hi Kalle,
Sorry to add to the confusion! :bonk
The command I am not understanding is specifically the "dim Hue" command.
The Hue documentation gives the example syntax:
hue lights 1 -10
In the xml you've posted, I am seeing the following:
Dim {lightID} {light colour} {range 1 to 100}
Why is there a light colour payload in this command?
Also, Casmo has noticed that Hue does not calculate brightness by percentage (0% to 100%), but from 0 (dimmest) to 255 (brightest).
So, when they say "-10" or "+10", they mean incrementing between 0 and 255, not percentages.
-
Please take a look in the xml, there is also a up/down include (I know the name huecolor.xml is a bit confuse), sorry for that ::)
-
Ahh. I get it. Thanks Kalle.
But then, shouldn't the payloads in action:
<action actiontype="File.Write" repeat="1" logic="False"><paramstring>{Path.VC}\huetest.bat&&{1} {3}{2}</paramstring></action>
be ordered {1} {2}{3} ?
The payload range in {3} is obviously not a big deal -- Casmo can just change that from 0 to 255 and delete the phrase "percent".
[Edit: if he wants to increase or decrease, then I guess not 0 to 255, but whatever range makes sense that is not percent-based. Increase by 10, 20, 50, 100, 150, 200 -- whatever, since 120 is approximately 50% brightness etc.]
-
Yes my fault, {1} {3}{2} is correct.
I think Casmo can use a bit python math to have the brightness in percent, that is not a big deal. ;)
-
Yes my fault, {1} {3}{2} is correct.
I think Casmo can use a bit python math to have the brightness in percent, that is not a big deal. ;)
The simplest solution for brightness would be to have your brightness range be from 0 to 25, and of course don't use the word "percent".
Then you can set the brightness parameter using: {1}0
So if you say set brightness 25 it will be set it to 250
-
by the way I found a way to do this with no batch file at all.
You just need to use launch.rawparam and run cmd.exe with the correct params.
So if you would normally use this on the command line:
hue lights 1 red
you could use launch.RawParam. For the path you use
C:\Windows\System32\cmd.exe
and for the parameter you use
/c hue lights 1 red
I have also added Scrape.Put action to the latest version of VC2 so in theory now everything can be done using the hue api directly. I don't have any way to test it though.
-
Thanks for that. Kalles command has actually been working great for lights in/off and change colour. Haven't got the scenes and dim up/down working properly yet but mainly because I havent had a lot of time to look at it, roll on the weekend.
-
" On the change scene one, its appears to be only changing the first light e.g. light 3 below
hue lights 2 blue{CR}hue lights 1 mediumturquoise{CR}hue lights 3 dodgerblue
Sounds like it is only executing the last line then "
I was mistaken above, it's actually only the first line that is being executed. Something about the carriage return it doesn't seem to like. Any ideas?
-
I have an idea. Don't use a batch file! ;D
-
Something like this should work.
You'll need version 1.9.1.9 or 1.1.9.1 for this xml to work:
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.1.9-->
<command id="189" name="hue do that voodoo that hue do so well" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Launch.RawParam</cmdType>
<params>
<param>C:\Windows\System32\cmd.exe</param>
<param>/c hue lights 2 blue</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.RawParam</cmdType>
<params>
<param>C:\Windows\System32\cmd.exe</param>
<param>/c hue lights 1 mediumturquoise</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Launch.RawParam</cmdType>
<params>
<param>C:\Windows\System32\cmd.exe</param>
<param>/c hue lights 3 dodgerblue</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>hue do that voodoo that hue do so well</phrase>
</command>
-
Cheers James,
So that's changing the the light scene perfectly (faster too) only thing is it's going to the desktop i.e minimising xbmc and throwing up 3 command windows
-
Look at the other launch actions that are available to you.
-
Launch hidden, of course.. Working really well. Thanks again
-
My "teach by teasing" technique works! ::wiggle
-
Nice.. First the wife, then you.. Can't argue with results though
-
I have been playing with the commands listed in this thread and gotten things working pretty well. I just can't shake the feeling James and/or Nim could ROCK THIS - strobes and transition times come to mind! A plug in would make my life complete.... or at least a little more fun.
Since I personally have more money than time or skill I thought I would float an option to see if anyone bites. I'd be willing to buy an extra copy of Vox to donate towards the masters getting a Hue kit (3 bulbs and a controller). Not sure if a plugin could be created but I'm sure they would find a way to make it sing.
And I know you both would love it - red alert, disco and tweak the intruder alert! Don't pretend to be too grown up to appreciate blue light! Kit is two bills...
Anyone else got a few bucks to support this?
(Alright, I want it so much I'd buy two xtra licenses... It's *that* cool).
-
Thanks very much for your offer SK. ;D
In fact, we've been thinking in general about how to fund new plugins for a while now. We created a "survey" / "form" / "voting mechanism" so that people could get together to crowd-fund new plugin development.
I had been holding off on it because I have been quite busy with the core program and the existing plugins.
But I guess this is as good a time as any so I have started a new thread over in the plugins section to announce it.
Check it out:
http://voxcommando.com/forum/index.php?topic=1620.msg14163
-
I'd also be happy to throw some shekels at getting a hue plugin developed.
Just to reiterate what sk said, you guys would LOVE philips hue. Its really is a fantastic use of vc. As there
are so many possible combinations of colours, intensities etc. you could never cover it with a remote, reaching for a tablet or phone feels clunky and manual. To be able to pick up the amulet and tell the lights what colours you want is a joy.
I haven't even scratched the surface of whats possible either, the mind boggles as to what you folks could come up with.
Its unfortunate that hue is largely seen as an overpriced gimmick, as it really is a wonderful product.
-
You nailed it Casmo. Once you have a few lights, as soon as you add the colour options; there as just too many combos to use smoothly and quickly with buttons/screen interface. With Vox it's 'I'm talking to a starship cool'... especially with a few well placed TTSs and ability to play audio files.
I've got a few zwave dimmers and blast ir with a usbuirt - the combos are getting pretty funny. With coloured lights, it's over the top ;D
I can probably pick up another kit this weekend! steal 2 bulbs outta it and donate the box, controller and 1 bulb. Now that's not the same fun/ experience as a new box and starting with only one bulb kind of blows ( I wanted more the second I had three lit up) so I'm happy to stick to my original 2 Vox license pledges.
Lol Vox licenses as an expression of currency :)
Anyway, so yeah - the crowd funding link comes at a great time (but we don't want anything to take priority over hue (think bird feeder plugin) so we gotta get James and Nim hooked pronto)
-
***Also, COLORLOOP!***
Turn All bulbs on
Set Max brightness
Enable colorloop
-
We are already working on the birdfeeder plugin anyway.
:P
-
If I am going to make the plugin then I will want to have more than one bulb anyway for proper testing of groups etc. Also if I am going to spend the time developing it I also want something cool to play with at the end of the day.
SK, can you please enter your pledge on the plugin form so that I can keep track of the totals in one spot.
Hopefully there will be other users interested in contributing in addition to the two of you. Thank you both for your generous offers, it's a very good start!
-
Colourloop is already doable. Just add cororloop as a color in your xml. So many other possibilities, tie light scenes to genres, disco lights for music, flashing lights for alerts, incredible potential...
-
Absolutely you'll 2/3 bulbs to get the full effect. Trust me though, you'll be hooked. Watching breaking bad with the whole bottom floor of the house bathed in greens and blues was a beautiful thing (though sadly that was pre my discovery of vc)
-
Donation logged. *please* tell me we are almost there! Come on people, you know you want coloured lights goodness fully integrated with Vox. If you have a hue, toss a couple bucks into the project. If you don't, pick one up now and toss a couple bucks into the project. You will make more friends, throw better parties, get promoted at work and have to beat the chicks off with a stick.
Seriously.
-
Well, we are past the 1/2 way mark for covering the cost of the hardware. It's a very good start, but I don't know how many other VC users have Hue or intend to get it.
-
We are on 2/3 ;D
So much love my Hue and VC and will take the risk :)
-
Wow. The three of you are obviously serious about this. :D
I have been looking closer at the Hue API that is available and I don't see any problems making a plugin, but it would be nice to know if anyone else other than the 3 of you wants to contribute!
I should be able to put together a basic plugin very quickly, but if there is enough interest I think we can go beyond the basics. The basics will be simple actions to set the HSB (hue, saturation, and brightness) of either a light, a groups of lights, or all lights. It will also be easy to make alerts where a light(s) will flash for a short period, or initiate a colourloop. These are basic extensions of the existing api and you can probably do it already with the command line tool, though this should be easier and might be slightly faster with a VC plugin.
Moving forward it should be possible to set up schedules (I think) and maybe do other things like "store" and "restore" current lights. So for example if you wanted to do a "red alert" when motion is detected at your back door, you could
1) Store current settings
2) Initiate red alert lights flashes for a short period
3) Restore settings back to what they were before you initiated red alert.
I am still confused about schedules and can't really tell you what will be possible there, but obviously you can always use the GgCal plugin as the scheduler and use it to initiation a lighting schedule that way.
I don't think that the Hue bridge can actually store "scenes" but we could possibly create a database of scenes within the plugin, similar to the store/restore but with naming and saving the current state and then being able to restore it by name later. This type of feature would probably come later if a plugin were made.
Anyway it looks like a nice system. A little expensive but fun. Hopefully there will be other users who are interested!
-
i'm interested. put in my vote.
-
New plugin works fantastic and performs changes really quickly. Easy to set and does everything I wanted.
So.
Very.
Happy.
Seriously, I highly recommend adding hue lights to any media setup if you have a little disposable cash. Great fun and increases show off factor big time.
Thanks again James.
(Did I mention so very happy?)
-
Thanks SK. I'm very happy to hear that you are pleased with the plugin so far.
I have some more enhancements planned. Hopefully I will get most of them into the next release of VC.
At that point I will see about making a demo, but feel free to make your own if you are so inclined. :D
-
Here's the first demo that I made last week.
-
Hi guys, i buyed my Philips Hue 1 month ago and i m lookin forward for a custom hue plugin.
I found it on the wiki, but didn't find it on the program :P
By the way, i'm using PY plugin to make it work.
Using this code
import urllib2
opener = urllib2.build_opener(urllib2.HTTPHandler)
request = urllib2.Request('http://[MY_IP]/api/[MY_API]/lights/3/state', data='{"bri": 254, "on": false,"hue": 25000, "sat": 254,"ct": 500, "bri": 254}')
request.add_header('Content-Type', 'your/contenttype')
request.get_method = lambda: 'PUT'
url = opener.open(request)
And save every command in a .py file i can call them and command them.
I hope it helps.
-
Hi nikeb, welcome to the forum.
The new Hue plugin is available in the latest VoxCommando 2.000 Release Candidate 1 release (listed as version 2 beta on the downloads page): http://voxcommando.com/downloads.asp
You should see the Hue plugin listed in the Options > Plugins tab with the other plugins if you install the newest version of VC2.
New updates to VC2 are first posted to the forum here: http://voxcommando.com/forum/index.php?topic=1443.0, so you can also look on the forum for new developments.
The Hue plugin is brand new and still in development, so we do not yet have documentation or tutorials for it yet, but you should certainly check it out.
-
Thanks nime5ter,
I'll upgrade it asap
-
Hi all,
Just curious James as to how your experimenting has been going. Anything interesting enhancements in mind?
-
Nothing too crazy at the moment and I've hit a couple of stumbling blocks, plus other realities have been getting in the way so development has been more or less halted for the last couple of days.
Mostly I am hoping to work on scenes, and maybe some UI for editing groups, although this is really not critical since it can be done through actions.
I will also have a setting so you can tweak the default delay between commands sent to the bridge. It seems that sometimes the bridge cannot keep up and some lights don't get their commands. I don't know if hue will fix this, but in the mean time adjusting the delay might help some users.
I am also adjusting the rotate lights command to let you choose which lights will be rotated. So for example if you wanted to swap two lights now, you will be able to do that. And you can adjust the order of the lights to control the rotation... I don't know how useful this will be for most people but I already use it sometimes to move a warmer light colour that I see in the dining room to the bulb near my TV.
-
One improvement that was added in the version of the plugin that was packaged in RC1 that I am happy with is within the plugin's light editor (i.e., when you click "Edit Lights" in the plugin settings).
Now I can experiment with different light settings, and when I get a light the way that I like it, drag and drop the parameter values directly into an action so that I don't have to worry about typos or not getting the details exactly right.
Plus, I can right-click /drag-and-drop light settings directly into my tree, which automatically creates a new command.
-
-
Was curious if this could work with the Milights? Its a phillips hue alternative.
-
If Milights work with Hue apps, then maybe.
Unless they have completely ripped off everything including the way the Hue bridge communicates with the outside world (the api) then it's not very likely.
-
http://www.philippinestuffs.com/milight-wifi-controlled-light-bulbs/ that is the link to most info on them.
-
These look the same as the wifiLights that mdsh is using.
http://voxcommando.com/forum/index.php?topic=1479.msg12944#msg12944
I helped mdsh put together some UDP commands so maybe you can ask him to post his final xml.
Unfortunately I don't have a copy of the xml.
-
Hi,
When is the new version mentioned in the video above available?
Thanks
-
The new Version 2.0.0.5 is available here:
http://voxcommando.com/downloads.asp
Or
http://voxcommando.com/forum/index.php?topic=1443.msg12499#msg12499 (http://voxcommando.com/forum/index.php?topic=1443.msg12499#msg12499)
-
Hi
I'm installing the newest version on a fresh windows install after a heartbreaking hard disk failure....
When trying to configure the hue plugin, I'm getting the error 'cannot find file c/vox/voxcommando'
Cannot see what the problem is....
-
It seems to be a problem with the bridge and the hue servers. I am not sure if there is a way to solve this in software but when it happened to me, unplugging my bridge for 10 seconds and then plugging it back in fixed it right up. If it happens to me again I will see if there is any other work around.
Basically the bridge stops behaving the way it is supposed to. You are supposed to be able to visit https://www.meethue.com/api/nupnp to get info about connecting to your hue, and sometimes it just stops working.
-
Thanks. I've reinstalled on my rebuilt machine now and I'm not getting the error in any case..
However, I can't seem to use the bundled hue commands (version 2.0.0.5) is there something else I need to do to enable?
Cheers
-
I don't know what you are trying to say. Something other than what?
-
Other than install 2.0.0.5 and start using them, because as I said, I can't.
-
"start using them"?
Sorry, if you can't tell me what you are actually doing, and what appears to work, and what does not appear to work, then I can't tell you if you missed a step.
If you can't take a minute to actually try to explain your situation to us, then don't even bother asking for help.
-
http://voxcommando.com/mediawiki/index.php?title=Getting_support#Other_Specific_Tips
-
I have installed version 2.0.0.5
I have installed the hue plugin
Plugin is connecting to bridge
I am issuing the commands demonstrated in the video above
The commands are not recognised by vc
-
Go to the downloads page and get version 2.0.1.0 (optional but recommended)
When you first run a new installation of VoxCommando you are prompted to select a preset configuration. Since you have been using VoxCommando for a while now, I thought you would be familiar with this. If you don't install the Hue configuration then you won't have any Hue commands in your tree, so obviously they won't work.
Select English - Hue.
Then go to the hue plugin settings and make sure you are connected.
Then on the main window menu click GenXML >> Hue
Then say "show help"
-
If you want to add hue commands to an existing configuration you can import the attached xml file into your tree.
Before doing that though, you must be sure to delete any existing hue commands that you may already have in your tree.
-
That was it. Thanks
-
If you don't know how to import an xml file containing command groups into your command tree, as always, see the wiki: http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum#Importing_XML_files
-
As well, since it seems that a number of people are downloading Jame's Hue command xml attachment above, even though they should already have access to those commands if they're using a recent version of VC2, I'll recommend that people watch the video tutorial "Using multiple configurations in VoxCommando".
http://voxcommando.com/mediawiki/index.php?title=Video_Tutorials
This may not be the last time that you will want to combine commands from different standard configurations, so it's a good idea to learn how this works.
-
WARNING: You may not want to update your Hue software if you use non-Philips bulbs with it. http://www.cnet.com/news/philips-hue-cuts-support-for-third-party-bulbs/
-
the good news is they backed down. http://www.ubergizmo.com/2015/12/philips-reverses-hue-ban-on-third-party-bulbs/ (http://www.ubergizmo.com/2015/12/philips-reverses-hue-ban-on-third-party-bulbs/)
-
Yes that is good news indeed, but I believe the "current" version of the firmware does not support the 3rd party bulbs so anyone who is using them should avoid updates until the issue is resolved.
I think it is reasonable for them to provide a list of supported 3rd party bulbs which would probably include the GE links. Users who want to use unsupported bulbs could do so "at their own risk". Not that my opinion matters. :biglaugh
-
this is pretty easy if you just use Event Ghost with Vox Commando. There is a Hue plugin for Event Ghost and the two programs work well together. This works very well for me.
-
Thanks Paul, but I would highly recommend that VoxCommando users control heir Hue lights directly using the VoxCommando Hue plugin. There is no need to add an extra level of complexity by brining EventGhost into the mix. At least none that I know of.
-
I totally agree, if you want to control just Hue this is fine. The way I read it was that they wanted to also tie in unsupported bulbs, using Hue and other Plugins in Event Ghost seems like a way to make it seem like one system.
If the issue is controlling Hue bulbs only, I agree with you. The Hue plugin does everything you would need and a single system is always less complex.
Sorry if I misread this.
-
I think you misunderstood what we were talking about. :biglaugh