- 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:
@@ -22,6 +22,7 @@ class rdc_chambre_eclairage extends hook
|
||||
public function callBack($device, $property, $value)
|
||||
{
|
||||
global $devices, $indexDevices;
|
||||
logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__);
|
||||
$lux = $indexDevices[RDC_CHAMBRE_LUMINOSITE]->properties["illuminance_lux"];
|
||||
$targetAmbiance = $indexDevices[RDC_CHAMBRE_AMBIANCE];
|
||||
$targetEclairage = $indexDevices[RDC_CHAMBRE_ECLAIRAGE];
|
||||
@@ -32,12 +33,12 @@ class rdc_chambre_eclairage extends hook
|
||||
$this->send($targetAmbiance, "state", "ON", "OFF", AUTO);
|
||||
}elseif ($property == "contact")
|
||||
{
|
||||
if ($value == false and getValue(RDC_CHAMBRE_ECLAIRAGE, "state_l1") == "OFF")
|
||||
if ($value == false)
|
||||
{
|
||||
$this->send($targetEclairage, "state_l1", "ON", "OFF", AUTO);
|
||||
}elseif ($value == true and getValue(RDC_CHAMBRE_ECLAIRAGE, "state_l1") == "ON")
|
||||
}elseif ($value == true)
|
||||
{
|
||||
$this->send($targetEclairage, "state_l1", "OFF", null, null);
|
||||
$this->send($targetEclairage, "state_l1", "OFF", false, null);
|
||||
}
|
||||
}
|
||||
logger (INFO, sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $property, bool2string($value)), __FILE__ . ":" . __LINE__);
|
||||
@@ -47,17 +48,17 @@ class rdc_chambre_eclairage extends hook
|
||||
{
|
||||
global $indexDevices;
|
||||
$msg = array($property => $state);
|
||||
if ($deviceObject->properties[$property]["value"] != $state)
|
||||
{
|
||||
//if ($deviceObject->properties[$property]["value"] != $state)
|
||||
//{
|
||||
logger(INFO, sprintf(_("publishing message: %s to %s"), json_encode($msg), $deviceObject->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
$deviceObject->payload = $msg;
|
||||
$deviceObject->set();
|
||||
$deviceObject->method = $method;
|
||||
}else
|
||||
{
|
||||
///}else
|
||||
/*{
|
||||
logger(INFO, sprintf(_("not publishing message: %s to %s, already set"), json_encode($msg), $deviceObject->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
|
||||
}
|
||||
}*/
|
||||
//echo 'delaystate = ' . var_dump($delayState);
|
||||
if ($delayState !== false) setDelay($deviceObject, $this->delay, $this->timeUnit, "state", $delayState, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user