Page 1 of 1

Creation of module

Posted: 07 Apr 2014 22:20
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

Re: Creation of module

Posted: 15 Apr 2014 01:32
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.