- added values in celsius degree and in km/h in pws2mqtt
- debug of hooks -added webserver.php
This commit is contained in:
@@ -11,7 +11,7 @@ class rdc_salon_eclairage extends hook
|
||||
RDC_SALON_LUMINOSITE => array("illuminance_lux", false)
|
||||
);
|
||||
|
||||
public $delay = 5; // amount of time in $timeunit
|
||||
public $delay = 3; // amount of time in $timeunit
|
||||
public $timeUnit = "minute"; // unit of time for delay, second, minute, hour, day, week, month, year
|
||||
public $luminance_min = 60;
|
||||
public $luminance_max = 3000;
|
||||
@@ -28,19 +28,29 @@ class rdc_salon_eclairage extends hook
|
||||
//print_r($indexDevices[RDC_SALON_LUMINOSITE]);
|
||||
if ($value == ON and $indexDevices[RDC_SALON_LUMINOSITE]->illuminance_lux["value"] <= $this->luminance_min)
|
||||
{
|
||||
$this->send("ON", "OFF", AUTO);
|
||||
$this->send("ON", null, AUTO);
|
||||
removeEvent($indexDevices[RDC_SALON_ECLAIRAGE_PANNEAU], "state", "OFF");
|
||||
}
|
||||
if ($value == OFF)
|
||||
{
|
||||
if ($indexDevices(RDC_SALON_MVMT)->occupancy == OFF and $indexDevices(RDC_SALON_MVMT2)->occupancy == OFF)
|
||||
{
|
||||
setDelay($indexDevices[RDC_SALON_ECLAIRAGE_PANNEAU], $this->delay, $this->timeUnit, "state", "OFF", true);
|
||||
//$this->send("ON", "OFF", AUTO);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "contact":
|
||||
if ($value == false and $indexDevices[RDC_SALON_LUMINOSITE]->illuminance_lux["value"] <= $this->luminance_min)
|
||||
{
|
||||
$this->send("ON", "OFF", AUTO);
|
||||
//$this->send("ON", "OFF", AUTO);
|
||||
}
|
||||
break;
|
||||
case "illuminance_lux":
|
||||
if ($value >= $this->luminance_max)
|
||||
{
|
||||
$this->send("OFF");
|
||||
//$this->send("OFF", null, AUTO);
|
||||
removeEvent($indexDevices[RDC_SALON_ECLAIRAGE_PANNEAU], "state", "OFF");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user