</component>
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/scripts/nightmode.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/.idea/dataSources.local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.local.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/homeassistant_device_event.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/homeassistant_device_event.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/denon.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/denon.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/lib/ecomode.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/ecomode.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/homeassistant.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/homeassistant.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<workItem from="1691844371156" duration="3221000" />
<workItem from="1691860551613" duration="3280000" />
<workItem from="1693125228572" duration="375000" />
- <workItem from="1693126142732" duration="1825000" />
+ <workItem from="1693126142732" duration="2307000" />
+ <workItem from="1693131490373" duration="572000" />
+ <workItem from="1693134195261" duration="602000" />
+ <workItem from="1693209704251" duration="1417000" />
+ <workItem from="1693322814662" duration="2000" />
+ <workItem from="1693464071297" duration="1013000" />
</task>
<task id="LOCAL-00502" summary=".">
<created>1641726946298</created>
<option name="project" value="LOCAL" />
<updated>1687259667913</updated>
</task>
- <option name="localTasksCounter" value="590" />
+ <option name="localTasksCounter" value="591" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
switch ($_GET['id']) {
+ case HA_SALON_PROJ_SENSOR:
+ $action = 'projSensor';
+ $forceConfig = 'salon';
case HA_SWITCH_WC:
$action = 'wcSwitch';
$forceConfig = 'wc';
$action();
+function projSensor()
+{
+ if ($_GET['state'] === 'off') {
+ epson(false, true);
+ }
+}
+
function getCubeFace($id = null)
{
if (null === $id) {
function epson($on = true, $force = false)
{
profile('Epson ' . $on);
+ if (haGetState(HA_SALON_PROJ_SENSOR) === 'off') {
+ $on = false;
+ }
$currentState = getState('EpsonPowerState', '0') === '1';
if (!$force && $currentState === $on) {
function nightmode($mode)
{
setState('night', (!!$mode) ? '1' : '0');
+ haAction('input_boolean.nightmode', (!!$mode) ? 'turn_on' : 'turn_off');
}
function getNightMode($device = null)
const HA_OFFICE_MAIN_SCREEN = 'switch.0xa4c138787633f01d';
const HA_OFFICE_PLANE_SCREENS = 'switch.0xa4c138ba535d2cc5';
+const HA_SALON_PROJ_SENSOR='binary_sensor.0x00158d00094363cc_contact';
+
function haGetState($id, $attribute = null) { //ID to read - for example sensor.foo
['type' => 'ha', 'device' => HA_OFFICE_SCREEN, 'command' => 'open_cover'],
],
'bureau/rideaux/close' => [
- ['type' => 'ha', 'device' => HA_OFFICE_CURTAIN, 'command' => 'close_cover'],
+ ['type' => 'function', 'function' => 'bureauRideau', 'args' => ['close_cover']],
+
],
'bureau/rideaux/open' => [
- ['type' => 'ha', 'device' => HA_OFFICE_CURTAIN, 'command' => 'open_cover'],
+ ['type' => 'function', 'function' => 'bureauRideau', 'args' => ['open_cover']],
+
],
'bureau/rideaux/toggle' => [
- ['type' => 'ha', 'device' => HA_OFFICE_CURTAIN, 'command' => 'toggle'],
+ ['type' => 'function', 'function' => 'bureauRideau', 'args' => ['toggle']],
],
'insteon/off' => [
// ['type' => 'insteon', 'command' => '0?135=I=0=0'],
}
}
+function bureauRideau($cmd)
+{
+ if (haGetState('binary_sensor.0x00124b002933744d_contact') == 'on') {
+ return;
+ }
+ haAction(HA_OFFICE_CURTAIN, $cmd);
+}
+
function execScene($name, $fromUserAction = false, $transitionTime = null)
{
global $scenes;