From: vincent Date: Sun, 13 Feb 2022 11:06:42 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=24cfecbe09d91eb3001049c06de3c63eb881b80c;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b645bf3..fbd6b70 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,11 @@ - + + + + + diff --git a/config/rooms.php b/config/rooms.php index 6667d54..ddfea6a 100644 --- a/config/rooms.php +++ b/config/rooms.php @@ -60,6 +60,7 @@ function salon() $favorites = [ ['type' => 'light', 'scene' => 'salon/on', 'label' => 'Allumer'], ['type' => 'light', 'scene' => 'salon/off', 'label' => 'éteindre'], + ['type' => 'light', 'scene' => 'salon/lumineux', 'label' => 'lumineux'], ['type' => 'light', 'scene' => 'salon/cinema', 'label' => 'cinéma'], ['type' => 'light', 'scene' => 'salon/cineclub', 'label' => 'cinéma de minuit'], ['type' => 'light', 'scene' => 'salon/tamise', 'label' => 'Tamisé'], diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index aef371b..586860d 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -237,13 +237,14 @@ function cronWeather($cronmin) $res['outdoor_temp'] = toNumber(getDomoticzDeviceStatus(1467), 1); $res['outdoor_humidity'] = toNumber(getDomoticzDeviceStatus(1026), true); $res['outdoor_pressure'] = toNumber(getDomoticzDeviceStatus(1027), true); - $res['backyard_temp'] = toNumber(getDomoticzDeviceStatus(6840), 1); - $res['backyard_humidity'] = toNumber(getDomoticzDeviceStatus(6841), true); - $res['backyard_pressure'] = toNumber(getDomoticzDeviceStatus(6842), true); + $res['backyard_temp'] = toNumber(getDomoticzDeviceStatus(1354), 1); + $res['backyard_humidity'] = toNumber(getDomoticzDeviceStatus(1357), true); + $res['backyard_pressure'] = toNumber(getDomoticzDeviceStatus(1358), true); $res['bathroom_temp'] = toNumber(getDomoticzDeviceStatus(1346), 1); $res['bathroom_humidity'] = toNumber(getDomoticzDeviceStatus(1347), true); - $res['bedroom_temp'] = toNumber(getDomoticzDeviceStatus(1356), 1); - $res['bedroom_humidity'] = toNumber(getDomoticzDeviceStatus(1357), true); + $res['bedroom_temp'] = toNumber(getDomoticzDeviceStatus(6851), 1); + $res['bedroom_humidity'] = toNumber(getDomoticzDeviceStatus(6852), true); + $res['bedroom_airquality'] = toNumber(getDomoticzDeviceStatus(6853), true); $res['livingroom_temp'] = toNumber(getDomoticzDeviceStatus(6453), 1); $res['livingroom_humidity'] = toNumber(getDomoticzDeviceStatus(6454), true); $res['kitchen_temp'] = toNumber(getDomoticzDeviceStatus(1506), 1); diff --git a/scripts/lib/domoticz.php b/scripts/lib/domoticz.php index 5599e52..111975c 100644 --- a/scripts/lib/domoticz.php +++ b/scripts/lib/domoticz.php @@ -64,6 +64,7 @@ function getDomoticzDeviceStatus($device, $force = false, $key = 'Data') //echo ':)'; $res = runDomoticzCommand(['type' => 'devices', 'rid' => $device]); $res = json_decode($res->getBody(), true); + try { $update = new DateTime($res['result'][0]['LastUpdate']); $now = new DateTime(); diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index ba854e4..39c2700 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -593,6 +593,8 @@ function toNumber($val, $round = false) if ($val === false) { return '--'; } + $e = explode(',', $val); + $val = $e[0]; $val = preg_replace('/[^0-9-.]/', '', $val); $val = floatval($val); if ($round) { diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index ad8439c..8b29ed2 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -355,6 +355,13 @@ $scenes = [ ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1], ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1], ], + 'salon/lumineux' => [ + ['type' => 'domoticz', 'scene' => 51, 'command' => true, 'priority' => true], + ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO', 'repeat' => 2], + ['type' => 'state', 'key' => 'salon', 'value' => 'on'], + ['type' => 'scene', 'scene' => 'cuisine/on', 'delay' => 1], + ['type' => 'scene', 'scene' => 'salon/cheminee', 'delay' => 1], + ], 'salon/off' => [ ['type' => 'domoticz', 'scene' => 45, 'command' => false, 'priority' => true], ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)],