Page 1 of 2

Creating virtual devices in new automation

Posted: 02 Apr 2014 14:02
by billyboy
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?

Re: problems with new automation

Posted: 04 Apr 2014 10:36
by billyboy
IS there nobody who can/will help me?

Re: problems with new automation

Posted: 04 Apr 2014 14:26
by StatikPulse
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

Posted: 06 Apr 2014 18:03
by billyboy
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);
}

Re: problems with new automation

Posted: 08 Apr 2014 21:35
by billyboy
Is there realy nobody who can help me?

Re: Creating virtual devices in new automation

Posted: 15 Apr 2014 01:34
by PoltoS
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.

Re: Creating virtual devices in new automation

Posted: 30 Apr 2014 13:02
by billyboy
Hi,

PoltoS, any idea how long I have to wait?

Re: Creating virtual devices in new automation

Posted: 30 Apr 2014 15:23
by pz1
On past experience, do not expect anything complete, reliable and sufficiently well documented before the fall of this year.

Re: Creating virtual devices in new automation

Posted: 30 Apr 2014 23:11
by OnnoH
pz1 wrote:On past experience, do not expect anything complete, reliable and sufficiently well documented before the fall of this year.
That's too bad.

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

Posted: 01 May 2014 02:44
by PoltoS
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)