From ad93b145a9ca4b2e4fb48bcbde3759c8c139ab0e Mon Sep 17 00:00:00 2001 From: Vincent Date: Sat, 7 Mar 2020 08:41:53 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 33 +++++++++++++++++---------------- scripts/cron/cron.php | 12 +++++++++--- scripts/lib/scenes.php | 5 ++--- scripts/lib/weatherstation.php | 1 + style/weatherstation.css | 5 ++++- style/weatherstation.less | 6 +++++- 6 files changed, 38 insertions(+), 24 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6055e7e..0387568 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,10 +3,11 @@ - - - + + + + @@ -1218,12 +1219,12 @@ - + - + @@ -1237,12 +1238,12 @@ - + - + diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index 3f254e8..784af83 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -175,13 +175,17 @@ function cronWeather($cronmin) if (!file_exists($cache) || filemtime($cache) < $limit) { copy('http://dataservice.accuweather.com/currentconditions/v1/' . $place . '?apikey=' . $apikey . '&language=fr-FR&details=true', $cache); } + + $fp = explode("\n", trim(file_get_contents(ROOT . '/cache/flowerpower.txt'))); + $outdoortemp = $fp[2]; + $res = []; $weather = json_decode(file_get_contents($cache), true); $weather = $weather[0]; $res['temp'] = round(($weather['Temperature']['Metric']['Value']/* + getState('airtemperature')*/)); - $res['outdoor_temp'] = toNumber(getDomoticzDeviceStatus(1030), 1); - $res['outdoor_humidity'] = toNumber(getDomoticzDeviceStatus(1031), true); - $res['outdoor_pressure'] = toNumber(getDomoticzDeviceStatus(1032), true); + $res['outdoor_temp'] = toNumber($outdoortemp, 1); + $res['outdoor_humidity'] = toNumber(getDomoticzDeviceStatus(1026), true); + $res['outdoor_pressure'] = toNumber(getDomoticzDeviceStatus(1027), true); $res['backyard_temp'] = toNumber(getDomoticzDeviceStatus(1025), 1); $res['backyard_humidity'] = toNumber(getDomoticzDeviceStatus(1026), true); $res['backyard_pressure'] = toNumber(getDomoticzDeviceStatus(1027), true); @@ -191,6 +195,8 @@ function cronWeather($cronmin) $res['bedroom_humidity'] = toNumber(getDomoticzDeviceStatus(1357), true); $res['livingroom_temp'] = toNumber(getDomoticzDeviceStatus(1351), 1); $res['livingroom_humidity'] = toNumber(getDomoticzDeviceStatus(1352), true); + $res['kitchen_temp'] = toNumber(getDomoticzDeviceStatus(1030), 1); + $res['kitchen_humidity'] = toNumber(getDomoticzDeviceStatus(1031), true); $res['pressure'] = round($weather['Pressure']['Metric']['Value']); $res['pressureTendency'] = $weather['PressureTendency']['Code']; $res['precipitations24'] = round($weather['PrecipitationSummary']['Past24Hours']['Metric']['Value']); diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index d3ff371..0b8467b 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -294,10 +294,10 @@ $scenes = [ ['type' => 'hue', 'group' => $salon, 'scene' => 'Gte8sl76rzAD1wO'], ], 'salon/off' => [ - ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false, 'brightness' => 0)], + ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)], ['type' => 'insteon', 'command' => '0?133=I=0=0'], ['type' => 'function', 'function' => 'chemineeOff', 'args' => ['salon']], - ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false, 'brightness' => 0)], + ['type' => 'hue', 'group' => $salon, 'scene' => array('on' => false)], ], 'salon/cinema' => [ ['type' => 'hue', 'group' => $salon, 'scene' => 'AsU9eOyGsjEyz35'], @@ -553,7 +553,6 @@ $scenes = [ ['type' => 'domoticz', 'device' => '1439', 'command' => false, 'priority' => true], ], 'ecomode/basic' => [ - ['type' => 'scene', 'scene' => 'salon/freebox/off'], ['type' => 'scene', 'scene' => 'sdb/ampli/off'], ['type' => 'scene', 'scene' => 'chambre/raspberry/off'], ['type' => 'domoticz', 'device' => '1', 'switchtype' => 'scene', 'command' => false], diff --git a/scripts/lib/weatherstation.php b/scripts/lib/weatherstation.php index 79fe585..4a5b513 100644 --- a/scripts/lib/weatherstation.php +++ b/scripts/lib/weatherstation.php @@ -24,6 +24,7 @@ function weatherStationScreenSaver() $res .= ''; $res .= ''; $res .= ''; + $res .= ''; $res .= ''; $res .= ''; $res .= '
' . $weather['backyard_temp'] . ' °C' . $weather['backyard_humidity'] . '%
' . $weather['livingroom_temp'] . ' °C' . $weather['livingroom_humidity'] . '%
' . $weather['kitchen_temp'] . ' °C' . $weather['kitchen_humidity'] . '%
' . $weather['bedroom_temp'] . ' °C' . $weather['bedroom_humidity'] . '%
' . $weather['bathroom_temp'] . ' °C' . $weather['bathroom_humidity'] . '%
'; diff --git a/style/weatherstation.css b/style/weatherstation.css index 1aa54c9..0a4409c 100644 --- a/style/weatherstation.css +++ b/style/weatherstation.css @@ -60,7 +60,7 @@ } #weatherstation .current .temps { position: relative; - margin-top: 20px; + margin-top: -10px; } #weatherstation .current .temps > div { display: inline-block; @@ -308,6 +308,9 @@ #weatherstation .house .bathroom { color: #4c9bd2; } +#weatherstation .house .kitchen { + color: #ccc; +} #weatherstation .house td { vertical-align: bottom; text-align: left; diff --git a/style/weatherstation.less b/style/weatherstation.less index 9a816b1..eb68907 100644 --- a/style/weatherstation.less +++ b/style/weatherstation.less @@ -68,7 +68,7 @@ .temps { position: relative; - margin-top: 20px; + margin-top: -10px; > div { display: inline-block; @@ -235,6 +235,10 @@ color: #4c9bd2; } + .kitchen { + color: #ccc; + } + td { vertical-align: bottom; text-align: left; -- 2.39.5