run scenes via SSH

I have no clue about programming and Linux, but I have figured out how to remotely SSH into my VERA2 with WinSCP and get to the directory list and open a command window. I which folder are scenes and how do I execute them via the terminal window?

Scenes are not stored as executable scripts that you can call from the command line, as they are stored in the database that the LUUP engine accesses and controls.

What are you trying to accomplish?

For reason I haven’t been able to figure (despite help from SUPPORT) my VERA2 becomes unresponsive from time to time and I cannot connect to it via Internet. But SSH always works. So I thought I could run scenes, etc., via the command shell in Win SCP …

You can try invoking scenes directly via HTTP http://VERA_IP:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=SCENE_NUM&DeviceNum=0

Change VERA_IP and SCENE_NUM as appropriate.

To do it from the Vera command line, you can use wget: wget "http://VERA_IP:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=SCENE_NUM&DeviceNum=0"

Of course, if you are running these commands on the Vera, VERA_IP is 127.0.0.1.

Thanks for trying to help, but this may be out of my league …

I had problems accessing my VERA over the Internet right from the beginning. First I thought it was the router, but later discovered that it must be a VERA problem because I could connect to everything else attached to this router. Then I thought it must be the MIOS servers, as I always got a server busy error msg. After I put VERA into DMZ to bypass the MIOS servers it worked fine for the last couple of weeks, but not anymore.

Now I can still SSH into VERA. I tried to enter the HTTP line you suggested into the SSH terminal window, but that didn’t work. I guess there is no way to run VERA with SSH unless I know linux programming?

SUPPORT has tried to help me, but they couldn’t figure it out either …

First I thought it was the router, but later discovered that it must be a VERA problem because I could connect to [b]everything else[/b] attached to this router...

I put VERA into DMZ to bypass the MIOS servers it worked fine for the last couple of weeks, but not anymore.

Pardon me for jumping in, but it sounds like you might be trying to portforward remote access to you Vera and that you have other devices also exposed in a similar way.

Is my understanding correct? If so, how many other devices are you also forwarding, or more importantly, what ports are you forwarding? Are you forwarding ports 22 or 80 to Vera and any other device?

Which HTTP line from the command line?
If you are logged into Vera, you should have a command line such as:

root@MiOS_3000XXXX:~# 

I have a scene called “Bathroom off” which is scene # 71. To run that, I do the following:

root@MiOS_3000XXXX:~# wget "http://127.0.0.1:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&Scene

That looks like this:

root@MiOS_3000XXXX:~# wget "http://127.0.0.1:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&Scene Num=71&DeviceNum=0" Connecting to 127.0.0.1:3480 (127.0.0.1:3480) data_request?id=lu_a 100% |*******************************| 107 --:--:-- ETA root@MiOS_3000XXXX:~#

The two things I would consider doing with your Vera 2:

Ensure logging is set to external on a USB and create a swap drive. See

http://wiki.micasaverde.com/index.php/USB_swapfile_creation

[quote=“Z-Waver, post:7, topic:176568”]

First I thought it was the router, but later discovered that it must be a VERA problem because I could connect to everything else attached to this router…

I put VERA into DMZ to bypass the MIOS servers it worked fine for the last couple of weeks, but not anymore.

Pardon me for jumping in, but it sounds like you might be trying to portforward remote access to you Vera and that you have other devices also exposed in a similar way.

Is my understanding correct? If so, how many other devices are you also forwarding, or more importantly, what ports are you forwarding? Are you forwarding ports 22 or 80 to Vera and any other device?[/quote]

Portforwarding doesn’t seem to be possible for VERA, this is why I have it in DMZ. When it does work VERA requests the password before I can get on the dashboard. There is also a port for an IP camera and a Global Cache Itach forwarded - both are always accessible via the Internet.

Port forward to vera (which is a separate topic on why that’s not a good idea) requires more than just port 80.
I know at a minimum, you need port 80 and 3480. There might be others.

How many devices do you have? How many plugins an which ones?

[quote=“PurdueGuy, post:8, topic:176568”]Which HTTP line from the command line?
If you are logged into Vera, you should have a command line such as:

root@MiOS_3000XXXX:~# 

I have a scene called “Bathroom off” which is scene # 71. To run that, I do the following:

root@MiOS_3000XXXX:~# wget "http://127.0.0.1:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&Scene

That looks like this:

root@MiOS_3000XXXX:~# wget "http://127.0.0.1:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&Scene Num=71&DeviceNum=0" Connecting to 127.0.0.1:3480 (127.0.0.1:3480) data_request?id=lu_a 100% |*******************************| 107 --:--:-- ETA root@MiOS_3000XXXX:~# [/quote]

;D Got the same response as you did - now I need to figure out what device numbers/scene numbers I have. I guess this can only be done via the GUI (which I cannot access)?

[quote=“PurdueGuy, post:11, topic:176568”]Port forward to vera (which is a separate topic on why that’s not a good idea) requires more than just port 80.
I know at a minimum, you need port 80 and 3480. There might be others.

How many devices do you have? How many plugins an which ones?[/quote]

3 Fibaro shutter controls and a Horstwave Thermostat.

[quote=“Brientim, post:9, topic:176568”]The two things I would consider doing with your Vera 2:

Ensure logging is set to external on a USB and create a swap drive. See

http://wiki.micasaverde.com/index.php/USB_swapfile_creation[/quote]

Considering that I currently have only 4 devices (3 Fibaro shuttercontrols and Horstmann Thermostat), will this really help? And I won’t be able to set this up until I get there …

You can run the following:wget "http://127.0.0.1:3480/data_request?id=user_data&output_format=xml"
That will create a file called “data_request?id=user_data&output_format=xml” that will have the info you need.
You can “grep” the file for what you want.

grep "scene name" "data_request?id=user_data&output_format=xml"

NOTE: Don’t change “scene name” to be the what you are looking for…leave it as “scene name!!”

The line for my scene referenced earlier is:

<scene name="Master bath off" room="8" id="71" 

That tells me the ID is 71.

If instead you want a device ID, use:

grep "device id=" "data_request?id=user_data&output_format=xml"

and look for something like:

<device id="264" device_type="urn:schemas-upnp-org:device:DimmableLight:1" id_parent="1" embedded="0" disabled="0" device_file="D_DimmableLight1.xml" impl_file="" altid="18" ip="" mac="" time_created="1353543256" category_num="2" subcategory_num="0" room="6" manufacturer="Leviton" model="RZI06" name="Vanity">

That tells me that Vanity is device id 264.

;D This is working ;D Thank you so much PurdueGuy!!

If you are experiencing either performance degradation or your services are being affected, it is a recommended work around to provide or free additional resources, especially; Vera 2 running UI5.

If you are experiencing either performance degradation or your services are being affected, it is a recommended work around to provide or free additional resources, especially; Vera 2 running UI5.[/quote]

I am running UI4, but I will give this a shot. Are there log files I can delete with SSH to free up memory? I won’t be at the apartment for another couple of weeks …

P.S.: I also have it on a timer that power cycles it every 24 H.

Logs are usually uploaded and cleaned every so often. I forget the the duration. So this will not help you much.

  • Garrett