Z-Wave Switch Button

Hallo,

ich scheiter gerade an einem Button im Dashboard. Sofern der „Firbaro Wall Plug“ an ist, kann ich diesen via Script und dann durch Klick auf den Button ausschalten, aber nicht mehr an. Da passiert dann gar nichts mehr. Was mache ich falsch? :confused:

<?

$ID_Lampe = 57398; //hier ID des zu schaltenden Gerätes eintragen

if ((ZW_RequestStatus(57398 /*[Büro\Z-Wave Switch (NodeID 003)]*/))==false)
{
//case 'Lampe_an':
ZW_SwitchMode($ID_Lampe, true);
}
else
{
//case 'Lampe_aus':
ZW_SwitchMode($ID_Lampe, false);
}

?>

Hi!

Liefert der Schalter seinen Status nicht in eine Variable?

Du müsstest dann das IF auf die Variable prüfen lassen…

<?
$ID_Lampe = 57398; //hier ID des zu schaltenden Gerätes eintragen
$ID_StatusVar = 12345;  // Hier die ID der Status-Variable vom Gerät eintragen (Boolean)

if (GetValueBoolean($ID_StatusVar) === false)
{
//case 'Lampe_an':
ZW_SwitchMode($ID_Lampe, true);
}
else
{
//case 'Lampe_aus':
ZW_SwitchMode($ID_Lampe, false);
}
?> 

Grüße,
Chris

super, vielen Dank das war es auch :slight_smile:
Bin kein Programmierer, daher auch die doofen Fehler. Aber nun habe ich verstanden, woran es lag:cool:

Hello,

I am using the same script to switch on/off.

But I get a parse error when switching on/off. Unexpected $ID_StatusVar in line 7 (31454). I have tried several var id’s but they all give me the same error. I am also using an event (true/False) to trigger the button on the Fibaro Switch, but it is currently disabled, due to troubleshooting.

Any clue as to what this could be?

Script:

$ID_BuffetKast = 41048 /[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]/ //ID from device to be switched
$ID_StatusVar = 45382 /[Z-Wave Gateway\Z-Wave Switch (NodeID 004)]//[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]/ // (Boolean variable ID)

if (GetValueBoolean($ID_StatusVar) === false)
{
case ‚Switch_on‘:
ZW_SwitchMode($BuffetKast, true);
}
else
{
case ‚Switch_off‘:
ZW_SwitchMode($BuffetKast, false);
}

Hallo
You have several Errors in your Script. ( Semikolons / Slashes before case / missing „$ID_“ )
Try this :

$ID_BuffetKast = 41048; /*[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]*/ //ID from device to be switched
$ID_StatusVar  = 45382; /*[Z-Wave Gateway\Z-Wave Switch (NodeID 004)]*//*[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]*/ // (Boolean variable ID)

if (GetValueBoolean($ID_StatusVar) === false)
{
//case 'Switch_on':
ZW_SwitchMode($ID_BuffetKast, true);
}
else
{
//case 'Switch_off':
ZW_SwitchMode($ID_BuffetKast, false);
}

Hello rgrs,

try it so:

<?

$ID_BuffetKast = 41048; /[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]/ //ID from device to be switched
$ID_StatusVar = 45382; /[Z-Wave Gateway\Z-Wave Switch (NodeID 004)]//[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]/ // (Boolean variable ID)

if (GetValueBoolean($ID_StatusVar) == false)
{
// case ‚Switch_on‘:
// Wrong varName: ZW_SwitchMode($BuffetKast, true);
ZW_SwitchMode($ID_BuffetKast, true);
}
else
{
// case ‚Switch_off‘:
// Wrong varName: ZW_SwitchMode($BuffetKast, false);
ZW_SwitchMode($ID_BuffetKast, false);
}

?>

EDIT: 1007 was faster :wink:

Greetings
lueralba

Hi 1007,

I did see my typo in $ID lines, so I fixed that.

I am using you script but again, with errors it now tells me 41048 does not exist.

I got it working now. I was indeed using the wrong var ID.

Thanks for your help so far!

I still have a problem.

I can switch the z-wave switch using this code:

[i]$ID_BuffetKast = 32225; /[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]/
$ID_StatusVar = 32225; /[Benedenverdieping\Woonkamer-Zones\Eetkamer - Zone\Buffetkast]/

if (GetValueBoolean($ID_StatusVar) == false)
{
// case ‚Switch_on‘:
ZW_SwitchMode($ID_BuffetKast, true);
}
else
{
// case ‚Switch_off‘:
ZW_SwitchMode($ID_BuffetKast, false);
}[/i]

As you can see I am using the same variable id for the switch and the lamp, this is the only combination I can get it to work with. Also the physical button is not working properly as well. I can switch off, but not on and the var id is not switching either.

So in short. I can switch on and off using webfront, button does not, work and the lamp var (boolean) does not change to on (always false).

I have multiple var id:
32225= the z-wave switch
45328=z-wave boolean status
41048= lamp id boolean