Sending Command from Terminal

I want to be able to send a command to Vera / zwave light control to turn on our lights from the command line or terminal (mac). How do I do that?

Some background:

I recently got Vitamin D Video software installed to monitor my webcams and it currently sends notifications when a person is detected in the front yard. I would like to have it turn on the lights or do other things with the alert. They provide a box where you can enter a command like a batch file or terminal command.

http://www.vitamindinc.com/support/ref_guide_rules.html#mail

Here is all they say in their reference guide:

Run the command. (Basic and Pro Editions only). This is an advanced feature for those who can write scripts or applications, or have an existing one that does what they want. Selecting this check box allows you to enter a path name to a script or program in the adjacent field that can be triggered if the event is seen, e.g., "cmd.exe /k start C:\Users\Katie\Desktop\lights.bat." Some examples of what you can do with this feature:

[ul][li]If you have an X10 home automation controller, you can write a script to turn on a light if something is seen in the camera’s view.[/li]
[li]In general, most commands that can be executed in the Run dialog on Windows or in Terminal on OSX will work in this field.[/li]
[li]Mac owners can use this feature to easily create custom voice sounds. Type “say” and some text to have that text spoken. (For example, if you type “say you are being recorded,” then when the event is seen, your Mac will play a digitized voice saying “you are being recorded.”[/li][/ul]

Thanks.

From within your own network, the easiest ways are to use the lu_action URL-based commands as documented (loosely) here:

http://wiki.micasaverde.com/index.php/Luup_Requests#lu_action

and probably the “[tt]RunScene[/tt]” events, so you don’t have to deal with DeviceID’s and such, and can readily change “what” happens using the Vera Design UI.

To make this URL call, from the Mac, you need to use something like [tt]curl[/tt] which is built in. You can find docs/examples online everywhere.

Will this Luup request, using curl, work also for the new UI4 and Vera 2?
Is it possible to turn on and off the wireless radio in Vera with a similar command?

/M

From within the same network, the URL-based commands to Vera are the same in UI2 and UI4.

Is it possible to turn on and off the wireless radio in Vera with a similar command? /M

There’s no direct URL “hook” in Vera to turn off it’s Wifi

Thanks :slight_smile:

There's no direct URL "hook" in Vera to turn off it's Wifi

Is there any other way to do it from remote?

/M

Not that I’m aware of. Typically I turn off Wifi “once” and just leave it that way (since I run it as a wired device, and have Wifi otherwise provided/secured throughout the house)

Thanks!

/M

If you’d like to control the WiFi from another place than the web interface it looks like one can run:

# /sbin/wifi down to turn off the WiFi when logged in as root with SSH.

# /sbin/wifi up turns it back on again.
As I don’t want my WiFi running 24h I put those commands into the crontab of the Vera root.

/M

So in theory, it should be possible to set up scenes ‘Wifi_On’ and ‘Wifi_Off’ with Luup/Lua:

os.execute( '/sbin/wifi down' )

and

os.execute( '/sbin/wifi up' )

Then activate these scenes via HTTP (or Vera’s GUI):

http://<Vera_IP_adress>:49451/data_request?id=lu_action&output_format=xml&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=<SceneNum>

Thanks for the hint!
/M

Just would like to confirm that it seems to work as described by Ap15e above :slight_smile:

/M