How to control Z-wave devices and run Vera scenes from command line - User guide

I’ve written a user guide on my blog here, which outlines how to turn Z-wave devices on and off and also how to run Vera scenes from the Windows PC command line. I wanted to do this so I could program my Logitech Harmony universal remote control to be able to run stuff in Vera via my Windows 7 Home Theatre PC. ;D

UPDATE:

for XBMC OpenElec (Linux)

very useful. Thanks. would be a good idea to link to it from the MCV wiki.

Thanks so much for this! I’ve just been playing with it, what an awesome idea.

Just wanted to say that on the blog you haven’t put the execution code between quotation marks so when you run the script it fails :stuck_out_tongue: e.g.

wget --delete-after [size=18pt]"[/size]http://10.10.1.252:3480/data_request?id=lu_action&output_format=xml&DeviceNum=45&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1[size=18pt][b]"[/b][/size]

Other than that, the writeup is really good so thanks very much for that! :slight_smile:

PS I’ll also add that the CMD window will pop up when running the scripts so in order to stop that happenning, preface the script with:

START /B CMD /C CALL "test.cmd" [args [...]] >NUL 2>&1

…and that will make it run silently in the background :slight_smile: Obviously replace the test.cmd with the name of your script but remember to leave the quotation marks in place! e.g.:

START /B CMD /C CALL "c:\vera scripts\turn lights on.cmd" [args [...]] >NUL 2>&1

You need the prefacing script to run from whatever will activiate the script, in this case I simply type that into the run box on windows and it works in the background with no pop up box. If however, you’re running it as a scheduled script, you’ll need to enter that into the task scheduler, same goes with autokey. Hope that helps!

[quote=“Latz, post:3, topic:172905”]Thanks so much for this! I’ve just been playing with it, what an awesome idea.

Just wanted to say that on the blog you haven’t put the execution code between quotation marks so when you run the script it fails :stuck_out_tongue: e.g.

wget --delete-after [size=18pt]"[/size]http://10.10.1.252:3480/data_request?id=lu_action&output_format=xml&DeviceNum=45&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1[size=18pt][b]"[/b][/size][/quote]

Well spotted! I’ve updated the post and added in the quotations…

With regard to suppressing the command boxes from popping up on the screen, I don’t think I mention this in the blog post? However I have a file called Run-CMD.vbs

The code in the .VBS file is:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

Then in the AutoHotKey script I call the cmd files like this:

^!A:: IfWinExist Untitled - Left Lamp On WinActivate else Run C:\Lights\Run-CMD.vbs C:\Lights\Lounge-On-Left.cmd return

This suppresses the Command windows from being visible on the HTPC etc.

Overall this is a great way to turn a standard universal remote control like my Logitech Harmony’s in to remotes that can control Z-wave devices via Vera, assuming you are sat in front of your Windows HTPC and its turned on!

You can also see the same post on my other blog here on The Digital Lifestyle.

With regard to suppressing the command boxes from popping up on the screen, I don’t think I mention this in the blog post? However I have a file called Run-CMD.vbs

The code in the .VBS file is:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

Then in the AutoHotKey script I call the cmd files like this:

^!A:: IfWinExist Untitled - Left Lamp On WinActivate else Run C:\Lights\Run-CMD.vbs C:\Lights\Lounge-On-Left.cmd return

This suppresses the Command windows from being visible on the HTPC etc.

Overall this is a great way to turn a standard universal remote control like my Logitech Harmony’s in to remote that can control Z-wave devices via Vera.

You can also see the same post on my other blog here on The Digital Lifestyle.[/quote]

Apologies, I didn’t mean to give the impression this was incorrect in the blog, I meant it as a side note :slight_smile:

But what a good idea with the VBS script! Makes more sense. I’ll give that a go.

I had the same problem you did, a Logitech Harmony One that is essentially becoming more and more redundant as I only use it now to switch my TV and Amp on. Before, it used to do practically everything! Power the A/V on, Control the lights, control my XBMC media centre, turn the volume up and down, etc. A lot of that is now being done with Zwave and most of my media funtions are done with my Android phone.

It’s good to have a solution to revive the Harmony once again, good thinking on your part! :slight_smile:

I’m still using my Harmony remote as my main remote control for my living room AV setup. I do plan to buy an IR blaster and try to integrate the AV control in to Vera / Android tablet, using something like SQ Remote, but I haven’t got that far yet, still adding Z-wave devices to my network.

I am using the Vera app Authomation however for controlling the Z-wave lights and appliance but no AV control as yet.

I’m not using XBMC either yet, still on MCE and using My Movies with their tablet app.
Would like to migrate to XBMC eventually but as I have mControl in Media Center I’ve stuck with it. I have not found a UI like mControl for XBMC ? Are there any Home Automation add-ins for XBMC?

I’ve been looking at OpenRemote this evening actually, after watching this guys cool setup. Not sure if OpenRemote works with Vera properly yet?

