Hi all,
I have a problem with the new automation.
I have a shiftregister hoocked up to my Raspberry which drive 8 relais.
by sending "python port.py init" does a init of the shiftregister
"python port.py set 1 1" set port 1 to 1
"python port.py get 1" returns 0 or 1 depending on the state of the port
I added to main.js:
try {
system("python /opt/z-way-server/automation/port.py init");
} catch(err) {
debugPrint("Failed to execute script system call: " + err);
}
This works! So I can control the shift register from the javascript code.
Now I am trying to add 8 virtual devices and bind them to execute the script without succes, like in viewtopic.php?f=3422&t=20282
on change the script should be called like this: system("python /opt/z-way-server/automation/port.py set", port, newState);
Who can help me?
Creating virtual devices in new automation
Creating virtual devices in new automation
Last edited by billyboy on 10 Apr 2014 17:57, edited 1 time in total.
Re: problems with new automation
IS there nobody who can/will help me?
-
- Posts: 14
- Joined: 06 Mar 2014 22:14
Re: problems with new automation
Could you post your whole code? I'm new to this and also playing with triggering events, but I'll help out if I can.
Re: problems with new automation
Please help me getting started.
There is not much code I added to z-wave.
in /opt/z-way-server/automation/main.js
I added:
DemoDevice = function (id, controller) {
DemoDevice.super_.call(this, id, controller);
this.deviceType = "switchBinary"; // switchBinary, switchMultilevel, probe, sensor, ...
}
inherits(SimpleSceneDevice, VirtualDevice);
DemoDevice.prototype.deviceTitle = function () {
return "myTitle"
}
DemoDevice.prototype.performCommand = function (command) {
var handled = true;
//...
return handled ? true : DemoDevice.super_.prototype.performCommand.call(this, command);
}
There is not much code I added to z-wave.
in /opt/z-way-server/automation/main.js
I added:
DemoDevice = function (id, controller) {
DemoDevice.super_.call(this, id, controller);
this.deviceType = "switchBinary"; // switchBinary, switchMultilevel, probe, sensor, ...
}
inherits(SimpleSceneDevice, VirtualDevice);
DemoDevice.prototype.deviceTitle = function () {
return "myTitle"
}
DemoDevice.prototype.performCommand = function (command) {
var handled = true;
//...
return handled ? true : DemoDevice.super_.prototype.performCommand.call(this, command);
}
Re: problems with new automation
Is there realy nobody who can help me?
Re: Creating virtual devices in new automation
So, whats' wrong with the Demo code you used? It should work. Except for missing performCommand handler.
We are doing final polishing of vDevs - now it will be easy for you to register new switchBinary vDev. Please wait a bit.
We are doing final polishing of vDevs - now it will be easy for you to register new switchBinary vDev. Please wait a bit.
Re: Creating virtual devices in new automation
Hi,
PoltoS, any idea how long I have to wait?
PoltoS, any idea how long I have to wait?
Re: Creating virtual devices in new automation
On past experience, do not expect anything complete, reliable and sufficiently well documented before the fall of this year.
Since 29-12-2016 I am no longer a moderator for this forum
Re: Creating virtual devices in new automation
That's too bad.pz1 wrote:On past experience, do not expect anything complete, reliable and sufficiently well documented before the fall of this year.
I'm following this forum quite regularly in anticipation of the new version to sink my teeth in. But nothing definitive on the horizon yet. I've read 'soon' somewhere, but that's in the eye of the beholder I guess.
Maybe I have a Razberry for sale pretty soon. Any takers?
Re: Creating virtual devices in new automation
We have updated on git the new UI. Now it is easy to do what you want. Follow the forum desciption of the new UI to see changes.
You will need to get new code from github (also documented how to do)
You will need to get new code from github (also documented how to do)