Hi
I would like to toggle the state of a switch by pushing the same position again. pushing first time -> on
pushing second time -> off
…
I have the following scripted:
pushing channel 1 short -> on
pushing channel 2 short -> off
is there a simple way to query the state and feed it back with inversion as new state?
cheers
Jipp
<?php
$hg = new \Homegear\Homegear();
$hg->addEvent(
array(
"ID" => "Felix, Decke on",
"TYPE" => 0,
"ENABLED" => true,
"PEERID" => 11,
"PEERCHANNEL" => 1,
"VARIABLE" => "PRESS_SHORT",
"TRIGGER" => 8,
"TRIGGERVALUE" => true,
"EVENTMETHOD" => "setValue",
"EVENTMETHODPARAMS" => Array(12, 1, "STATE", true)
)
);
$hg->addEvent(
array(
"ID" => "Felix, Decke off",
"TYPE" => 0,
"ENABLED" => true,
"PEERID" => 11,
"PEERCHANNEL" => 2,
"VARIABLE" => "PRESS_SHORT",
"TRIGGER" => 8,
"TRIGGERVALUE" => true,
"EVENTMETHOD" => "setValue",
"EVENTMETHODPARAMS" => Array(12, 1, "STATE", false)
)
);