From: Vincent Vanwaelscappel Date: Thu, 6 Jul 2023 08:13:14 +0000 (+0200) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c553bb5393048e525d4aeda2ab1267f41fdab530;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2558636..c13f405 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,6 +5,8 @@ + + diff --git a/scripts/lib/homeassistant.php b/scripts/lib/homeassistant.php index 4c33dd3..f0e2bfd 100644 --- a/scripts/lib/homeassistant.php +++ b/scripts/lib/homeassistant.php @@ -39,7 +39,10 @@ function haGetState($id, $attribute = null) { //ID to read - for example sensor. } -function haAction($id, $action = 'turn_on', $domain = null, $data = []) { +function haAction($id, $action = null, $domain = null, $data = []) { + if (null === $action) { + $action = 'turn_on'; + } $data['entity_id'] = $id; $opts = [ "http" => [ diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 1363ea6..5decac0 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -484,63 +484,63 @@ $scenes = [ 'bureau/cinema' => [ ['type' => 'scene', 'scene' => 'bureau/base/off'], ['type' => 'hue', 'group' => $bureau, 'scene' => '7mofVclWdtvpVyt'], - ['type' => 'domoticz', 'scene' => 25, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_cinema'], ], 'bureau/lumineux' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => 'SdXwtZu5PCDjK2h'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lumineux'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 26, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_lumineux'], ], 'bureau/veilleuse' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => 'ooQq4Jfbf1CleDy'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'veilleuse'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 27, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_veilleuse'], ], 'bureau/flowers' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => 'mJ-AVlYFyL5x1cN'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'flowers'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 28, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_flowers'], ], 'bureau/videogames' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => 'ooQq4Jfbf1CleDy'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'veilleuse'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/off'], - ['type' => 'domoticz', 'scene' => 29, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_videogames'], ], 'bureau/tchernobyl' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => 'KoByn2ehWHDdchu'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tchernobyl'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 30, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_tchernobyl'], ], 'bureau/outrun' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => '9TzWQt6f7-EgVtm'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'outrun'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 31, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_outrun'], ], 'bureau/boreal' => [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'boreal'], ['type' => 'hue', 'group' => $bureau, 'scene' => 'dJaWFQBb0APEgtL'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 32, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_boreal'], ], 'bureau/tropical' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => 'biXLpKpIZYDlxen'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tropical'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 33, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_tropical'], ], 'bureau/lounge' => [ @@ -548,7 +548,7 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lounge'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 34, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_lounge'], ], 'bureau/focus' => [ @@ -556,7 +556,7 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'space'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 35, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_focus'], ], 'bureau/tonic' => [ @@ -564,7 +564,7 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tonic'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 36, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_tonic'], ], 'bureau/lecture' => [ @@ -572,7 +572,7 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'lecture'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 37, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_lecture'], ], 'bureau/chillout' => [ @@ -580,7 +580,7 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'chillout'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 38, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_chillout'], ], 'bureau/tamise' => [ @@ -588,14 +588,14 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'tamise'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 39, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_tamise'], ], 'bureau/beach' => [ ['type' => 'hue', 'group' => $bureau, 'scene' => '0mPAKOl-Kw8Fwb1'], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'beach'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 40, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_beach'], ], 'bureau/jellyfish' => [ @@ -603,7 +603,7 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'jellyfish'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 41, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_jellyfish'], ], 'bureau/sharks' => [ @@ -611,11 +611,11 @@ $scenes = [ ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'sharks'], ['type' => 'scene', 'scene' => 'bureau/base/on'], ['type' => 'scene', 'scene' => 'bureau/screens/on'], - ['type' => 'domoticz', 'scene' => 41, 'command' => true, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_jellyfish'], ], 'bureau/base/off' => [ - ['type' => 'domoticz', 'scene' => 42, 'command' => false, 'priority' => true], + ['type' => 'ha', 'device' => 'scene.bureau_off'], ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]], ['type' => 'state', 'key' => 'bureau_gradient', 'value' => 'off'], ['type' => 'hue', 'group' => $bureau, 'scene' => array('on' => false)], @@ -625,12 +625,6 @@ $scenes = [ ['type' => 'scene', 'scene' => 'bureau/base/off'], ['type' => 'scene', 'scene' => 'bureau/pc/sleep'], ], - 'bureau/sound/on' => [ - ['type' => 'domoticz', 'device' => 24, 'switchtype' => 'scene', 'command' => true, 'priority' => true], - ], - 'bureau/sound/off' => [ - ['type' => 'domoticz', 'device' => 24, 'switchtype' => 'scene', 'command' => false], - ], 'bureau/media/play' => [ ['type' => 'state', 'key' => 'bureauPlaying', 'value' => '1'], ['type' => 'scene', 'scene' => 'bureau/screen/down'], @@ -638,15 +632,12 @@ $scenes = [ ['type' => 'scene', 'scene' => 'bureau/cinema'], ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]], ['type' => 'function', 'function' => 'harmonyActivity', 'args' => [HARMONY_TV]], - ['type' => 'scene', 'scene' => 'bureau/sound/on'], - ], 'bureau/media/stop' => [ ['type' => 'state', 'key' => 'bureauPlaying', 'value' => '0'], ['type' => 'scene', 'scene' => 'bureau/screen/up'], ['type' => 'scene', 'scene' => 'bureau/rideaux/open'], ['type' => 'scene', 'scene' => 'bureau/auto'], - ['type' => 'scene', 'scene' => 'bureau/sound/off'], ], 'bureau/screen/down' => [ ['type' => 'domoticz', 'device' => '1', 'command' => 'Close', 'priority' => true],