- lots of debugging
- beginning to add graphical stats - beginning to add device by type - added a dashboard "etage" - begining to add notification to multiple recipients in freemobile hook
This commit is contained in:
@@ -21,7 +21,7 @@ class rdc_salon_eclairage extends hook
|
||||
public function callBack($device, $param, $value)
|
||||
{
|
||||
global $indexDevices;
|
||||
logger(INFO, _("hook : rdc_salon_eclairage"), __FILE__ . ":" . __LINE__);
|
||||
logger(DEBUG, "Callback : " . $this->hookName, __FILE__ . ":" . __LINE__);
|
||||
$deviceTarget = &$indexDevices[RDC_SALON_ECLAIRAGE_PANNEAU];
|
||||
$lux = $indexDevices[RDC_SALON_LUMINOSITE];
|
||||
$mvmt = $indexDevices[RDC_SALON_MVMT];
|
||||
@@ -40,7 +40,7 @@ class rdc_salon_eclairage extends hook
|
||||
if ($illuminance <= $this->luminance_min)
|
||||
{
|
||||
logger(INFO, _("setting to ON"), __FILE__ . ":" . __LINE__);
|
||||
$this->send($deviceTarget, "ON", null, AUTO);
|
||||
$this->send($deviceTarget, "ON", false, AUTO);
|
||||
removeEvent($deviceTarget, "state", "OFF");
|
||||
}
|
||||
}else
|
||||
@@ -61,7 +61,7 @@ class rdc_salon_eclairage extends hook
|
||||
logger(INFO, _("Door is open and illumance < min"), __FILE__ . ":" . __LINE__);
|
||||
if (getValue(RDC_SALON_MVMT, "occupancy") == ON or getValue(RDC_SALON_MVMT2, "occupancy") == ON)
|
||||
{
|
||||
$this->send($deviceTarget, "ON", null, AUTO);
|
||||
$this->send($deviceTarget, "ON", false, AUTO);
|
||||
}else
|
||||
{
|
||||
$this->send($deviceTarget, "ON", "OFF", AUTO);
|
||||
@@ -82,7 +82,7 @@ class rdc_salon_eclairage extends hook
|
||||
}elseif ($value <= $this->luminance_min and (getValue(RDC_SALON_MVMT, "occupancy") == ON || getValue(RDC_SALON_MVMT2,"occupancy") == ON))
|
||||
{
|
||||
logger(INFO, _("illuminance < min and movement detected"), __FILE__ . ":" . __LINE__);
|
||||
$this->send($deviceTarget, "ON", null, AUTO);
|
||||
$this->send($deviceTarget, "ON", false, AUTO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -94,16 +94,16 @@ class rdc_salon_eclairage extends hook
|
||||
global $indexDevices;
|
||||
|
||||
$msg = array("state" => $state);
|
||||
if ($deviceTarget->properties["state"]["value"] != $state)
|
||||
{
|
||||
//if ($deviceTarget->properties["state"]["value"] != $state)
|
||||
//{
|
||||
logger(INFO, sprintf(_("publishing message: %s to %s"), json_encode($msg), $deviceTarget->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
$deviceTarget->payload = $msg;
|
||||
$deviceTarget->set();
|
||||
$deviceTarget->method = $method;
|
||||
}else
|
||||
/*}else
|
||||
{
|
||||
logger(INFO, sprintf(_("not publishing message: %s to %s, already set"), json_encode($msg), $deviceTarget->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
}
|
||||
}*/
|
||||
//echo 'delaystate = ' . var_dump($delayState);
|
||||
if ($delayState !== false) setDelay($deviceTarget, $this->delay, $this->timeUnit, "state", $delayState, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user