cw-kid you’re bad for my wallet! ;D Now I’ve seen OpenRemote, I need to buy myself an iPad or Android tablet lol. I can defo see the Harmony One being used even less now! Will need to check on the Vera compatibility but I’m sure we could get it to work even if it goes through several hoops to send the command!

There are some home automation add-ins for XBMC, I was specifically looking for Vera add-ins. Someone had started to develop one but then it came to a steady demise and I’m unclear as to what stage it was at. I’m new to HA so I’m afraid I don’t know all that much about mControl nor it’s add-ins. XBMC uses Python based scripting FYI. If you’re good with that then I’m sure it won’t be a problem. I’m not :frowning:

I’ll look into OpenRemote a bit more, I’m very intrigued…

I can’t see any direct interaction with the Vera BUT I did notice this thread:

http://www.openremote.org/display/forums/Micasaverde's+Vera±+Polling+interval

It appears they are doing the same thing you thought up and controlling the devices via HTTP and wget. Let me know your thoughts?

There is a page here about OpenRemote’s native Z-wave support. However it only works if you have an Aeon Labs Z-stick and it has to be the primary controller. If they make the Z-stick work as a secondary controller and be able to join an existing network i.e. Vera, I would have to buy another Z-stick as I sold mine when I made Vera the primary. But OpenRemote looks well nice!

mControl site here, is a PC based Home Automation system, I was using this before I bought VeraLite. VeraLite is now the primary Z-wave controller and mControl just communicates with Vera via HTTP requests, using their Vera Luup driver. I wrote about this integration here. But as mControl has a great add-in for Windows Media Center I kept it.

[quote=“Latz, post:9, topic:172905”]I can’t see any direct interaction with the Vera BUT I did notice this thread:

[url=http://www.openremote.org/display/forums/Micasaverde%27s+Vera±+Polling+interval]http://www.openremote.org/display/forums/Micasaverde's+Vera+-+Polling+interval[/url]

It appears they are doing the same thing you thought up and controlling the devices via HTTP and wget. Let me know your thoughts?[/quote]

I did see that thread early, it looks like you can then have basic control over Vera, by sending HTTP requests from OpenRemote to Vera. However I doubt you would have device status feedback in OpenRemote as is, so you wouldn’t be able to see if your lights were on or off etc. If they - Open Remote come up with a proper solution for Vera or get the Z-stick working as a secondary controller, I would look at it again then.

I recently bought my “wife” an Android 10" Samsung Galaxy tab 2 and we are currently using the Authomation app for controlling the Z-wave lights and appliances and viewing IP cameras etc.

I also just bought a very cheap 7" Android tab (Ainol Novo7 Crystal) for my daughter, was about 80 GBP but is Jelly Bean and has the Google Play store and for the money its decent enough!

I am stuck with my old iPod Touch and using the VeraMobile app which is OK but not great. I wish Authomation was available for iOS. Think I need to buy myself a Google Nexus 7 ! ;D

Think I need to buy myself a Google Nexus 7 ! ;D

Christmas is almost upon us :wink: Plenty of time for the misses and your lovely daughter to buy you a present in return for your generosity ;D

[quote=“Latz, post:13, topic:172905”]

Think I need to buy myself a Google Nexus 7 ! ;D

Christmas is almost upon us :wink: Plenty of time for the misses and your lovely daughter to buy you a present in return for your generosity ;D[/quote]

Poor old Dad is always the last in the line, if I get some new shoes I will be lucky LOL.

LOL ain’t that the truth!

[quote=“cw-kid, post:14, topic:172905”][quote=“Latz, post:13, topic:172905”]

Think I need to buy myself a Google Nexus 7 ! ;D

Christmas is almost upon us :wink: Plenty of time for the misses and your lovely daughter to buy you a present in return for your generosity ;D[/quote]

Poor old Dad is always the last in the line, if I get some new shoes I will be lucky LOL.[/quote]

@cw-kid hey I’ve been playing with OpenRemote a decent bit and got it to control my lights and XBMC quite comfortably, did you want to do a write-up? If so let me know, I’d be happy to help with the content. I only ask because I am seeing a lot of questions on various forums about lighting and media control.

Sounds good! Unfortunately I am very short on time at the moment with other projects. If you would like to write something up I’d be happy to post it on my blogs and put your name at the top of the article !

Hopefully I can get round to looking at open remote at some point?

Cheers

Same here unfortunately but I’ll start putting something together, perhaps you could critique it and let me know where I need to emphasise more to make it blog-able ?

Sure no problem at all :slight_smile:

I run a MythTV installation on a Kubuntu 12.04 base install and am very interested in the command line interaction with OpenRemote. I’m planning on setting up a virtual machine to run OpenRemote on the server/primary front-end,…

My Vera’s a Vera 1 running UI2,… Up until recently, I had no motivation to upgrade it,… But that may change.

Let me know what/where you’ve created any documentation. … & thanks…