<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/lib/switchbot.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/switchbot.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<workItem from="1642240002240" duration="1108000" />
<workItem from="1642761590471" duration="1992000" />
<workItem from="1642848701157" duration="3435000" />
- <workItem from="1642856038290" duration="4553000" />
- </task>
- <task id="LOCAL-00459" summary=".">
- <created>1616837743511</created>
- <option name="number" value="00459" />
- <option name="presentableId" value="LOCAL-00459" />
- <option name="project" value="LOCAL" />
- <updated>1616837743512</updated>
+ <workItem from="1642856038290" duration="5632000" />
</task>
<task id="LOCAL-00460" summary=".">
<created>1616837886170</created>
<option name="project" value="LOCAL" />
<updated>1642860905685</updated>
</task>
- <option name="localTasksCounter" value="508" />
+ <task id="LOCAL-00508" summary=".">
+ <created>1642863251325</created>
+ <option name="number" value="00508" />
+ <option name="presentableId" value="LOCAL-00508" />
+ <option name="project" value="LOCAL" />
+ <updated>1642863251325</updated>
+ </task>
+ <option name="localTasksCounter" value="509" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
['type' => 'function', 'function' => 'stopAllSqueezebox'],
['type' => 'nightmode', 'mode' => '1'],
['type' => 'ecomode', 'mode' => '1'],
+ ['type' => 'function', 'key' => 'hotwaterAutoMode', 'args' => ['1']],
],
'home/music/synchro/soiree' => [
['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine', 'Bureau', 'WC']]],
'home/off' => [
['type' => 'scene', 'scene' => 'home/hueoff'],
['type' => 'ecomode', 'mode' => '2'],
+ ['type' => 'function', 'key' => 'hotwaterAutoMode', 'args' => ['1']],
//['type' => 'scene', 'scene' => 'cuisine/off'],
['type' => 'scene', 'scene' => 'salon/off'],
['type' => 'scene', 'scene' => 'cour/off'],
['type' => 'domoticz', 'device' => '476', 'command' => false, 'priority' => true],
],
'sdb/hotwater/eco' => [
+ ['type' => 'function', 'key' => 'hotwaterAutoMode', 'args' => ['0']],
['type' => 'function', 'function' => 'hotwater', 'args' => ['1']],
],
'sdb/hotwater/max' => [
+ ['type' => 'function', 'key' => 'hotwaterAutoMode', 'args' => ['0']],
['type' => 'function', 'function' => 'hotwater', 'args' => ['2']],
],
'sdb/hotwater/off' => [
+ ['type' => 'function', 'key' => 'hotwaterAutoMode', 'args' => ['0']],
['type' => 'function', 'function' => 'hotwater', 'args' => ['0']],
],
'sdb/off' => [
['type' => 'state', 'key' => 'sdb', 'value' => 0],
+ ['type' => 'function', 'key' => 'hotwaterAutoMode', 'args' => ['1']],
['type' => 'domoticz', 'scene' => 20, 'command' => false, 'priority' => true],
['type' => 'function', 'function' => 'stopSqueezeboxPlayer', 'args' => [$squeezeboxPlayers['Salle de bains'], false]],
],
return $res;
}
+function hotwaterAutoMode($mode)
+{
+ $mode = $mode ? '1' : '0';
+ setState('hotwater_auto_mode', $mode);
+ if ($mode) {
+ hotwaterCheckMode();
+ }
+}
+
+function hotwaterCheckMode()
+{
+
+ if (getState('hotwater_auto_mode', '1') == '0') {
+ return;
+ }
+
+ if (getSqueezePlayerStatus('Salle de bains')) {
+ $hot = '2';
+ } else {
+ $ecomode = getState('ecomode', '0');
+ if ($ecomode == '0') {
+ $hot = '1';
+ } else if ($ecomode == '2') {
+ $hot = '0';
+ } else if ($ecomode == '1') {
+ $h = date('G');
+ $hot = ($h > 6 && $h < 10) ? '1' : '0';
+ }
+ }
+ hotwater($hot);
+}
+
function hotwater($newState)
{
// 0 : OFF