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?
<?
$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);
}
?>
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);
}
?>
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);
}
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