Page 1 of 2
Sending command to raspberry
Posted: 29 Jul 2016 11:06
by Markus96
Hello everybody!
What I want to do:
I'm using a raspberry pi and z-wave for smart control of my flat. I'm searching for an app with that I can control my blends. I already managed to control the blends with the raspberry using aircontrol. Therefore I need to type "sudo aircontrol -t blends_up" in the raspberry command line and press enter. The blends go up afterwards.
The app I'm searching for should send a "signal" to the raspberry that the raspberry should execute this (sudo aircontrol -t blends_up) command.
Let's say a remote app, and when pressing buttons on the remote, it should send "sudo aircontrol -t blends_up" to the raspberry.
I didn't find anything like that yet. Is this even possible with zwave?
I'm really looking forward for your answers and help.
Re: Sending command to raspberry
Posted: 04 Aug 2016 13:29
by Markus96
To make it a bit easier: Is it possible to execute a script when pressing a button with zwave or extesions like openremote or smth?
Thanks.
Re: Sending command to raspberry
Posted: 04 Aug 2016 14:02
by pz1
Just as an example:
In Home automation I made with App
codedDevice a
toggleButton device that switches my StellaZ in heating modus with just a little bit of javascript:
Code: Select all
zway.devices[15].ThermostatMode.Set(1)
Within OpenRemote I made a command that remotely sends usingApp
OpenRemoteHelper
Code: Select all
http://quadras:8083/OpenRemote/ThermostatSetMode/15/1
In OpenRemote designer it is easy to create a button that bind to the OR command. Within App codeDevice you can place any JS that suits you.
There are a number of other Apps (e.g. Http, XML, etc) that similarly create a virtual device for you.
See Recipes section for further pointers to interaction with openRemote
Re: Sending command to raspberry
Posted: 05 Aug 2016 12:26
by Markus96
I'm not sure if this is what I'm searching for...
I want the raspberry to execute a script/command when I press a button via zwave. Is this possible?
Re: Sending command to raspberry
Posted: 05 Aug 2016 17:28
by pz1
I tried to guess what you meant

Do you mean press a button on a physical Z-Wave device such as a switch?
Re: Sending command to raspberry
Posted: 05 Aug 2016 21:45
by Markus96
Yes - and when pressing a switch/button I want the raspberry to execute a command ("sudo aircontrol -t blends_up").
Re: Sending command to raspberry
Posted: 06 Aug 2016 11:13
by pz1
With App
Load custom JavaScript code you can make a virtual device that will send your command:
Code: Select all
system("sudo aircontrol -t blends_up")
Next in the App
If -> Then you can set the IF part "Zwave switch = on" and the THEN part to the script code.
Finally you must set permission for ZWay to excute aircontrol. Therefore enter the full path + name of that command in file /opt/z-way-server/automation/.syscommands
See the Developers manual for further detail
Update 20160808: Following PoltoS' comment on the next page I added encapsulating in "" to the command.
Re: Sending command to raspberry
Posted: 06 Aug 2016 12:18
by Markus96
Hey, thanks for your help - I really appreciate that.
But I'm still not able to do it.
The app custom JavaScript:
That means i need to create a virtual device in the .js file or what? Does this file need to start with the html tags or just the <script> tag? And can you tell me where to find the developers manual or links to pages that I need? I really have no idea. Thank you for you patience.
Re: Sending command to raspberry
Posted: 06 Aug 2016 12:52
by pz1
Sorry, I made a mistake. I should have mentioned App
Code Device instead of Load custom Javascript.
Click on image below to see full configuration. Hope this helps

- Capture.PNG (31.26 KiB) Viewed 9946 times
PS: Developers documentation can be found in the righthand column of this page:
http://razberry.zwave.me/index.php?id=24
Re: Sending command to raspberry
Posted: 06 Aug 2016 13:49
by Markus96
Thanks!
I'm not at home to see if it works now - but one more question:
I have like 20 different commands (sudo aircontrol -t blends1_up ; blends2_up ....) to controll every blend in the flat - is it possible to combine it into one "code-device" and then create 20 buttons?