Creation of module

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
pacaj2am
Posts: 28
Joined: 18 Mar 2013 22:48

Creation of module

Post by pacaj2am »

Hello,

i would like to create module out of this code:

Code: Select all

zway.devices[12].instances[2].SwitchBinary.data.level.bind( function() {
    var status = zway.devices[12].SwitchBinary.data.level.value;
    debugPrint("============================= Spinac 12 ve stavu: " + status);

    if(status == 255)
        zway.devices[12].SwitchBinary.Set(0);

    else
        zway.devices[12].SwitchBinary.Set(255);

});
how can i start?

Thank you
(I have figaro FGS211 switch with two switches - now i cen use them independently - like stairs switch).

Jan
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Creation of module

Post by PoltoS »

You can use this code in CustomCode module (I mean as settings of CustomCode). But you can also use a module: use Bind to bind your two vDevs together.
Post Reply