directory script is now subdir of hooks and creating other directories in hooks dir
This commit is contained in:
parent
4e9aa8aeb5
commit
cac1c638b9
@ -1,2 +0,0 @@
|
|||||||
<?php
|
|
||||||
$notificationMethods["freemobile"] = new notificationMethod("https://smsapi.free-mobile.fr/sendmsg?user=32886706&pass=JTGUY6l5OG73zX&msg=");
|
|
@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
$scriptTopic = Z2M;
|
|
||||||
|
|
||||||
//callback function
|
|
||||||
$rdcPanneau = function($topic, $fn, $param, $value)
|
|
||||||
{
|
|
||||||
global $devices, $indexDevices;
|
|
||||||
$delay = 3;
|
|
||||||
$timeUnit = "min";
|
|
||||||
switch($param)
|
|
||||||
{
|
|
||||||
case "occupancy":
|
|
||||||
if ($value == 1)
|
|
||||||
{
|
|
||||||
$msg = array("state" => "ON");
|
|
||||||
$device = $devices[Z2M][$indexDevices["0x588e81fffe343e8f"]];
|
|
||||||
$device->payload = $msg;
|
|
||||||
$device->set(null);
|
|
||||||
setDelay($device, $delay, $timeUnit, "state", "OFF", true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
echo _("notification received from MQTT") . EOL;
|
|
||||||
//echo $param . "=> " . $value . EOL;
|
|
||||||
};
|
|
||||||
|
|
||||||
//assignation of the function to the sensors devices
|
|
||||||
$indexDevices["0x00124b0022ebac5c"]->functions[] = $rdcPanneau;
|
|
||||||
$indexDevices["0x588e81fffe2cf695"]->functions[] = $rdcPanneau;
|
|
||||||
$indexDevices["0x04cf8cdf3c78aff0"]->functions[] = $rdcPanneau;
|
|
||||||
|
|
||||||
?>
|
|
Loading…
Reference in New Issue
Block a user