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.
Sending command to raspberry
Re: Sending command to raspberry
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.
Thanks.
Re: Sending command to raspberry
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:
Within OpenRemote I made a command that remotely sends usingApp OpenRemoteHelper
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
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)
Code: Select all
http://quadras:8083/OpenRemote/ThermostatSetMode/15/1
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
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?
I want the raspberry to execute a script/command when I press a button via zwave. Is this possible?
Re: Sending command to raspberry
I tried to guess what you meant 
Do you mean press a button on a physical Z-Wave device such as a switch?

Do you mean press a button on a physical Z-Wave device such as a switch?
Re: Sending command to raspberry
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
With App Load custom JavaScript code you can make a virtual device that will send your command:
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.
Code: Select all
system("sudo aircontrol -t blends_up")
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.
Since 29-12-2016 I am no longer a moderator for this forum
Re: Sending command to raspberry
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.
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
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
PS: Developers documentation can be found in the righthand column of this page: http://razberry.zwave.me/index.php?id=24
Click on image below to see full configuration. Hope this helps
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
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?
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?