From: Vincent Vanwaelscappel Date: Sun, 9 Jul 2023 14:25:44 +0000 (+0200) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7ab166ed1f70faf465f3647be366769bd1128eea;p=tortuga-home.git . --- diff --git a/.docker/config/httpd/httpd.conf b/.docker/config/httpd/httpd.conf index 9956ab2..d559470 100644 --- a/.docker/config/httpd/httpd.conf +++ b/.docker/config/httpd/httpd.conf @@ -297,7 +297,7 @@ RemoteIPInternalProxy nginx-proxy - Require ip 127.0.0.0/8 192.168.0.0/16 172.0.0.0/8 + Require ip 127.0.0.0/8 192.168.0.0/16 172.0.0.0/8 172.27.13.0/24 diff --git a/.idea/workspace.xml b/.idea/workspace.xml index dcd9cc6..857ff84 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,11 @@ + - + + + diff --git a/scripts/homeassistant_device_event.php b/scripts/homeassistant_device_event.php index 192ef49..10bbb7c 100644 --- a/scripts/homeassistant_device_event.php +++ b/scripts/homeassistant_device_event.php @@ -7,18 +7,23 @@ if ($_GET['state'] === 'None') { } $wcswitch = 'sensor.0x0c4314fffe7ce957_action'; $cubebureau = 'sensor.0x00158d00042d7082_action'; +$switchBedroom = 'binary_sensor.switch_bedroom'; if ($_GET['id'] === $wcswitch) { $forceConfig = 'wc'; } else if ($_GET['id'] == $cubebureau) { $forceConfig = 'bureau'; +} elseif ($_GET['id'] == $switchBedroom) { + $forceConfig = 'chambre'; } require_once "import.php"; print_r($_GET); -if ($_GET['id'] === $wcswitch) { +if ($_GET['id'] === $switchBedroom) { + chambreToggle(); +} else if ($_GET['id'] === $wcswitch) { switch ($_GET['state']) { case '1_double': case '2_double': diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index df471fd..344aaf8 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -61,7 +61,7 @@ $scenes = [ ['type' => 'nightmode', 'mode' => '1'], ['type' => 'ecomode', 'mode' => '1'], ['type' => 'state', 'key' => 'chambre', 'value' => 0], - ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]], + ['type' => 'ha', 'device' => 'script.rideaux_chambre_ferme'], //['type' => 'insteon', 'command' => '0?1131=I=0=0'], ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]], ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'], @@ -95,7 +95,7 @@ $scenes = [ ['type' => 'state', 'key' => 'chambre', 'value' => 0], //['type' => 'insteon', 'command' => '0?1332=I=0=0'], // Lustre et tableau off ['type' => 'function', 'function' => 'bedbrightness', 'args' => [$bedlowscreenbrightness]], - ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]], + ['type' => 'ha', 'device' => 'script.rideaux_chambre_ferme'], ['type' => 'scene', 'scene' => 'sdb/off'], ['type' => 'scene', 'scene' => 'chambre/planetarium/on'], // Planétarium on ['type' => 'scene', 'scene' => 'chambre/deshumidificateur/off'], @@ -275,10 +275,10 @@ $scenes = [ ], 'chambre/rideaux/open' => [ - ['type' => 'function', 'function' => 'chambreRideaux'], + ['type' => 'ha', 'device' => 'script.rideaux_chambre_ouvre'], ], 'chambre/rideaux/close' => [ - ['type' => 'function', 'function' => 'chambreRideaux', 'args' => [false]], + ['type' => 'ha', 'device' => 'script.rideaux_chambre_ferme'], ], 'home/alert' => [ ['type' => 'function', 'function' => 'alert',], @@ -640,19 +640,19 @@ $scenes = [ ['type' => 'scene', 'scene' => 'bureau/auto'], ], 'bureau/screen/down' => [ - ['type' => 'domoticz', 'device' => '1', 'command' => 'Close', 'priority' => true], + ['type' => 'ha', 'device' => 'cover.office_screen', 'command' => 'close_cover'], ], 'bureau/screen/up' => [ - ['type' => 'domoticz', 'device' => '1', 'command' => 'Open', 'priority' => true], + ['type' => 'ha', 'device' => 'cover.office_screen', 'command' => 'open_cover'], ], 'bureau/rideaux/close' => [ - ['type' => 'domoticz', 'device' => '391', 'command' => 'Close', 'priority' => true], + ['type' => 'ha', 'device' => 'cover.office_curtain', 'command' => 'close_cover'], ], 'bureau/rideaux/open' => [ - ['type' => 'domoticz', 'device' => '391', 'command' => 'Open', 'priority' => true], + ['type' => 'ha', 'device' => 'cover.office_curtain', 'command' => 'open_cover'], ], 'bureau/rideaux/toggle' => [ - ['type' => 'domoticz', 'device' => '391', 'command' => 'Toggle', 'priority' => true], + ['type' => 'ha', 'device' => 'cover.office_curtain', 'command' => 'toggle'], ], 'insteon/off' => [ // ['type' => 'insteon', 'command' => '0?135=I=0=0'], @@ -911,21 +911,6 @@ function welcomeEco() { } } -function chambreRideaux($ouvre = true) { - $device = 1756; - $priority = true; - // ['type' => 'domoticz', 'device' => '1756', 'command' => 'Group Off', 'priority' => 'sync'], - if ($ouvre && getDomoticzDeviceStatus($device) === 'Off') { - return; - } - $cmd = $ouvre ? 'Group Off' : 'Group On'; - domoticzSwitch($device, $cmd, 'light', $priority); - if ($ouvre) { - usleep(1000000 * 4.7); - domoticzSwitch($device, $cmd, 'light', $priority); - } -} - function execScene($name, $fromUserAction = false, $transitionTime = null) { global $scenes; @@ -1231,10 +1216,10 @@ function updateSalonAuto() { } else { $scene = 'tamise'; } - }else{ + } else { if ($hours <= 9) { $scene = 'tamise'; - } else { + } else { $scene = 'day'; } } diff --git a/scripts/lib/weatherstation.php b/scripts/lib/weatherstation.php index b2cf6f0..bb316a8 100644 --- a/scripts/lib/weatherstation.php +++ b/scripts/lib/weatherstation.php @@ -34,8 +34,10 @@ function getWeather() { $res['wc_humidity'] = toNumber(haGetState('sensor.0x00158d00046574da_humidity'), true); $res['office_temp'] = toNumber(haGetState('sensor.meter_c7c3_temperature'), 1); $res['office_humidity'] = toNumber(haGetState('sensor.meter_c7c3_humidite'), true); - $res['cellar_humidity'] = toNumber(getDomoticzDeviceStatus(4818), true); - $res['cellar_temp'] = toNumber(getDomoticzDeviceStatus(4817), 1); + // $res['cellar_humidity'] = toNumber(getDomoticzDeviceStatus(4818), true); + // $res['cellar_temp'] = toNumber(getDomoticzDeviceStatus(4817), 1); + $res['cellar_humidity'] = 0; + $res['cellar_temp'] = 0; $res['pressure'] = round($weather['Pressure']['Metric']['Value']); $res['pressureTendency'] = $weather['PressureTendency']['Code']; $res['precipitations24'] = round($weather['PrecipitationSummary']['Past24Hours']['Metric']['Value']);