diff --git a/flows.json b/flows.json index 429b23b..8fcb2ef 100644 --- a/flows.json +++ b/flows.json @@ -3179,4958 +3179,6 @@ "x": 2340, "y": 720 }, - { - "id": "b70ee13eafa73823", - "type": "tab", - "label": "Living room" - }, - { - "id": "tst0000000000003", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Filter: brightness step", - "wires": [ - [ - "tst0000000000004" - ], - [ - "tst0000000000004" - ] - ], - "property": "dial_motion", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "brightness_step_up", - "vt": "str" - }, - { - "t": "eq", - "v": "brightness_step_down", - "vt": "str" - } - ], - "checkall": "false", - "repair": false, - "outputs": 2, - "x": 420, - "y": 3420 - }, - { - "id": "tst0000000000004", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Music control on?", - "wires": [ - [ - "tst0000000000005" - ], - [ - "tst0000000000009" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.livingroom_music_control", - "state_type": "str", - "blockInputOverrides": true, - "outputProperties": [], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 680, - "y": 3420 - }, - { - "id": "tst0000000000005", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Get current volume", - "wires": [ - [ - "tst0000000000006" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "playing", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "media_player.home_theater_universal", - "state_type": "str", - "blockInputOverrides": true, - "outputProperties": [ - { - "property": "entity", - "propertyType": "msg", - "value": "", - "valueType": "entity" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 940, - "y": 3380 - }, - { - "id": "tst0000000000006", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Store current volume", - "wires": [ - [ - "tst0000000000007" - ] - ], - "rules": [ - { - "t": "set", - "p": "current_volume", - "pt": "msg", - "to": "entity.attributes.volume_level", - "tot": "msg" - }, - { - "t": "delete", - "p": "entity", - "pt": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1200, - "y": 3380 - }, - { - "id": "tst0000000000007", - "type": "function", - "z": "b70ee13eafa73823", - "name": "Calculate new volume", - "wires": [ - [ - "tst0000000000008" - ] - ], - "func": "const action = msg.dial_motion;\nconst direction = action === 'brightness_step_up' ? 1 : -1;\nconst stepSize = Number(msg.dial_step_size) || 30;\nconst modifier = Math.round(stepSize / 3) / 255 * 0.2;\nconst raw = (msg.current_volume || 0) + direction * modifier;\nmsg.payload = Math.round(Math.max(0, Math.min(1, raw)) * 100) / 100;\nreturn msg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1460, - "y": 3380 - }, - { - "id": "tst0000000000008", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Set Volume", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "media_player.volume_set", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "media_player.home_theater_universal" - ], - "labelId": [], - "data": "{\"volume_level\": {{{ payload }}} }", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "volume_set", - "x": 1710, - "y": 3380 - }, - { - "id": "tst0000000000009", - "type": "function", - "z": "b70ee13eafa73823", - "name": "Calculate brightness step", - "wires": [ - [ - "tst000000000000e", - "tst000000000000a" - ] - ], - "func": "const action = msg.dial_motion;\nconst direction = action === 'brightness_step_up' ? 1 : -1;\nconst stepSize = Number(msg.dial_step_size) || 30;\nmsg.service_payload = {\n brightness_step: direction * Math.round(stepSize / 3),\n transition: 0.1\n};\nflow.set('latestServicePayload', msg.service_payload);\nreturn msg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 940, - "y": 3480 - }, - { - "id": "tst000000000000e", - "type": "debug", - "z": "b70ee13eafa73823", - "name": "Step debug", - "wires": [], - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "statusVal": "", - "statusType": "auto", - "x": 940, - "y": 3560 - }, - { - "id": "tst000000000000a", - "type": "function", - "z": "b70ee13eafa73823", - "name": "Compute & fan out brightness", - "wires": [ - [ - "tst000000000000d" - ], - [ - "dim_main_001" - ], - [ - "dim_bar_001" - ], - [ - "dim_dining_001" - ] - ], - "func": "const action = msg.dial_motion;\nconst direction = action === 'brightness_step_up' ? 1 : -1;\nconst rawStep = Number(msg.dial_step_size) || 30;\nconst step = direction * rawStep;\n\nconst lights = [\n 'light.living_room_bookshelf',\n 'light.living_room_main',\n 'light.living_room_top_of_bar',\n 'light.living_room_dining_table'\n];\n\nconst haStates = global.get('homeassistant')?.homeAssistantLatest?.states || {};\n\nconst now = Date.now();\nif (now - (flow.get('lastDial') || 0) > 10 * 60 * 1000) {\n lights.forEach(id => flow.set('brt_' + id.replace(/[^a-z0-9]/g, '_'), null));\n}\nflow.set('lastDial', now);\n\nreturn lights.map(id => {\n if (haStates[id]?.state !== 'on') return null;\n const key = 'brt_' + id.replace(/[^a-z0-9]/g, '_');\n let brt = flow.get(key);\n if (brt == null) brt = haStates[id]?.attributes?.brightness || 128;\n brt = Math.max(1, Math.min(255, brt + step));\n flow.set(key, brt);\n return { brightness: Math.round(brt) };\n});", - "outputs": 4, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1230, - "y": 3480 - }, - { - "id": "tst000000000000d", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Dim bookshelf", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_bookshelf" - ], - "labelId": [], - "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": true, - "domain": "light", - "service": "turn_on", - "x": 2240, - "y": 3480 - }, - { - "id": "dim_main_001", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Dim ceiling (main)", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_main" - ], - "labelId": [], - "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": true, - "domain": "light", - "service": "turn_on", - "x": 2240, - "y": 3540 - }, - { - "id": "dim_bar_001", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Dim top of bar", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_top_of_bar" - ], - "labelId": [], - "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": true, - "domain": "light", - "service": "turn_on", - "x": 2240, - "y": 3600 - }, - { - "id": "dim_dining_001", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Dim dining table", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_dining_table" - ], - "labelId": [], - "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": true, - "domain": "light", - "service": "turn_on", - "x": 2240, - "y": 3660 - }, - { - "id": "ecb0c97ae392b159", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "UI Scene Selector", - "wires": [], - "info": "", - "x": 130, - "y": 60 - }, - { - "id": "d3a49892623d0c67", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Livingroom Scene Selector", - "wires": [ - [ - "e3ad58f3e13ded81" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_select.livingroom_scene_selector" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 150, - "y": 100 - }, - { - "id": "f07c5e952b2f368b", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Turn on Scene", - "wires": [ - [ - "13bf72e70e9bbd73" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "scene.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "{{ entity_id }}" - ], - "labelId": [], - "data": "{\"transition\":0.5}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "scene", - "service": "turn_on", - "x": 1640, - "y": 220 - }, - { - "id": "766d258dc65a274f", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Livingroom Shift Scene Button", - "wires": [ - [ - "bfaccee76249a213" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_button.livingroom_shift_scene" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 160, - "y": 320 - }, - { - "id": "b0f2fedd2347176d", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Scene Shifter, updates UI Scene Selector", - "wires": [], - "info": "", - "x": 200, - "y": 180 - }, - { - "id": "bfaccee76249a213", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Trigger next scene in shifter", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_select.select_next", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.livingroom_scene_shifter" - ], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "input_select", - "service": "select_next", - "x": 520, - "y": 320 - }, - { - "id": "38801dbb193aaf6a", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Livingroom Scene Shifter", - "wires": [ - [ - "be4016ddfc38da17" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_select.livingroom_scene_shifter" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 150, - "y": 220 - }, - { - "id": "be4016ddfc38da17", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Update scene in selector", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_select.select_option", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.livingroom_scene_selector" - ], - "labelId": [], - "data": "{\"option\": msg.payload}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "input_select", - "service": "select_option", - "x": 510, - "y": 220 - }, - { - "id": "ec6ae14bf7d95e92", - "type": "subflow:52430f5e9f9ee267", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "ecf9fefeac6dc853" - ], - [ - "19360a877415c87d" - ], - [ - "1efe8dde3508e5c1" - ], - [ - "21f09eeec20cb3f6" - ], - [ - "b4b48cde6a2830f3" - ], - [ - "8b046197cef5a597" - ] - ], - "x": 850, - "y": 600 - }, - { - "id": "fdd0994437d3eb49", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Livingroom time-based turn on", - "wires": [ - [ - "2db649c0455c7a49" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_button.livingroom_time_based_turn_on" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "", - "forType": "num", - "forUnits": "milliseconds", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 160, - "y": 500 - }, - { - "id": "ecf9fefeac6dc853", - "type": "change", - "z": "b70ee13eafa73823", - "name": "morning - Energize", - "wires": [ - [ - "fccf425d1d70a288" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Energize", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1150, - "y": 600 - }, - { - "id": "19360a877415c87d", - "type": "change", - "z": "b70ee13eafa73823", - "name": "midday - Concentrate", - "wires": [ - [ - "fccf425d1d70a288" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Concentrate", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1160, - "y": 640 - }, - { - "id": "1efe8dde3508e5c1", - "type": "change", - "z": "b70ee13eafa73823", - "name": "late afternoon - Read", - "wires": [ - [ - "fccf425d1d70a288" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Read", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1160, - "y": 680 - }, - { - "id": "21f09eeec20cb3f6", - "type": "change", - "z": "b70ee13eafa73823", - "name": "evening - Relax", - "wires": [ - [ - "fccf425d1d70a288" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Relax", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1140, - "y": 720 - }, - { - "id": "b4b48cde6a2830f3", - "type": "change", - "z": "b70ee13eafa73823", - "name": "late evening - Rest", - "wires": [ - [ - "fccf425d1d70a288" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Rest", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1150, - "y": 760 - }, - { - "id": "8b046197cef5a597", - "type": "change", - "z": "b70ee13eafa73823", - "name": "night - Nightlight", - "wires": [ - [ - "fccf425d1d70a288" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Nightlight", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1140, - "y": 800 - }, - { - "id": "2db649c0455c7a49", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Livingroom lights on?", - "wires": [ - [ - "ce7a6033db2e3ffa", - "0836295ca0bc0df3" - ], - [ - "ec6ae14bf7d95e92" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "light.living_room", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 500, - "y": 480 - }, - { - "id": "7016650e62edb33e", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Trigger specific scene in shifter", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_select.select_option", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.livingroom_scene_shifter" - ], - "labelId": [], - "data": "{\"option\":msg.payload}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [ - { - "property": "results", - "propertyType": "msg", - "value": "", - "valueType": "results" - } - ], - "queue": "all", - "blockInputOverrides": false, - "domain": "input_select", - "service": "select_option", - "x": 2050, - "y": 680 - }, - { - "id": "7ddf806038a9a543", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Trigger next scene in shifter", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_select.select_next", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.livingroom_scene_shifter" - ], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "input_select", - "service": "select_next", - "x": 1680, - "y": 420 - }, - { - "id": "ce7a6033db2e3ffa", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Get UI scene selector state", - "wires": [ - [ - "544bbcfca2ae8966" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_select.livingroom_scene_selector", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "selector_scene", - "valueType": "str" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 800, - "y": 400 - }, - { - "id": "0836295ca0bc0df3", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Get scene shifter state", - "wires": [ - [ - "544bbcfca2ae8966" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_select.livingroom_scene_shifter", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "shifter_scene", - "valueType": "str" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 780, - "y": 440 - }, - { - "id": "544bbcfca2ae8966", - "type": "join", - "z": "b70ee13eafa73823", - "name": "Collect all items", - "wires": [ - [ - "52a8d21f9e1670bc" - ] - ], - "mode": "custom", - "build": "object", - "property": "payload", - "propertyType": "msg", - "key": "topic", - "joiner": "\\n", - "joinerType": "str", - "accumulate": false, - "timeout": "", - "count": "2", - "reduceRight": false, - "reduceExp": "", - "reduceInit": "", - "reduceInitType": "", - "reduceFixup": "", - "x": 1090, - "y": 400 - }, - { - "id": "52a8d21f9e1670bc", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Do the UI and internal scene selector (shifter) have an identical value?", - "wires": [ - [ - "7ddf806038a9a543" - ], - [ - "882484a2b843b11f" - ] - ], - "property": "payload.selector_scene", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "payload.shifter_scene", - "vt": "msg" - }, - { - "t": "else" - } - ], - "checkall": "false", - "repair": false, - "outputs": 2, - "x": 1250, - "y": 460 - }, - { - "id": "882484a2b843b11f", - "type": "change", - "z": "b70ee13eafa73823", - "name": "clear payload", - "wires": [ - [ - "ec6ae14bf7d95e92" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1630, - "y": 480 - }, - { - "id": "fccf425d1d70a288", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Scene shifter already on time-based scene?", - "wires": [ - [ - "7016650e62edb33e" - ], - [ - "efc95cdb439dfb7f" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "msg.payload", - "halt_if_type": "jsonata", - "halt_if_compare": "is_not", - "entity_id": "input_select.livingroom_scene_shifter", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 1550, - "y": 680 - }, - { - "id": "7399514dde3e0bfe", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Trigger specific scene in selector", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_select.select_option", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.livingroom_scene_selector" - ], - "labelId": [], - "data": "{\"option\":msg.payload}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [ - { - "property": "results", - "propertyType": "msg", - "value": "", - "valueType": "results" - } - ], - "queue": "all", - "blockInputOverrides": false, - "domain": "input_select", - "service": "select_option", - "x": 2050, - "y": 740 - }, - { - "id": "447435b97ace1c77", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Check setting of scene shifter and call according function, as shift will update selector, but not if it already has the correct state", - "wires": [], - "info": "", - "x": 1800, - "y": 640 - }, - { - "id": "1f9f81e7a7920976", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Only shift if value is identical between selects", - "wires": [], - "info": "In case the UI elements are already the same, then i want to trigger the next scene.\nIn case the UI elements are not the same, they should be synchonized.", - "x": 1170, - "y": 500 - }, - { - "id": "e3ad58f3e13ded81", - "type": "string", - "z": "b70ee13eafa73823", - "name": "Parse user readable text and convert to scene entity ID", - "wires": [ - [ - "dining_route_001", - "13bf72e70e9bbd73" - ] - ], - "methods": [ - { - "name": "slugify", - "params": [] - }, - { - "name": "replaceAll", - "params": [ - { - "type": "str", - "value": "-" - }, - { - "type": "str", - "value": "_" - } - ] - }, - { - "name": "prepend", - "params": [ - { - "type": "str", - "value": "scene.livingroom_" - } - ] - }, - { - "name": "append", - "params": [ - { - "type": "str", - "value": "_ha" - } - ] - } - ], - "prop": "payload", - "propout": "entity_id", - "object": "msg", - "objectout": "msg", - "x": 1520, - "y": 100 - }, - { - "id": "6a4eb8cc515c46ea", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Time-based light scenes", - "wires": [], - "info": "", - "x": 150, - "y": 460 - }, - { - "id": "38ce67093edaca48", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Hidden Scene Shifter button - only for Dev UI", - "wires": [], - "info": "", - "x": 210, - "y": 280 - }, - { - "id": "142ba7e9832fdf4c", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Turn on/off lights livingroom", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.{{ service }}", - "floorId": [], - "areaId": [ - "9fb80339d4ee49f098decfafad38ab78" - ], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "msg.payload", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "light", - "service": "{{ service }}", - "x": 1340, - "y": 1240 - }, - { - "id": "691f50e528c73024", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "On/Off check", - "wires": [ - [ - "2db649c0455c7a49" - ], - [ - "e64edc58615d79d4" - ], - [ - "2db649c0455c7a49" - ], - [ - "e64edc58615d79d4" - ] - ], - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "button_1_press_release", - "vt": "str" - }, - { - "t": "eq", - "v": "button_3_press_release", - "vt": "str" - }, - { - "t": "eq", - "v": "on_press_release", - "vt": "str" - }, - { - "t": "eq", - "v": "off_press_release", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 4, - "x": 510, - "y": 1120 - }, - { - "id": "47eeb8d0da59b457", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Brightness check - Up ", - "wires": [ - [ - "3403d228e69854ed" - ] - ], - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "brightness_step_up", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 1, - "x": 540, - "y": 1220 - }, - { - "id": "3403d228e69854ed", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness increase (smooth)", - "wires": [ - [ - "142ba7e9832fdf4c" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{\"brightness_step\":15,\"transition\":0.1}", - "tot": "json" - }, - { - "t": "set", - "p": "service", - "pt": "msg", - "to": "turn_on", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 830, - "y": 1220 - }, - { - "id": "fe9ea08e5c5eb757", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness decrease (smooth)", - "wires": [ - [ - "142ba7e9832fdf4c" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{\"brightness_step\":-15,\"transition\":0.1}", - "tot": "json" - }, - { - "t": "set", - "p": "service", - "pt": "msg", - "to": "turn_on", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 840, - "y": 1260 - }, - { - "id": "e64edc58615d79d4", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Service: turn off", - "wires": [ - [ - "a566b47735e884f7" - ] - ], - "rules": [ - { - "t": "set", - "p": "service", - "pt": "msg", - "to": "turn_off", - "tot": "str" - }, - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{\"transition\":0.5}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 800, - "y": 1140 - }, - { - "id": "da4e9761a84ee45b", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Dimmer functionality - HUE", - "wires": [], - "info": "", - "x": 550, - "y": 1180 - }, - { - "id": "5c31d80bcb840a96", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Brightness check - Down", - "wires": [ - [ - "fe9ea08e5c5eb757" - ] - ], - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "brightness_step_down", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 1, - "x": 550, - "y": 1260 - }, - { - "id": "17a110d60b7dd497", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "On hold", - "wires": [ - [ - "ecf9fefeac6dc853" - ], - [ - "21f09eeec20cb3f6" - ] - ], - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "button_1_hold", - "vt": "str" - }, - { - "t": "eq", - "v": "button_3_hold", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 780, - "y": 1000 - }, - { - "id": "3227ee1d0ce6a8e8", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Allow two default modes via switch", - "wires": [], - "info": "", - "x": 860, - "y": 1040 - }, - { - "id": "28e866353c605b91", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Hue - Living room tapdial", - "wires": [ - [ - "691f50e528c73024", - "17a110d60b7dd497", - "2de26b31165d3632", - "57a722e2ab174bc1", - "tst0000000000003" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.livingroom_tapdial_action" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - }, - { - "property": "dial_motion", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "dial_step_size", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "x": 170, - "y": 1120 - }, - { - "id": "85818d214c994abb", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Livingroom tap-dial", - "wires": [], - "info": "", - "x": 150, - "y": 1080 - }, - { - "id": "efc95cdb439dfb7f", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Scene selector already on time-based scene?", - "wires": [ - [ - "7399514dde3e0bfe" - ], - [ - "e3ad58f3e13ded81" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "msg.payload", - "halt_if_type": "jsonata", - "halt_if_compare": "is_not", - "entity_id": "input_select.livingroom_scene_selector", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 1560, - "y": 760 - }, - { - "id": "7de469ae61567be2", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "4b1badad7ce89076" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.livingroom_tapdial_action" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 240, - "y": 1820 - }, - { - "id": "4b1badad7ce89076", - "type": "debug", - "z": "b70ee13eafa73823", - "name": "debug 6", - "wires": [], - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "statusVal": "", - "statusType": "auto", - "x": 660, - "y": 1880 - }, - { - "id": "66756ac444fc22da", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "4b1badad7ce89076" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.livingroom_tapdial_action_time" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 260, - "y": 1940 - }, - { - "id": "7d4e2bdc0bcf256d", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "4b1badad7ce89076" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.livingroom_tapdial_action_type" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 260, - "y": 1900 - }, - { - "id": "ec9d9a53e6083bcb", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "4b1badad7ce89076" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.livingroom_tapdial_action_direction" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 270, - "y": 1860 - }, - { - "id": "13bf72e70e9bbd73", - "type": "debug", - "z": "b70ee13eafa73823", - "name": "debug 7", - "wires": [], - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "statusVal": "", - "statusType": "auto", - "x": 1880, - "y": 240 - }, - { - "id": "2de26b31165d3632", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Button 2 release & hold", - "wires": [ - [ - "dining_scene_toggle_001" - ], - [ - "dc98aceee1133a56" - ] - ], - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "button_2_press_release", - "vt": "str" - }, - { - "t": "eq", - "v": "button_2_hold_release", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 550, - "y": 1360 - }, - { - "id": "2b837d7d2faf1d5a", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Dining table is on?", - "wires": [ - [ - "0d22e917d1b9469d" - ], - [ - "deab274cb333a51e" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "light.living_room_dining_table", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "entity_id", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 810, - "y": 1340 - }, - { - "id": "28f2c687c20d4265", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Turn on/off lights", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.{{ service }}", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "{{ entity_id }}" - ], - "labelId": [], - "data": "msg.payload", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "light", - "service": "{{ service }}", - "x": 1340, - "y": 1380 - }, - { - "id": "0d22e917d1b9469d", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Service: turn off", - "wires": [ - [ - "28f2c687c20d4265" - ] - ], - "rules": [ - { - "t": "set", - "p": "service", - "pt": "msg", - "to": "turn_off", - "tot": "str" - }, - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{\"transition\":0.5}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1100, - "y": 1360 - }, - { - "id": "deab274cb333a51e", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Service: turn on", - "wires": [ - [ - "28f2c687c20d4265" - ] - ], - "rules": [ - { - "t": "set", - "p": "service", - "pt": "msg", - "to": "turn_on", - "tot": "str" - }, - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{\"transition\":0.5}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1100, - "y": 1400 - }, - { - "id": "dc98aceee1133a56", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Any non main light on?", - "wires": [ - [ - "0d22e917d1b9469d" - ], - [ - "deab274cb333a51e" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "light.livingroom_non_main_lights", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "entity_id", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 820, - "y": 1400 - }, - { - "id": "a566b47735e884f7", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Turn on/off lights livingroom", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.{{ service }}", - "floorId": [], - "areaId": [ - "9fb80339d4ee49f098decfafad38ab78" - ], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "msg.payload", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "light", - "service": "{{ service }}", - "x": 1340, - "y": 1160 - }, - { - "id": "b46f52f581f07d43", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Livingroom tap-dial", - "wires": [], - "info": "", - "x": 150, - "y": 2020 - }, - { - "id": "10325d851d92b3db", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Dimmer functionality testing - HUE", - "wires": [], - "info": "", - "x": 400, - "y": 2020 - }, - { - "id": "2e50d893ea29f932", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Brightness check - Up step", - "wires": [ - [ - "f7192e46a47b653a", - "4c73d1e8092387b2" - ], - [ - "f7192e46a47b653a", - "0c483b69f2455536" - ], - [ - "f7192e46a47b653a", - "0cd947d505af3e73" - ] - ], - "property": "dial_motion", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "dial_rotate_right_fast", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_right_slow", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_right_step", - "vt": "str" - } - ], - "checkall": "false", - "repair": false, - "outputs": 3, - "x": 540, - "y": 2260 - }, - { - "id": "a4ea444bb95d8993", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Brightness check - Down step", - "wires": [ - [ - "f7192e46a47b653a", - "7391f9b1cbede747" - ], - [ - "f7192e46a47b653a", - "05fd0d70d3bd26fd" - ], - [ - "f7192e46a47b653a", - "1649296f3891a37c" - ] - ], - "property": "dial_motion", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "dial_rotate_left_fast", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_left_slow", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_left_step", - "vt": "str" - } - ], - "checkall": "false", - "repair": false, - "outputs": 3, - "x": 550, - "y": 2320 - }, - { - "id": "0cd947d505af3e73", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness increase (smooth)", - "wires": [ - [ - "0470a1771bbbe584" - ] - ], - "rules": [ - { - "t": "set", - "p": "service_payload", - "pt": "msg", - "to": "{\"brightness_step\":15,\"transition\":0.1}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 910, - "y": 2280 - }, - { - "id": "1649296f3891a37c", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness decrease (smooth)", - "wires": [ - [ - "0470a1771bbbe584" - ] - ], - "rules": [ - { - "t": "set", - "p": "service_payload", - "pt": "msg", - "to": "{\"brightness_step\":-15,\"transition\":0.1}", - "tot": "json" - }, - { - "t": "set", - "p": "service", - "pt": "msg", - "to": "turn_on", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 920, - "y": 2400 - }, - { - "id": "f7192e46a47b653a", - "type": "debug", - "z": "b70ee13eafa73823", - "name": "tapdial debug", - "wires": [], - "active": false, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "statusVal": "", - "statusType": "auto", - "x": 880, - "y": 2500 - }, - { - "id": "0c483b69f2455536", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness increase (smooth)", - "wires": [ - [ - "0470a1771bbbe584" - ] - ], - "rules": [ - { - "t": "set", - "p": "service_payload", - "pt": "msg", - "to": "{\"brightness_step\":30,\"transition\":0.1}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 910, - "y": 2240 - }, - { - "id": "4c73d1e8092387b2", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness increase (smooth)", - "wires": [ - [ - "0470a1771bbbe584" - ] - ], - "rules": [ - { - "t": "set", - "p": "service_payload", - "pt": "msg", - "to": "{\"brightness_step\":50,\"transition\":0.1}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 910, - "y": 2200 - }, - { - "id": "7391f9b1cbede747", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness decrease (smooth)", - "wires": [ - [ - "0470a1771bbbe584" - ] - ], - "rules": [ - { - "t": "set", - "p": "service_payload", - "pt": "msg", - "to": "{\"brightness_step\":-50,\"transition\":0.1}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 920, - "y": 2320 - }, - { - "id": "05fd0d70d3bd26fd", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Brightness decrease (smooth)", - "wires": [ - [ - "0470a1771bbbe584" - ] - ], - "rules": [ - { - "t": "set", - "p": "service_payload", - "pt": "msg", - "to": "{\"brightness_step\":-30,\"transition\":0.1}", - "tot": "json" - }, - { - "t": "set", - "p": "service", - "pt": "msg", - "to": "turn_on", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 920, - "y": 2360 - }, - { - "id": "0470a1771bbbe584", - "type": "ha-get-entities", - "z": "b70ee13eafa73823", - "name": "Find lights that are on", - "wires": [ - [ - "a28ab05bdedd5bbd" - ] - ], - "server": "657c7463.48e1e4", - "version": 1, - "rules": [ - { - "property": "entity_id", - "logic": "includes", - "value": "light.dining_table, light.living_room_bookshelf, light.living_room_main, light.living_room_top_of_bar", - "valueType": "str" - }, - { - "property": "state", - "logic": "is", - "value": "on", - "valueType": "str" - } - ], - "outputType": "array", - "outputEmptyResults": false, - "outputLocationType": "msg", - "outputLocation": "payload", - "outputResultsCount": 1, - "x": 1300, - "y": 2300 - }, - { - "id": "dab871622d804c6b", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Dim lights that are on", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "{{ entity }}" - ], - "labelId": [], - "data": "msg.service_payload", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "light", - "service": "turn_on", - "x": 1300, - "y": 2480 - }, - { - "id": "07fd05ad8f6aaecb", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Find entity id of each light", - "wires": [ - [ - "dab871622d804c6b" - ] - ], - "rules": [ - { - "t": "set", - "p": "entity", - "pt": "msg", - "to": "payload.entity_id", - "tot": "msg" - }, - { - "t": "delete", - "p": "payload", - "pt": "msg" - }, - { - "t": "delete", - "p": "parts", - "pt": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1310, - "y": 2420 - }, - { - "id": "a28ab05bdedd5bbd", - "type": "split", - "z": "b70ee13eafa73823", - "name": "Loop through each light", - "wires": [ - [ - "07fd05ad8f6aaecb" - ] - ], - "splt": "\\n", - "spltType": "str", - "arraySplt": 1, - "arraySpltType": "len", - "stream": false, - "addname": "", - "property": "payload", - "x": 1310, - "y": 2360 - }, - { - "id": "7b987dbc853e7d20", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "TODO", - "wires": [], - "info": "- Does no longer work if lights are all off\n- Filament bulbs seem to be dimmed faster than others and turn off\n- Exclude Tetris light from this magic", - "x": 1250, - "y": 2540 - }, - { - "id": "f875e3eadcb1d94f", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Hue - Living room guest switch", - "wires": [ - [ - "691f50e528c73024" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "sensor.living_room_second_switch_action" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 190, - "y": 1360 - }, - { - "id": "57a722e2ab174bc1", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Button 4 release & hold", - "wires": [ - [ - "124ea1b2096c07ec" - ] - ], - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "button_4_hold_release", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 1, - "x": 550, - "y": 1560 - }, - { - "id": "124ea1b2096c07ec", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Toggle music mode", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "input_boolean.toggle", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_boolean.livingroom_music_control" - ], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "input_boolean", - "service": "toggle", - "x": 810, - "y": 1560 - }, - { - "id": "451542926c7b1dd2", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Music Control On", - "wires": [ - [ - "f71263e2817da390" - ], - [ - "42aaf23000066a7e" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 2, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_boolean.livingroom_music_control" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "on", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": 0, - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 140, - "y": 1660 - }, - { - "id": "317a78818934e225", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Flash lights", - "wires": [ - [ - "203f27c455479e23" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_dining_table", - "light.living_room_main" - ], - "labelId": [], - "data": "{\"brightness\":255,\"effect\":\"blink\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "light", - "service": "turn_on", - "x": 630, - "y": 1720 - }, - { - "id": "f71263e2817da390", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Flash Blue", - "wires": [ - [ - "222353ea1c063036" - ] - ], - "rules": [ - { - "t": "set", - "p": "flash_color", - "pt": "msg", - "to": "blue", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 410, - "y": 1640 - }, - { - "id": "42aaf23000066a7e", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Flash Green", - "wires": [ - [ - "222353ea1c063036" - ] - ], - "rules": [ - { - "t": "set", - "p": "flash_color", - "pt": "msg", - "to": "green", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 410, - "y": 1680 - }, - { - "id": "222353ea1c063036", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Create tmp scene", - "wires": [ - [ - "317a78818934e225" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "scene.create", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"snapshot_entities\":[\"light.living_room_dining_table\",\"light.living_room_main\"],\"scene_id\":\"music_mode_flash_livingroom\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "scene", - "service": "create", - "x": 630, - "y": 1660 - }, - { - "id": "a890dae37cb6e247", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Delete tmp scene", - "wires": [ - [ - "22a05465f41aea40" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "scene.delete", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"entity_id\":\"scene.music_mode_flash_livingroom\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "scene", - "service": "delete", - "x": 1190, - "y": 1720 - }, - { - "id": "8be5c8df48382bc5", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Go back to previous scene", - "wires": [ - [ - "a890dae37cb6e247" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "scene.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"entity_id\":\"scene.music_mode_flash_livingroom\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "scene", - "service": "turn_on", - "x": 940, - "y": 1720 - }, - { - "id": "203f27c455479e23", - "type": "delay", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "8be5c8df48382bc5" - ] - ], - "pauseType": "delay", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "allowrate": false, - "outputs": 1, - "x": 640, - "y": 1780 - }, - { - "id": "22a05465f41aea40", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Stop any effects", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_dining_table", - "light.living_room_main" - ], - "labelId": [], - "data": "{\"effect\":\"stop\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "light", - "service": "turn_on", - "x": 900, - "y": 1800 - }, - { - "id": "99ed51ceae7915cf", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Music control on?", - "wires": [ - [ - "9e1b61c654b9ee81" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.livingroom_music_control", - "state_type": "str", - "blockInputOverrides": true, - "outputProperties": [], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 190, - "y": 2120 - }, - { - "id": "179f0b0c2b86c079", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Volume check - Up step", - "wires": [ - [ - "cc8831b6182557d2" - ], - [ - "0029357f750ce03c" - ], - [ - "a3f678465cf5e81f" - ] - ], - "property": "dial_motion", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "dial_rotate_right_fast", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_right_slow", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_right_step", - "vt": "str" - } - ], - "checkall": "false", - "repair": false, - "outputs": 3, - "x": 890, - "y": 2040 - }, - { - "id": "6943ef25dc561946", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Volume check - Down step", - "wires": [ - [ - "d8d786fbf89d22e8" - ], - [ - "e6bc9026eba92ef0" - ], - [ - "c8b0a802aa7912c4" - ] - ], - "property": "dial_motion", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "dial_rotate_left_fast", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_left_slow", - "vt": "str" - }, - { - "t": "eq", - "v": "dial_rotate_left_step", - "vt": "str" - } - ], - "checkall": "false", - "repair": false, - "outputs": 3, - "x": 900, - "y": 2100 - }, - { - "id": "6260853b954dce29", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Set Volume", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "media_player.volume_set", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "media_player.home_theater_universal" - ], - "labelId": [], - "data": "{\"volume_level\": {{{ payload }}} }", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "volume_set", - "x": 1510, - "y": 2160 - }, - { - "id": "9e1b61c654b9ee81", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Get current volume", - "wires": [ - [ - "dbffbb3c2e701c5d" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "playing", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "media_player.home_theater_universal", - "state_type": "str", - "blockInputOverrides": true, - "outputProperties": [ - { - "property": "entity", - "propertyType": "msg", - "value": "", - "valueType": "entity" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 510, - "y": 2120 - }, - { - "id": "dbffbb3c2e701c5d", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Store current volume", - "wires": [ - [ - "179f0b0c2b86c079", - "6943ef25dc561946" - ] - ], - "rules": [ - { - "t": "set", - "p": "current_volume", - "pt": "msg", - "to": "entity.attributes.volume_level", - "tot": "msg" - }, - { - "t": "delete", - "p": "entity", - "pt": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 520, - "y": 2060 - }, - { - "id": "cc8831b6182557d2", - "type": "change", - "z": "b70ee13eafa73823", - "name": "0.07", - "wires": [ - [ - "3080f3a618d4368b" - ] - ], - "rules": [ - { - "t": "set", - "p": "volume_modifier", - "pt": "msg", - "to": "0.07", - "tot": "num" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1130, - "y": 1960 - }, - { - "id": "0029357f750ce03c", - "type": "change", - "z": "b70ee13eafa73823", - "name": "0.03", - "wires": [ - [ - "3080f3a618d4368b" - ] - ], - "rules": [ - { - "t": "set", - "p": "volume_modifier", - "pt": "msg", - "to": "0.03", - "tot": "num" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1130, - "y": 2000 - }, - { - "id": "a3f678465cf5e81f", - "type": "change", - "z": "b70ee13eafa73823", - "name": "0.01", - "wires": [ - [ - "3080f3a618d4368b" - ] - ], - "rules": [ - { - "t": "set", - "p": "volume_modifier", - "pt": "msg", - "to": "0.01", - "tot": "num" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1130, - "y": 2040 - }, - { - "id": "d8d786fbf89d22e8", - "type": "change", - "z": "b70ee13eafa73823", - "name": "-0.07", - "wires": [ - [ - "3080f3a618d4368b" - ] - ], - "rules": [ - { - "t": "set", - "p": "volume_modifier", - "pt": "msg", - "to": "-0.07", - "tot": "num" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1130, - "y": 2100 - }, - { - "id": "e6bc9026eba92ef0", - "type": "change", - "z": "b70ee13eafa73823", - "name": "-0.03", - "wires": [ - [ - "3080f3a618d4368b" - ] - ], - "rules": [ - { - "t": "set", - "p": "volume_modifier", - "pt": "msg", - "to": "-0.03", - "tot": "num" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1130, - "y": 2140 - }, - { - "id": "c8b0a802aa7912c4", - "type": "change", - "z": "b70ee13eafa73823", - "name": "-0.01", - "wires": [ - [ - "3080f3a618d4368b" - ] - ], - "rules": [ - { - "t": "set", - "p": "volume_modifier", - "pt": "msg", - "to": "-0.01", - "tot": "num" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1130, - "y": 2180 - }, - { - "id": "7534af436f628e33", - "type": "calculator", - "z": "b70ee13eafa73823", - "name": "Sum and ensure 2 decimals", - "wires": [ - [ - "6260853b954dce29" - ] - ], - "inputMsgField": "payload", - "outputMsgField": "payload", - "operation": "sum", - "constant": "", - "round": false, - "truncate": true, - "decimals": 0, - "decimals2": "2", - "x": 1480, - "y": 2100 - }, - { - "id": "3080f3a618d4368b", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Create summable array", - "wires": [ - [ - "7534af436f628e33" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "[ msg.current_volume, msg.volume_modifier ]", - "tot": "jsonata" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1390, - "y": 2040 - }, - { - "id": "ccdac6a5471ce5d1", - "type": "trigger-state", - "z": "b70ee13eafa73823", - "name": "Switching home theater to non heos", - "wires": [ - [ - "8b41a466c57cf276" - ], - [ - "1a1fb3664cb5cbc4" - ] - ], - "server": "657c7463.48e1e4", - "version": 5, - "inputs": 0, - "outputs": 2, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "media_player.home_theater_universal" - ], - "substring": [], - "regex": [] - }, - "debugEnabled": false, - "constraints": [ - { - "targetType": "this_entity", - "targetValue": "", - "propertyType": "property", - "propertyValue": "new_state.attributes.source", - "comparatorType": "includes", - "comparatorValueDatatype": "str", - "comparatorValue": "Media Player,PS4,VINYL" - } - ], - "customOutputs": [], - "outputInitially": false, - "stateType": "str", - "enableInput": false, - "x": 220, - "y": 2620 - }, - { - "id": "8b41a466c57cf276", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Prev source was HEOS", - "wires": [ - [ - "9bf8ce152f92cc25" - ], - [ - "d5c9055d644276d7" - ] - ], - "property": "data.old_state.attributes.source", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "HEOS Music", - "vt": "str" - }, - { - "t": "else" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 570, - "y": 2680 - }, - { - "id": "9bf8ce152f92cc25", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Prev state was playing", - "wires": [ - [ - "8ae9c55c69b0ff6c" - ], - [ - "d5c9055d644276d7" - ] - ], - "property": "data.old_state.state", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "playing", - "vt": "str" - }, - { - "t": "else" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 560, - "y": 2620 - }, - { - "id": "8ae9c55c69b0ff6c", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Pause media", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.media_pause", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "media_player.bathroom", - "media_player.bedroom", - "media_player.kitchen" - ], - "labelId": [], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": true, - "domain": "media_player", - "service": "media_pause", - "x": 1170, - "y": 2620 - }, - { - "id": "ab3f3ef4e3ab317d", - "type": "split", - "z": "b70ee13eafa73823", - "name": "Split array", - "wires": [ - [ - "3194aebd902a20ff" - ] - ], - "splt": "\\n", - "spltType": "str", - "arraySplt": 1, - "arraySpltType": "len", - "stream": false, - "addname": "", - "property": "payload", - "x": 1180, - "y": 2680 - }, - { - "id": "d5c9055d644276d7", - "type": "change", - "z": "b70ee13eafa73823", - "name": "All media players, but livingroom", - "wires": [ - [ - "ab3f3ef4e3ab317d" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "[\"media_player.kitchen\",\"media_player.bathroom\"]", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 950, - "y": 2680 - }, - { - "id": "76d6452c8ce8fa5c", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Get current state", - "wires": [ - [ - "6754aadb473ead61" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "playing", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "{{payload}}", - "state_type": "str", - "blockInputOverrides": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "entity" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 910, - "y": 2740 - }, - { - "id": "6754aadb473ead61", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Get leader (if grouped) or self", - "wires": [ - [ - "3d1036d3fa33e2ad" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "(\t $members := data.attributes.group_members;\t $leader := ($members and $count($members) > 0) ? $members[0] : entity_id; \t { \"entity_id\": $leader }\t)", - "tot": "jsonata" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1160, - "y": 2740 - }, - { - "id": "3d1036d3fa33e2ad", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Pause media player", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.media_pause", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "payload", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": true, - "domain": "media_player", - "service": "media_pause", - "x": 920, - "y": 2800 - }, - { - "id": "3194aebd902a20ff", - "type": "delay", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "76d6452c8ce8fa5c" - ] - ], - "pauseType": "rate", - "timeout": "500", - "timeoutUnits": "milliseconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "allowrate": false, - "outputs": 1, - "x": 1360, - "y": 2680 - }, - { - "id": "1a1fb3664cb5cbc4", - "type": "debug", - "z": "b70ee13eafa73823", - "name": "No match", - "wires": [], - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "statusVal": "", - "statusType": "auto", - "x": 490, - "y": 2720 - }, - { - "id": "e3060a7791881147", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "TV On - pause music", - "wires": [], - "info": "", - "x": 180, - "y": 2580 - }, - { - "id": "dc2a982e648d103b", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Pause TV & lights", - "wires": [], - "info": "", - "x": 170, - "y": 2880 - }, - { - "id": "394cb7ef271fc2f8", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Media Box state", - "wires": [ - [ - "e04092e8f97898cf" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "media_player.media_box" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - }, - { - "property": "reset", - "propertyType": "msg", - "value": "true", - "valueType": "bool" - } - ], - "x": 160, - "y": 2920 - }, - { - "id": "dc7567e498a75b12", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Check state", - "wires": [ - [ - "39ea254eb72f0901" - ], - [ - "787b1101083df9bf" - ] - ], - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "playing", - "vt": "str" - }, - { - "t": "eq", - "v": "paused", - "vt": "str" - } - ], - "checkall": "false", - "repair": false, - "outputs": 2, - "x": 510, - "y": 2920 - }, - { - "id": "787b1101083df9bf", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Lights in movie mode?", - "wires": [ - [ - "71916041b8ca3d07" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "Movie", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_select.livingroom_scene_selector", - "state_type": "str", - "blockInputOverrides": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 780, - "y": 2960 - }, - { - "id": "39ea254eb72f0901", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Lights in movie-pause mode?", - "wires": [ - [ - "bb3c4a6174931a21" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "Movie Pause", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_select.livingroom_scene_selector", - "state_type": "str", - "blockInputOverrides": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 800, - "y": 2900 - }, - { - "id": "7f0f0d6e3eb5f8cb", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Update scene in selector", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_select.select_option", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_select.livingroom_scene_selector" - ], - "labelId": [], - "data": "{\"option\": msg.payload}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "input_select", - "service": "select_option", - "x": 1390, - "y": 2920 - }, - { - "id": "bb3c4a6174931a21", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Switch to Movie mode", - "wires": [ - [ - "7f0f0d6e3eb5f8cb" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Movie", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1080, - "y": 2900 - }, - { - "id": "71916041b8ca3d07", - "type": "change", - "z": "b70ee13eafa73823", - "name": "Switch to Movie pause mode", - "wires": [ - [ - "7f0f0d6e3eb5f8cb" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "Movie Pause", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 1100, - "y": 2940 - }, - { - "id": "dfd77a76dc2e0568", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Midday starts", - "wires": [ - [ - "6073e4e66bb6e228" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.midday_starts_ha" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "", - "forType": "num", - "forUnits": "milliseconds", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 130, - "y": 680 - }, - { - "id": "6073e4e66bb6e228", - "type": "subflow:be8264a322721305", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "f833288986e00ae0" - ] - ], - "x": 250, - "y": 740 - }, - { - "id": "afa6cccb1cfc8ddb", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Late afternoon starts", - "wires": [ - [ - "2e03442c0d67da32" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.late_afternoon_starts_ha" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "", - "forType": "num", - "forUnits": "milliseconds", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 150, - "y": 780 - }, - { - "id": "2e03442c0d67da32", - "type": "subflow:be8264a322721305", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "f833288986e00ae0" - ] - ], - "x": 270, - "y": 840 - }, - { - "id": "097585a397ef8e60", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Evening starts", - "wires": [ - [ - "67659db54987a408" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.evening_starts_ha" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "", - "forType": "num", - "forUnits": "milliseconds", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 130, - "y": 880 - }, - { - "id": "67659db54987a408", - "type": "subflow:be8264a322721305", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "f833288986e00ae0" - ] - ], - "x": 270, - "y": 940 - }, - { - "id": "a02362b40496cf27", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Late evening starts", - "wires": [ - [ - "a2f0111dc2cad4b2" - ] - ], - "d": true, - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.late_evening_starts_ha" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "", - "forType": "num", - "forUnits": "milliseconds", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 150, - "y": 980 - }, - { - "id": "a2f0111dc2cad4b2", - "type": "subflow:be8264a322721305", - "z": "b70ee13eafa73823", - "name": "", - "wires": [ - [ - "f833288986e00ae0" - ] - ], - "x": 270, - "y": 1040 - }, - { - "id": "f833288986e00ae0", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Livingroom lights on?", - "wires": [ - [ - "0836295ca0bc0df3", - "ce7a6033db2e3ffa" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "light.living_room", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 500, - "y": 520 - }, - { - "id": "613a9be150591ee7", - "type": "comment", - "z": "b70ee13eafa73823", - "name": "Harmony Remote Control", - "wires": [], - "info": "", - "x": 190, - "y": 3160 - }, - { - "id": "397fc02eaed29a41", - "type": "server-events", - "z": "b70ee13eafa73823", - "name": "Listen to roku command events", - "wires": [ - [ - "dcc93b3ba73bee14" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "exposeAsEntityConfig": "", - "eventType": "roku_command", - "eventData": "", - "waitForRunning": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "$outputData(\"eventData\").event_type", - "valueType": "jsonata" - } - ], - "x": 210, - "y": 3200 - }, - { - "id": "dcc93b3ba73bee14", - "type": "switch", - "z": "b70ee13eafa73823", - "name": "Event switch", - "wires": [ - [], - [ - "0cd947d505af3e73" - ], - [ - "1649296f3891a37c" - ], - [ - "8fd5e325dc59160a" - ], - [], - [ - "bb3c4a6174931a21" - ], - [ - "71916041b8ca3d07" - ], - [], - [], - [], - [], - [], - [] - ], - "property": "payload.event.key", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Play", - "vt": "str" - }, - { - "t": "eq", - "v": "Rev", - "vt": "str" - }, - { - "t": "eq", - "v": "Fwd", - "vt": "str" - }, - { - "t": "eq", - "v": "Select", - "vt": "str" - }, - { - "t": "eq", - "v": "Home", - "vt": "str" - }, - { - "t": "eq", - "v": "Left", - "vt": "str" - }, - { - "t": "eq", - "v": "Right", - "vt": "str" - }, - { - "t": "eq", - "v": "Down", - "vt": "str" - }, - { - "t": "eq", - "v": "Up", - "vt": "str" - }, - { - "t": "eq", - "v": "Back", - "vt": "str" - }, - { - "t": "eq", - "v": "Info", - "vt": "str" - }, - { - "t": "eq", - "v": "PowerOn", - "vt": "str" - }, - { - "t": "eq", - "v": "PowerOff", - "vt": "str" - } - ], - "checkall": "false", - "repair": false, - "outputs": 13, - "x": 490, - "y": 3220 - }, - { - "id": "8fd5e325dc59160a", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Shift the scene", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_button.press", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_button.livingroom_shift_scene" - ], - "labelId": [], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": true, - "domain": "input_button", - "service": "press", - "x": 880, - "y": 3200 - }, - { - "id": "e04092e8f97898cf", - "type": "trigger", - "z": "b70ee13eafa73823", - "name": "wait 1 sec", - "wires": [ - [ - "dc7567e498a75b12" - ] - ], - "op1": "", - "op2": "", - "op1type": "nul", - "op2type": "pay", - "duration": "1", - "extend": false, - "overrideDelay": false, - "units": "s", - "reset": "", - "bytopic": "all", - "topic": "topic", - "outputs": 1, - "x": 340, - "y": 2920 - }, - { - "id": "ssc_motion_lr_19dda5bc955", - "type": "server-state-changed", - "z": "b70ee13eafa73823", - "name": "Livingroom Motion Sensor", - "wires": [ - [ - "ca7ee0d8f3f6d02e" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 2, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "binary_sensor.livingroom_motion_sensor_occupancy" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "on", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "", - "forType": "num", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": true, - "ignoreCurrentStateUnavailable": true, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 150, - "y": 580 - }, - { - "id": "ca7ee0d8f3f6d02e", - "type": "api-current-state", - "z": "b70ee13eafa73823", - "name": "Motion - lights already on?", - "wires": [ - [], - [ - "ec6ae14bf7d95e92" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "light.living_room", - "state_type": "str", - "blockInputOverrides": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "string", - "valueType": "entityState" - } - ], - "for": "0", - "forType": "num", - "forUnits": "minutes", - "override_topic": false, - "state_location": "payload", - "override_payload": "msg", - "entity_location": "data", - "override_data": "msg", - "x": 520, - "y": 580 - }, - { - "id": "dining_route_001", - "type": "function", - "z": "b70ee13eafa73823", - "name": "Swap to no-dining scene if dining table off", - "wires": [ - [ - "f07c5e952b2f368b" - ] - ], - "func": "const states = global.get('homeassistant')?.homeAssistantLatest?.states || {};\nconst diningOn = states['light.living_room_dining_table']?.state === 'on';\nif (!diningOn) {\n msg.entity_id = msg.entity_id.replace(/_ha$/, '') + '_no_dining';\n}\nreturn msg;", - "outputs": 1, - "timeout": 0, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1560, - "y": 160 - }, - { - "id": "dining_scene_toggle_001", - "type": "function", - "z": "b70ee13eafa73823", - "name": "Dining toggle: apply scene variant", - "wires": [ - [ - "dining_scene_apply_001" - ], - [ - "dining_light_off_001" - ], - [ - "dining_light_on_001" - ] - ], - "func": "const states = global.get('homeassistant')?.homeAssistantLatest?.states || {};\nconst diningOn = states['light.living_room_dining_table']?.state === 'on';\n\nconst mainLights = [\n 'light.living_room_ceiling_1',\n 'light.living_room_ceiling_2',\n 'light.living_room_ceiling_3',\n 'light.living_room_bookshelf',\n 'light.living_room_top_of_bar'\n];\nconst sceneActive = mainLights.some(id => states[id]?.state === 'on');\n\nif (!sceneActive) {\n return diningOn ? [null, { ...msg }, null] : [null, null, { ...msg }];\n}\n\nconst selectorName = states['input_select.livingroom_scene_selector']?.state || '';\nconst slug = selectorName.toLowerCase()\n .replace(/[^a-z0-9 ]/g, '')\n .trim()\n .replace(/ +/g, '_');\n\nconst sceneId = diningOn\n ? 'scene.livingroom_' + slug + '_no_dining'\n : 'scene.livingroom_' + slug + '_ha';\n\nreturn [{ ...msg, entity_id: sceneId }, diningOn ? { ...msg } : null, null];", - "outputs": 3, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1060, - "y": 1340 - }, - { - "id": "dining_scene_apply_001", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Apply scene variant", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "scene.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "{{ entity_id }}" - ], - "labelId": [], - "data": "{\"transition\":0.5}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "scene", - "service": "turn_on", - "x": 1300, - "y": 1300 - }, - { - "id": "dining_light_off_001", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Turn off dining lamp", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "light.turn_off", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_dining_table" - ], - "labelId": [], - "data": "{\"transition\":0.5}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "light", - "service": "turn_off", - "x": 1300, - "y": 1380 - }, - { - "id": "dining_light_on_001", - "type": "api-call-service", - "z": "b70ee13eafa73823", - "name": "Turn on dining lamp", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.living_room_dining_table" - ], - "labelId": [], - "data": "{\"transition\":0.5}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "all", - "blockInputOverrides": false, - "domain": "light", - "service": "turn_on", - "x": 1300, - "y": 1460 - }, { "id": "c7f876875da48b87", "type": "tab", @@ -23179,5 +18227,5023 @@ "output_location_type": "none", "x": 660, "y": 700 + }, + { + "type": "tab", + "label": "Living room", + "id": "b70ee13eafa73823" + }, + { + "id": "tst0000000000003", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Filter: brightness step", + "wires": [ + [ + "tst0000000000004" + ], + [ + "tst0000000000004" + ] + ], + "property": "dial_motion", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "brightness_step_up", + "vt": "str" + }, + { + "t": "eq", + "v": "brightness_step_down", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 2, + "x": 420, + "y": 3420 + }, + { + "id": "tst0000000000004", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Music control on?", + "wires": [ + [ + "tst0000000000005" + ], + [ + "tst0000000000009" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.livingroom_music_control", + "state_type": "str", + "blockInputOverrides": true, + "outputProperties": [], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 680, + "y": 3420 + }, + { + "id": "tst0000000000005", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Get current volume", + "wires": [ + [ + "tst0000000000006" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "playing", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "media_player.home_theater_universal", + "state_type": "str", + "blockInputOverrides": true, + "outputProperties": [ + { + "property": "entity", + "propertyType": "msg", + "value": "", + "valueType": "entity" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 940, + "y": 3380 + }, + { + "id": "tst0000000000006", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Store current volume", + "wires": [ + [ + "tst0000000000007" + ] + ], + "rules": [ + { + "t": "set", + "p": "current_volume", + "pt": "msg", + "to": "entity.attributes.volume_level", + "tot": "msg" + }, + { + "t": "delete", + "p": "entity", + "pt": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1200, + "y": 3380 + }, + { + "id": "tst0000000000007", + "type": "function", + "z": "b70ee13eafa73823", + "name": "Calculate new volume", + "wires": [ + [ + "tst0000000000008" + ] + ], + "func": "const action = msg.dial_motion;\nconst direction = action === 'brightness_step_up' ? 1 : -1;\nconst stepSize = Number(msg.dial_step_size) || 30;\nconst modifier = Math.round(stepSize / 3) / 255 * 0.2;\nconst raw = (msg.current_volume || 0) + direction * modifier;\nmsg.payload = Math.round(Math.max(0, Math.min(1, raw)) * 100) / 100;\nreturn msg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1460, + "y": 3380 + }, + { + "id": "tst0000000000008", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Set Volume", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "media_player.volume_set", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "media_player.home_theater_universal" + ], + "labelId": [], + "data": "{\"volume_level\": {{{ payload }}} }", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "volume_set", + "x": 1710, + "y": 3380 + }, + { + "id": "tst0000000000009", + "type": "function", + "z": "b70ee13eafa73823", + "name": "Calculate brightness step", + "wires": [ + [ + "tst000000000000e", + "tst000000000000a" + ] + ], + "func": "const action = msg.dial_motion;\nconst direction = action === 'brightness_step_up' ? 1 : -1;\nconst stepSize = Number(msg.dial_step_size) || 30;\nmsg.service_payload = {\n brightness_step: direction * Math.round(stepSize / 3),\n transition: 0.1\n};\nflow.set('latestServicePayload', msg.service_payload);\nreturn msg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 940, + "y": 3480 + }, + { + "id": "tst000000000000e", + "type": "debug", + "z": "b70ee13eafa73823", + "name": "Step debug", + "wires": [], + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 940, + "y": 3560 + }, + { + "id": "tst000000000000a", + "type": "function", + "z": "b70ee13eafa73823", + "name": "Compute & fan out brightness", + "wires": [ + [ + "tst000000000000d" + ], + [ + "dim_main_001" + ], + [ + "dim_bar_001" + ], + [ + "dim_dining_001" + ] + ], + "func": "const action = msg.dial_motion;\nconst direction = action === 'brightness_step_up' ? 1 : -1;\nconst rawStep = Number(msg.dial_step_size) || 30;\nconst step = direction * rawStep;\n\nconst lights = [\n 'light.living_room_bookshelf',\n 'light.living_room_main',\n 'light.living_room_top_of_bar',\n 'light.living_room_dining_table'\n];\n\nconst haStates = global.get('homeassistant')?.homeAssistantLatest?.states || {};\n\nconst now = Date.now();\nif (now - (flow.get('lastDial') || 0) > 10 * 60 * 1000) {\n lights.forEach(id => flow.set('brt_' + id.replace(/[^a-z0-9]/g, '_'), null));\n}\nflow.set('lastDial', now);\n\nreturn lights.map(id => {\n if (haStates[id]?.state !== 'on') return null;\n const key = 'brt_' + id.replace(/[^a-z0-9]/g, '_');\n let brt = flow.get(key);\n if (brt == null) brt = haStates[id]?.attributes?.brightness || 128;\n brt = Math.max(1, Math.min(255, brt + step));\n flow.set(key, brt);\n return { brightness: Math.round(brt) };\n});", + "outputs": 4, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1230, + "y": 3480 + }, + { + "id": "tst000000000000d", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Dim bookshelf", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_bookshelf" + ], + "labelId": [], + "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": true, + "domain": "light", + "service": "turn_on", + "x": 2240, + "y": 3480 + }, + { + "id": "dim_main_001", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Dim ceiling (main)", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_main" + ], + "labelId": [], + "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": true, + "domain": "light", + "service": "turn_on", + "x": 2240, + "y": 3540 + }, + { + "id": "dim_bar_001", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Dim top of bar", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_top_of_bar" + ], + "labelId": [], + "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": true, + "domain": "light", + "service": "turn_on", + "x": 2240, + "y": 3600 + }, + { + "id": "dim_dining_001", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Dim dining table", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_dining_table" + ], + "labelId": [], + "data": "{\"brightness\": {{{brightness}}}, \"transition\": 0.3}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": true, + "domain": "light", + "service": "turn_on", + "x": 2240, + "y": 3660 + }, + { + "id": "ecb0c97ae392b159", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "UI Scene Selector", + "wires": [], + "info": "", + "x": 130, + "y": 60 + }, + { + "id": "d3a49892623d0c67", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Livingroom Scene Selector", + "wires": [ + [ + "e3ad58f3e13ded81" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_select.livingroom_scene_selector" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 150, + "y": 100 + }, + { + "id": "f07c5e952b2f368b", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Turn on Scene", + "wires": [ + [ + "13bf72e70e9bbd73" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "scene.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "{{ entity_id }}" + ], + "labelId": [], + "data": "{\"transition\":0.5}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "scene", + "service": "turn_on", + "x": 1640, + "y": 220 + }, + { + "id": "766d258dc65a274f", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Livingroom Shift Scene Button", + "wires": [ + [ + "bfaccee76249a213" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_button.livingroom_shift_scene" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 160, + "y": 320 + }, + { + "id": "b0f2fedd2347176d", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Scene Shifter, updates UI Scene Selector", + "wires": [], + "info": "", + "x": 200, + "y": 180 + }, + { + "id": "bfaccee76249a213", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Trigger next scene in shifter", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_select.select_next", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.livingroom_scene_shifter" + ], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "input_select", + "service": "select_next", + "x": 520, + "y": 320 + }, + { + "id": "38801dbb193aaf6a", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Livingroom Scene Shifter", + "wires": [ + [ + "be4016ddfc38da17" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_select.livingroom_scene_shifter" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 150, + "y": 220 + }, + { + "id": "be4016ddfc38da17", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Update scene in selector", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_select.select_option", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.livingroom_scene_selector" + ], + "labelId": [], + "data": "{\"option\": msg.payload}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "input_select", + "service": "select_option", + "x": 510, + "y": 220 + }, + { + "id": "ec6ae14bf7d95e92", + "type": "subflow:52430f5e9f9ee267", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "ecf9fefeac6dc853" + ], + [ + "19360a877415c87d" + ], + [ + "1efe8dde3508e5c1" + ], + [ + "21f09eeec20cb3f6" + ], + [ + "b4b48cde6a2830f3" + ], + [ + "8b046197cef5a597" + ] + ], + "x": 850, + "y": 600 + }, + { + "id": "fdd0994437d3eb49", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Livingroom time-based turn on", + "wires": [ + [ + "2db649c0455c7a49" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_button.livingroom_time_based_turn_on" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "", + "forType": "num", + "forUnits": "milliseconds", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 160, + "y": 500 + }, + { + "id": "ecf9fefeac6dc853", + "type": "change", + "z": "b70ee13eafa73823", + "name": "morning - Energize", + "wires": [ + [ + "fccf425d1d70a288" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Energize", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1150, + "y": 600 + }, + { + "id": "19360a877415c87d", + "type": "change", + "z": "b70ee13eafa73823", + "name": "midday - Concentrate", + "wires": [ + [ + "fccf425d1d70a288" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Concentrate", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1160, + "y": 640 + }, + { + "id": "1efe8dde3508e5c1", + "type": "change", + "z": "b70ee13eafa73823", + "name": "late afternoon - Read", + "wires": [ + [ + "fccf425d1d70a288" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Read", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1160, + "y": 680 + }, + { + "id": "21f09eeec20cb3f6", + "type": "change", + "z": "b70ee13eafa73823", + "name": "evening - Relax", + "wires": [ + [ + "fccf425d1d70a288" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Relax", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1140, + "y": 720 + }, + { + "id": "b4b48cde6a2830f3", + "type": "change", + "z": "b70ee13eafa73823", + "name": "late evening - Rest", + "wires": [ + [ + "fccf425d1d70a288" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Rest", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1150, + "y": 760 + }, + { + "id": "8b046197cef5a597", + "type": "change", + "z": "b70ee13eafa73823", + "name": "night - Nightlight", + "wires": [ + [ + "fccf425d1d70a288" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Nightlight", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1140, + "y": 800 + }, + { + "id": "2db649c0455c7a49", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Livingroom lights on?", + "wires": [ + [ + "ce7a6033db2e3ffa", + "0836295ca0bc0df3" + ], + [ + "ec6ae14bf7d95e92" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "light.living_room", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 500, + "y": 480 + }, + { + "id": "7016650e62edb33e", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Trigger specific scene in shifter", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_select.select_option", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.livingroom_scene_shifter" + ], + "labelId": [], + "data": "{\"option\":msg.payload}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [ + { + "property": "results", + "propertyType": "msg", + "value": "", + "valueType": "results" + } + ], + "queue": "all", + "blockInputOverrides": false, + "domain": "input_select", + "service": "select_option", + "x": 2050, + "y": 680 + }, + { + "id": "7ddf806038a9a543", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Trigger next scene in shifter", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_select.select_next", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.livingroom_scene_shifter" + ], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "input_select", + "service": "select_next", + "x": 1680, + "y": 420 + }, + { + "id": "ce7a6033db2e3ffa", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Get UI scene selector state", + "wires": [ + [ + "544bbcfca2ae8966" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_select.livingroom_scene_selector", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "selector_scene", + "valueType": "str" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 800, + "y": 400 + }, + { + "id": "0836295ca0bc0df3", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Get scene shifter state", + "wires": [ + [ + "544bbcfca2ae8966" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_select.livingroom_scene_shifter", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "shifter_scene", + "valueType": "str" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 780, + "y": 440 + }, + { + "id": "544bbcfca2ae8966", + "type": "join", + "z": "b70ee13eafa73823", + "name": "Collect all items", + "wires": [ + [ + "52a8d21f9e1670bc" + ] + ], + "mode": "custom", + "build": "object", + "property": "payload", + "propertyType": "msg", + "key": "topic", + "joiner": "\\n", + "joinerType": "str", + "accumulate": false, + "timeout": "", + "count": "2", + "reduceRight": false, + "reduceExp": "", + "reduceInit": "", + "reduceInitType": "", + "reduceFixup": "", + "x": 1090, + "y": 400 + }, + { + "id": "52a8d21f9e1670bc", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Do the UI and internal scene selector (shifter) have an identical value?", + "wires": [ + [ + "7ddf806038a9a543" + ], + [ + "882484a2b843b11f" + ] + ], + "property": "payload.selector_scene", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "payload.shifter_scene", + "vt": "msg" + }, + { + "t": "else" + } + ], + "checkall": "false", + "repair": false, + "outputs": 2, + "x": 1250, + "y": 460 + }, + { + "id": "882484a2b843b11f", + "type": "change", + "z": "b70ee13eafa73823", + "name": "clear payload", + "wires": [ + [ + "ec6ae14bf7d95e92" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1630, + "y": 480 + }, + { + "id": "fccf425d1d70a288", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Scene shifter already on time-based scene?", + "wires": [ + [ + "7016650e62edb33e" + ], + [ + "efc95cdb439dfb7f" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "msg.payload", + "halt_if_type": "jsonata", + "halt_if_compare": "is_not", + "entity_id": "input_select.livingroom_scene_shifter", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 1550, + "y": 680 + }, + { + "id": "7399514dde3e0bfe", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Trigger specific scene in selector", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_select.select_option", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.livingroom_scene_selector" + ], + "labelId": [], + "data": "{\"option\":msg.payload}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [ + { + "property": "results", + "propertyType": "msg", + "value": "", + "valueType": "results" + } + ], + "queue": "all", + "blockInputOverrides": false, + "domain": "input_select", + "service": "select_option", + "x": 2050, + "y": 740 + }, + { + "id": "447435b97ace1c77", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Check setting of scene shifter and call according function, as shift will update selector, but not if it already has the correct state", + "wires": [], + "info": "", + "x": 1800, + "y": 640 + }, + { + "id": "1f9f81e7a7920976", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Only shift if value is identical between selects", + "wires": [], + "info": "In case the UI elements are already the same, then i want to trigger the next scene.\nIn case the UI elements are not the same, they should be synchonized.", + "x": 1170, + "y": 500 + }, + { + "id": "e3ad58f3e13ded81", + "type": "string", + "z": "b70ee13eafa73823", + "name": "Parse user readable text and convert to scene entity ID", + "wires": [ + [ + "dining_route_001", + "13bf72e70e9bbd73" + ] + ], + "methods": [ + { + "name": "slugify", + "params": [] + }, + { + "name": "replaceAll", + "params": [ + { + "type": "str", + "value": "-" + }, + { + "type": "str", + "value": "_" + } + ] + }, + { + "name": "prepend", + "params": [ + { + "type": "str", + "value": "scene.livingroom_" + } + ] + }, + { + "name": "append", + "params": [ + { + "type": "str", + "value": "_ha" + } + ] + } + ], + "prop": "payload", + "propout": "entity_id", + "object": "msg", + "objectout": "msg", + "x": 1520, + "y": 100 + }, + { + "id": "6a4eb8cc515c46ea", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Time-based light scenes", + "wires": [], + "info": "", + "x": 150, + "y": 460 + }, + { + "id": "38ce67093edaca48", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Hidden Scene Shifter button - only for Dev UI", + "wires": [], + "info": "", + "x": 210, + "y": 280 + }, + { + "id": "142ba7e9832fdf4c", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Turn on/off lights livingroom", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.{{ service }}", + "floorId": [], + "areaId": [ + "9fb80339d4ee49f098decfafad38ab78" + ], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "msg.payload", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "light", + "service": "{{ service }}", + "x": 1340, + "y": 1240 + }, + { + "id": "691f50e528c73024", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "On/Off check", + "wires": [ + [ + "2db649c0455c7a49" + ], + [ + "e64edc58615d79d4" + ], + [ + "2db649c0455c7a49" + ], + [ + "e64edc58615d79d4" + ] + ], + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "button_1_press_release", + "vt": "str" + }, + { + "t": "eq", + "v": "button_3_press_release", + "vt": "str" + }, + { + "t": "eq", + "v": "on_press_release", + "vt": "str" + }, + { + "t": "eq", + "v": "off_press_release", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 4, + "x": 510, + "y": 1120 + }, + { + "id": "47eeb8d0da59b457", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Brightness check - Up ", + "wires": [ + [ + "3403d228e69854ed" + ] + ], + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "brightness_step_up", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 1, + "x": 540, + "y": 1220 + }, + { + "id": "3403d228e69854ed", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness increase (smooth)", + "wires": [ + [ + "142ba7e9832fdf4c" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{\"brightness_step\":15,\"transition\":0.1}", + "tot": "json" + }, + { + "t": "set", + "p": "service", + "pt": "msg", + "to": "turn_on", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 830, + "y": 1220 + }, + { + "id": "fe9ea08e5c5eb757", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness decrease (smooth)", + "wires": [ + [ + "142ba7e9832fdf4c" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{\"brightness_step\":-15,\"transition\":0.1}", + "tot": "json" + }, + { + "t": "set", + "p": "service", + "pt": "msg", + "to": "turn_on", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 840, + "y": 1260 + }, + { + "id": "e64edc58615d79d4", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Service: turn off", + "wires": [ + [ + "a566b47735e884f7" + ] + ], + "rules": [ + { + "t": "set", + "p": "service", + "pt": "msg", + "to": "turn_off", + "tot": "str" + }, + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{\"transition\":0.5}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 800, + "y": 1140 + }, + { + "id": "da4e9761a84ee45b", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Dimmer functionality - HUE", + "wires": [], + "info": "", + "x": 550, + "y": 1180 + }, + { + "id": "5c31d80bcb840a96", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Brightness check - Down", + "wires": [ + [ + "fe9ea08e5c5eb757" + ] + ], + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "brightness_step_down", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 1, + "x": 550, + "y": 1260 + }, + { + "id": "17a110d60b7dd497", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "On hold", + "wires": [ + [ + "ecf9fefeac6dc853" + ], + [ + "21f09eeec20cb3f6" + ] + ], + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "button_1_hold", + "vt": "str" + }, + { + "t": "eq", + "v": "button_3_hold", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 780, + "y": 1000 + }, + { + "id": "3227ee1d0ce6a8e8", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Allow two default modes via switch", + "wires": [], + "info": "", + "x": 860, + "y": 1040 + }, + { + "id": "28e866353c605b91", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Hue - Living room tapdial", + "wires": [ + [ + "691f50e528c73024", + "17a110d60b7dd497", + "2de26b31165d3632", + "57a722e2ab174bc1", + "tst0000000000003" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.livingroom_tapdial_action" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + }, + { + "property": "dial_motion", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "dial_step_size", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "x": 170, + "y": 1120 + }, + { + "id": "85818d214c994abb", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Livingroom tap-dial", + "wires": [], + "info": "", + "x": 150, + "y": 1080 + }, + { + "id": "efc95cdb439dfb7f", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Scene selector already on time-based scene?", + "wires": [ + [ + "7399514dde3e0bfe" + ], + [ + "e3ad58f3e13ded81" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "msg.payload", + "halt_if_type": "jsonata", + "halt_if_compare": "is_not", + "entity_id": "input_select.livingroom_scene_selector", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 1560, + "y": 760 + }, + { + "id": "7de469ae61567be2", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "4b1badad7ce89076" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.livingroom_tapdial_action" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 240, + "y": 1820 + }, + { + "id": "4b1badad7ce89076", + "type": "debug", + "z": "b70ee13eafa73823", + "name": "debug 6", + "wires": [], + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 660, + "y": 1880 + }, + { + "id": "66756ac444fc22da", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "4b1badad7ce89076" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.livingroom_tapdial_action_time" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 260, + "y": 1940 + }, + { + "id": "7d4e2bdc0bcf256d", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "4b1badad7ce89076" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.livingroom_tapdial_action_type" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 260, + "y": 1900 + }, + { + "id": "ec9d9a53e6083bcb", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "4b1badad7ce89076" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.livingroom_tapdial_action_direction" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 270, + "y": 1860 + }, + { + "id": "13bf72e70e9bbd73", + "type": "debug", + "z": "b70ee13eafa73823", + "name": "debug 7", + "wires": [], + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 1880, + "y": 240 + }, + { + "id": "2de26b31165d3632", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Button 2 release & hold", + "wires": [ + [ + "dining_scene_toggle_001" + ], + [ + "dc98aceee1133a56" + ] + ], + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "button_2_press_release", + "vt": "str" + }, + { + "t": "eq", + "v": "button_2_hold_release", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 550, + "y": 1360 + }, + { + "id": "2b837d7d2faf1d5a", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Dining table is on?", + "wires": [ + [ + "0d22e917d1b9469d" + ], + [ + "deab274cb333a51e" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "light.living_room_dining_table", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "entity_id", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 810, + "y": 1340 + }, + { + "id": "28f2c687c20d4265", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Turn on/off lights", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.{{ service }}", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "{{ entity_id }}" + ], + "labelId": [], + "data": "msg.payload", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "light", + "service": "{{ service }}", + "x": 1340, + "y": 1380 + }, + { + "id": "0d22e917d1b9469d", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Service: turn off", + "wires": [ + [ + "28f2c687c20d4265" + ] + ], + "rules": [ + { + "t": "set", + "p": "service", + "pt": "msg", + "to": "turn_off", + "tot": "str" + }, + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{\"transition\":0.5}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1100, + "y": 1360 + }, + { + "id": "deab274cb333a51e", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Service: turn on", + "wires": [ + [ + "28f2c687c20d4265" + ] + ], + "rules": [ + { + "t": "set", + "p": "service", + "pt": "msg", + "to": "turn_on", + "tot": "str" + }, + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{\"transition\":0.5}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1100, + "y": 1400 + }, + { + "id": "dc98aceee1133a56", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Any non main light on?", + "wires": [ + [ + "0d22e917d1b9469d" + ], + [ + "deab274cb333a51e" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "light.livingroom_non_main_lights", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "entity_id", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 820, + "y": 1400 + }, + { + "id": "a566b47735e884f7", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Turn on/off lights livingroom", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.{{ service }}", + "floorId": [], + "areaId": [ + "9fb80339d4ee49f098decfafad38ab78" + ], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "msg.payload", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "light", + "service": "{{ service }}", + "x": 1340, + "y": 1160 + }, + { + "id": "b46f52f581f07d43", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Livingroom tap-dial", + "wires": [], + "info": "", + "x": 150, + "y": 2020 + }, + { + "id": "10325d851d92b3db", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Dimmer functionality testing - HUE", + "wires": [], + "info": "", + "x": 400, + "y": 2020 + }, + { + "id": "2e50d893ea29f932", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Brightness check - Up step", + "wires": [ + [ + "f7192e46a47b653a", + "4c73d1e8092387b2" + ], + [ + "f7192e46a47b653a", + "0c483b69f2455536" + ], + [ + "f7192e46a47b653a", + "0cd947d505af3e73" + ] + ], + "property": "dial_motion", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "dial_rotate_right_fast", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_right_slow", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_right_step", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 3, + "x": 540, + "y": 2260 + }, + { + "id": "a4ea444bb95d8993", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Brightness check - Down step", + "wires": [ + [ + "f7192e46a47b653a", + "7391f9b1cbede747" + ], + [ + "f7192e46a47b653a", + "05fd0d70d3bd26fd" + ], + [ + "f7192e46a47b653a", + "1649296f3891a37c" + ] + ], + "property": "dial_motion", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "dial_rotate_left_fast", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_left_slow", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_left_step", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 3, + "x": 550, + "y": 2320 + }, + { + "id": "0cd947d505af3e73", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness increase (smooth)", + "wires": [ + [ + "0470a1771bbbe584" + ] + ], + "rules": [ + { + "t": "set", + "p": "service_payload", + "pt": "msg", + "to": "{\"brightness_step\":15,\"transition\":0.1}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 910, + "y": 2280 + }, + { + "id": "1649296f3891a37c", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness decrease (smooth)", + "wires": [ + [ + "0470a1771bbbe584" + ] + ], + "rules": [ + { + "t": "set", + "p": "service_payload", + "pt": "msg", + "to": "{\"brightness_step\":-15,\"transition\":0.1}", + "tot": "json" + }, + { + "t": "set", + "p": "service", + "pt": "msg", + "to": "turn_on", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 920, + "y": 2400 + }, + { + "id": "f7192e46a47b653a", + "type": "debug", + "z": "b70ee13eafa73823", + "name": "tapdial debug", + "wires": [], + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 880, + "y": 2500 + }, + { + "id": "0c483b69f2455536", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness increase (smooth)", + "wires": [ + [ + "0470a1771bbbe584" + ] + ], + "rules": [ + { + "t": "set", + "p": "service_payload", + "pt": "msg", + "to": "{\"brightness_step\":30,\"transition\":0.1}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 910, + "y": 2240 + }, + { + "id": "4c73d1e8092387b2", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness increase (smooth)", + "wires": [ + [ + "0470a1771bbbe584" + ] + ], + "rules": [ + { + "t": "set", + "p": "service_payload", + "pt": "msg", + "to": "{\"brightness_step\":50,\"transition\":0.1}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 910, + "y": 2200 + }, + { + "id": "7391f9b1cbede747", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness decrease (smooth)", + "wires": [ + [ + "0470a1771bbbe584" + ] + ], + "rules": [ + { + "t": "set", + "p": "service_payload", + "pt": "msg", + "to": "{\"brightness_step\":-50,\"transition\":0.1}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 920, + "y": 2320 + }, + { + "id": "05fd0d70d3bd26fd", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Brightness decrease (smooth)", + "wires": [ + [ + "0470a1771bbbe584" + ] + ], + "rules": [ + { + "t": "set", + "p": "service_payload", + "pt": "msg", + "to": "{\"brightness_step\":-30,\"transition\":0.1}", + "tot": "json" + }, + { + "t": "set", + "p": "service", + "pt": "msg", + "to": "turn_on", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 920, + "y": 2360 + }, + { + "id": "0470a1771bbbe584", + "type": "ha-get-entities", + "z": "b70ee13eafa73823", + "name": "Find lights that are on", + "wires": [ + [ + "a28ab05bdedd5bbd" + ] + ], + "server": "657c7463.48e1e4", + "version": 1, + "rules": [ + { + "property": "entity_id", + "logic": "includes", + "value": "light.dining_table, light.living_room_bookshelf, light.living_room_main, light.living_room_top_of_bar", + "valueType": "str" + }, + { + "property": "state", + "logic": "is", + "value": "on", + "valueType": "str" + } + ], + "outputType": "array", + "outputEmptyResults": false, + "outputLocationType": "msg", + "outputLocation": "payload", + "outputResultsCount": 1, + "x": 1300, + "y": 2300 + }, + { + "id": "dab871622d804c6b", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Dim lights that are on", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "{{ entity }}" + ], + "labelId": [], + "data": "msg.service_payload", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "light", + "service": "turn_on", + "x": 1300, + "y": 2480 + }, + { + "id": "07fd05ad8f6aaecb", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Find entity id of each light", + "wires": [ + [ + "dab871622d804c6b" + ] + ], + "rules": [ + { + "t": "set", + "p": "entity", + "pt": "msg", + "to": "payload.entity_id", + "tot": "msg" + }, + { + "t": "delete", + "p": "payload", + "pt": "msg" + }, + { + "t": "delete", + "p": "parts", + "pt": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1310, + "y": 2420 + }, + { + "id": "a28ab05bdedd5bbd", + "type": "split", + "z": "b70ee13eafa73823", + "name": "Loop through each light", + "wires": [ + [ + "07fd05ad8f6aaecb" + ] + ], + "splt": "\\n", + "spltType": "str", + "arraySplt": 1, + "arraySpltType": "len", + "stream": false, + "addname": "", + "property": "payload", + "x": 1310, + "y": 2360 + }, + { + "id": "7b987dbc853e7d20", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "TODO", + "wires": [], + "info": "- Does no longer work if lights are all off\n- Filament bulbs seem to be dimmed faster than others and turn off\n- Exclude Tetris light from this magic", + "x": 1250, + "y": 2540 + }, + { + "id": "f875e3eadcb1d94f", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Hue - Living room guest switch", + "wires": [ + [ + "691f50e528c73024" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "sensor.living_room_second_switch_action" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 190, + "y": 1360 + }, + { + "id": "57a722e2ab174bc1", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Button 4 release & hold", + "wires": [ + [ + "124ea1b2096c07ec" + ] + ], + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "button_4_hold_release", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 1, + "x": 550, + "y": 1560 + }, + { + "id": "124ea1b2096c07ec", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Toggle music mode", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "input_boolean.toggle", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_boolean.livingroom_music_control" + ], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "input_boolean", + "service": "toggle", + "x": 810, + "y": 1560 + }, + { + "id": "451542926c7b1dd2", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Music Control On", + "wires": [ + [ + "f71263e2817da390" + ], + [ + "42aaf23000066a7e" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 2, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_boolean.livingroom_music_control" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "on", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": 0, + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 140, + "y": 1660 + }, + { + "id": "317a78818934e225", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Flash lights", + "wires": [ + [ + "203f27c455479e23" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_dining_table", + "light.living_room_main" + ], + "labelId": [], + "data": "{\"brightness\":255,\"effect\":\"blink\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "light", + "service": "turn_on", + "x": 630, + "y": 1720 + }, + { + "id": "f71263e2817da390", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Flash Blue", + "wires": [ + [ + "222353ea1c063036" + ] + ], + "rules": [ + { + "t": "set", + "p": "flash_color", + "pt": "msg", + "to": "blue", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 410, + "y": 1640 + }, + { + "id": "42aaf23000066a7e", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Flash Green", + "wires": [ + [ + "222353ea1c063036" + ] + ], + "rules": [ + { + "t": "set", + "p": "flash_color", + "pt": "msg", + "to": "green", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 410, + "y": 1680 + }, + { + "id": "222353ea1c063036", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Create tmp scene", + "wires": [ + [ + "317a78818934e225" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "scene.create", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"snapshot_entities\":[\"light.living_room_dining_table\",\"light.living_room_main\"],\"scene_id\":\"music_mode_flash_livingroom\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "scene", + "service": "create", + "x": 630, + "y": 1660 + }, + { + "id": "a890dae37cb6e247", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Delete tmp scene", + "wires": [ + [ + "22a05465f41aea40" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "scene.delete", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"entity_id\":\"scene.music_mode_flash_livingroom\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "scene", + "service": "delete", + "x": 1190, + "y": 1720 + }, + { + "id": "8be5c8df48382bc5", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Go back to previous scene", + "wires": [ + [ + "a890dae37cb6e247" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "scene.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"entity_id\":\"scene.music_mode_flash_livingroom\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "scene", + "service": "turn_on", + "x": 940, + "y": 1720 + }, + { + "id": "203f27c455479e23", + "type": "delay", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "8be5c8df48382bc5" + ] + ], + "pauseType": "delay", + "timeout": "1", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 640, + "y": 1780 + }, + { + "id": "22a05465f41aea40", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Stop any effects", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_dining_table", + "light.living_room_main" + ], + "labelId": [], + "data": "{\"effect\":\"stop\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "light", + "service": "turn_on", + "x": 900, + "y": 1800 + }, + { + "id": "99ed51ceae7915cf", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Music control on?", + "wires": [ + [ + "9e1b61c654b9ee81" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.livingroom_music_control", + "state_type": "str", + "blockInputOverrides": true, + "outputProperties": [], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 190, + "y": 2120 + }, + { + "id": "179f0b0c2b86c079", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Volume check - Up step", + "wires": [ + [ + "cc8831b6182557d2" + ], + [ + "0029357f750ce03c" + ], + [ + "a3f678465cf5e81f" + ] + ], + "property": "dial_motion", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "dial_rotate_right_fast", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_right_slow", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_right_step", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 3, + "x": 890, + "y": 2040 + }, + { + "id": "6943ef25dc561946", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Volume check - Down step", + "wires": [ + [ + "d8d786fbf89d22e8" + ], + [ + "e6bc9026eba92ef0" + ], + [ + "c8b0a802aa7912c4" + ] + ], + "property": "dial_motion", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "dial_rotate_left_fast", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_left_slow", + "vt": "str" + }, + { + "t": "eq", + "v": "dial_rotate_left_step", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 3, + "x": 900, + "y": 2100 + }, + { + "id": "6260853b954dce29", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Set Volume", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "media_player.volume_set", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "media_player.home_theater_universal" + ], + "labelId": [], + "data": "{\"volume_level\": {{{ payload }}} }", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "volume_set", + "x": 1510, + "y": 2160 + }, + { + "id": "9e1b61c654b9ee81", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Get current volume", + "wires": [ + [ + "dbffbb3c2e701c5d" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "playing", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "media_player.home_theater_universal", + "state_type": "str", + "blockInputOverrides": true, + "outputProperties": [ + { + "property": "entity", + "propertyType": "msg", + "value": "", + "valueType": "entity" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 510, + "y": 2120 + }, + { + "id": "dbffbb3c2e701c5d", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Store current volume", + "wires": [ + [ + "179f0b0c2b86c079", + "6943ef25dc561946" + ] + ], + "rules": [ + { + "t": "set", + "p": "current_volume", + "pt": "msg", + "to": "entity.attributes.volume_level", + "tot": "msg" + }, + { + "t": "delete", + "p": "entity", + "pt": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 520, + "y": 2060 + }, + { + "id": "cc8831b6182557d2", + "type": "change", + "z": "b70ee13eafa73823", + "name": "0.07", + "wires": [ + [ + "3080f3a618d4368b" + ] + ], + "rules": [ + { + "t": "set", + "p": "volume_modifier", + "pt": "msg", + "to": "0.07", + "tot": "num" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1130, + "y": 1960 + }, + { + "id": "0029357f750ce03c", + "type": "change", + "z": "b70ee13eafa73823", + "name": "0.03", + "wires": [ + [ + "3080f3a618d4368b" + ] + ], + "rules": [ + { + "t": "set", + "p": "volume_modifier", + "pt": "msg", + "to": "0.03", + "tot": "num" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1130, + "y": 2000 + }, + { + "id": "a3f678465cf5e81f", + "type": "change", + "z": "b70ee13eafa73823", + "name": "0.01", + "wires": [ + [ + "3080f3a618d4368b" + ] + ], + "rules": [ + { + "t": "set", + "p": "volume_modifier", + "pt": "msg", + "to": "0.01", + "tot": "num" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1130, + "y": 2040 + }, + { + "id": "d8d786fbf89d22e8", + "type": "change", + "z": "b70ee13eafa73823", + "name": "-0.07", + "wires": [ + [ + "3080f3a618d4368b" + ] + ], + "rules": [ + { + "t": "set", + "p": "volume_modifier", + "pt": "msg", + "to": "-0.07", + "tot": "num" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1130, + "y": 2100 + }, + { + "id": "e6bc9026eba92ef0", + "type": "change", + "z": "b70ee13eafa73823", + "name": "-0.03", + "wires": [ + [ + "3080f3a618d4368b" + ] + ], + "rules": [ + { + "t": "set", + "p": "volume_modifier", + "pt": "msg", + "to": "-0.03", + "tot": "num" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1130, + "y": 2140 + }, + { + "id": "c8b0a802aa7912c4", + "type": "change", + "z": "b70ee13eafa73823", + "name": "-0.01", + "wires": [ + [ + "3080f3a618d4368b" + ] + ], + "rules": [ + { + "t": "set", + "p": "volume_modifier", + "pt": "msg", + "to": "-0.01", + "tot": "num" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1130, + "y": 2180 + }, + { + "id": "7534af436f628e33", + "type": "calculator", + "z": "b70ee13eafa73823", + "name": "Sum and ensure 2 decimals", + "wires": [ + [ + "6260853b954dce29" + ] + ], + "inputMsgField": "payload", + "outputMsgField": "payload", + "operation": "sum", + "constant": "", + "round": false, + "truncate": true, + "decimals": 0, + "decimals2": "2", + "x": 1480, + "y": 2100 + }, + { + "id": "3080f3a618d4368b", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Create summable array", + "wires": [ + [ + "7534af436f628e33" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "[ msg.current_volume, msg.volume_modifier ]", + "tot": "jsonata" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1390, + "y": 2040 + }, + { + "id": "ccdac6a5471ce5d1", + "type": "trigger-state", + "z": "b70ee13eafa73823", + "name": "Switching home theater to non heos", + "wires": [ + [ + "8b41a466c57cf276" + ], + [ + "1a1fb3664cb5cbc4" + ] + ], + "server": "657c7463.48e1e4", + "version": 5, + "inputs": 0, + "outputs": 2, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "media_player.home_theater_universal" + ], + "substring": [], + "regex": [] + }, + "debugEnabled": false, + "constraints": [ + { + "targetType": "this_entity", + "targetValue": "", + "propertyType": "property", + "propertyValue": "new_state.attributes.source", + "comparatorType": "includes", + "comparatorValueDatatype": "str", + "comparatorValue": "Media Player,PS4,VINYL" + } + ], + "customOutputs": [], + "outputInitially": false, + "stateType": "str", + "enableInput": false, + "x": 220, + "y": 2620 + }, + { + "id": "8b41a466c57cf276", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Prev source was HEOS", + "wires": [ + [ + "9bf8ce152f92cc25" + ], + [ + "d5c9055d644276d7" + ] + ], + "property": "data.old_state.attributes.source", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "HEOS Music", + "vt": "str" + }, + { + "t": "else" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 570, + "y": 2680 + }, + { + "id": "9bf8ce152f92cc25", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Prev state was playing", + "wires": [ + [ + "8ae9c55c69b0ff6c" + ], + [ + "d5c9055d644276d7" + ] + ], + "property": "data.old_state.state", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "playing", + "vt": "str" + }, + { + "t": "else" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 560, + "y": 2620 + }, + { + "id": "8ae9c55c69b0ff6c", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Pause media", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.media_pause", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "media_player.bathroom", + "media_player.bedroom", + "media_player.kitchen" + ], + "labelId": [], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": true, + "domain": "media_player", + "service": "media_pause", + "x": 1170, + "y": 2620 + }, + { + "id": "ab3f3ef4e3ab317d", + "type": "split", + "z": "b70ee13eafa73823", + "name": "Split array", + "wires": [ + [ + "3194aebd902a20ff" + ] + ], + "splt": "\\n", + "spltType": "str", + "arraySplt": 1, + "arraySpltType": "len", + "stream": false, + "addname": "", + "property": "payload", + "x": 1180, + "y": 2680 + }, + { + "id": "d5c9055d644276d7", + "type": "change", + "z": "b70ee13eafa73823", + "name": "All media players, but livingroom", + "wires": [ + [ + "ab3f3ef4e3ab317d" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "[\"media_player.kitchen\",\"media_player.bathroom\"]", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 950, + "y": 2680 + }, + { + "id": "76d6452c8ce8fa5c", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Get current state", + "wires": [ + [ + "6754aadb473ead61" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "playing", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "{{payload}}", + "state_type": "str", + "blockInputOverrides": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "entity" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 910, + "y": 2740 + }, + { + "id": "6754aadb473ead61", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Get leader (if grouped) or self", + "wires": [ + [ + "3d1036d3fa33e2ad" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "(\t $members := data.attributes.group_members;\t $leader := ($members and $count($members) > 0) ? $members[0] : entity_id; \t { \"entity_id\": $leader }\t)", + "tot": "jsonata" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1160, + "y": 2740 + }, + { + "id": "3d1036d3fa33e2ad", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Pause media player", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.media_pause", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "payload", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": true, + "domain": "media_player", + "service": "media_pause", + "x": 920, + "y": 2800 + }, + { + "id": "3194aebd902a20ff", + "type": "delay", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "76d6452c8ce8fa5c" + ] + ], + "pauseType": "rate", + "timeout": "500", + "timeoutUnits": "milliseconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 1360, + "y": 2680 + }, + { + "id": "1a1fb3664cb5cbc4", + "type": "debug", + "z": "b70ee13eafa73823", + "name": "No match", + "wires": [], + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "statusVal": "", + "statusType": "auto", + "x": 490, + "y": 2720 + }, + { + "id": "e3060a7791881147", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "TV On - pause music", + "wires": [], + "info": "", + "x": 180, + "y": 2580 + }, + { + "id": "dc2a982e648d103b", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Pause TV & lights", + "wires": [], + "info": "", + "x": 170, + "y": 2880 + }, + { + "id": "394cb7ef271fc2f8", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Media Box state", + "wires": [ + [ + "e04092e8f97898cf" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "media_player.media_box" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + }, + { + "property": "reset", + "propertyType": "msg", + "value": "true", + "valueType": "bool" + } + ], + "x": 160, + "y": 2920 + }, + { + "id": "dc7567e498a75b12", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Check state", + "wires": [ + [ + "39ea254eb72f0901" + ], + [ + "787b1101083df9bf" + ] + ], + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "playing", + "vt": "str" + }, + { + "t": "eq", + "v": "paused", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 2, + "x": 510, + "y": 2920 + }, + { + "id": "787b1101083df9bf", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Lights in movie mode?", + "wires": [ + [ + "71916041b8ca3d07" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "Movie", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_select.livingroom_scene_selector", + "state_type": "str", + "blockInputOverrides": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 780, + "y": 2960 + }, + { + "id": "39ea254eb72f0901", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Lights in movie-pause mode?", + "wires": [ + [ + "bb3c4a6174931a21" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "Movie Pause", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_select.livingroom_scene_selector", + "state_type": "str", + "blockInputOverrides": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 800, + "y": 2900 + }, + { + "id": "7f0f0d6e3eb5f8cb", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Update scene in selector", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_select.select_option", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_select.livingroom_scene_selector" + ], + "labelId": [], + "data": "{\"option\": msg.payload}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "input_select", + "service": "select_option", + "x": 1390, + "y": 2920 + }, + { + "id": "bb3c4a6174931a21", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Switch to Movie mode", + "wires": [ + [ + "7f0f0d6e3eb5f8cb" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Movie", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1080, + "y": 2900 + }, + { + "id": "71916041b8ca3d07", + "type": "change", + "z": "b70ee13eafa73823", + "name": "Switch to Movie pause mode", + "wires": [ + [ + "7f0f0d6e3eb5f8cb" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "Movie Pause", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 1100, + "y": 2940 + }, + { + "id": "dfd77a76dc2e0568", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Midday starts", + "wires": [ + [ + "6073e4e66bb6e228" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.midday_starts_ha" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "", + "forType": "num", + "forUnits": "milliseconds", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 130, + "y": 680 + }, + { + "id": "6073e4e66bb6e228", + "type": "subflow:be8264a322721305", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "f833288986e00ae0" + ] + ], + "x": 250, + "y": 740 + }, + { + "id": "afa6cccb1cfc8ddb", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Late afternoon starts", + "wires": [ + [ + "2e03442c0d67da32" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.late_afternoon_starts_ha" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "", + "forType": "num", + "forUnits": "milliseconds", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 150, + "y": 780 + }, + { + "id": "2e03442c0d67da32", + "type": "subflow:be8264a322721305", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "f833288986e00ae0" + ] + ], + "x": 270, + "y": 840 + }, + { + "id": "097585a397ef8e60", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Evening starts", + "wires": [ + [ + "67659db54987a408" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.evening_starts_ha" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "", + "forType": "num", + "forUnits": "milliseconds", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 130, + "y": 880 + }, + { + "id": "67659db54987a408", + "type": "subflow:be8264a322721305", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "f833288986e00ae0" + ] + ], + "x": 270, + "y": 940 + }, + { + "id": "a02362b40496cf27", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Late evening starts", + "wires": [ + [ + "a2f0111dc2cad4b2" + ] + ], + "d": true, + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.late_evening_starts_ha" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "", + "forType": "num", + "forUnits": "milliseconds", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 150, + "y": 980 + }, + { + "id": "a2f0111dc2cad4b2", + "type": "subflow:be8264a322721305", + "z": "b70ee13eafa73823", + "name": "", + "wires": [ + [ + "f833288986e00ae0" + ] + ], + "x": 270, + "y": 1040 + }, + { + "id": "f833288986e00ae0", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Livingroom lights on?", + "wires": [ + [ + "0836295ca0bc0df3", + "ce7a6033db2e3ffa" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "light.living_room", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 500, + "y": 520 + }, + { + "id": "613a9be150591ee7", + "type": "comment", + "z": "b70ee13eafa73823", + "name": "Harmony Remote Control", + "wires": [], + "info": "", + "x": 190, + "y": 3160 + }, + { + "id": "397fc02eaed29a41", + "type": "server-events", + "z": "b70ee13eafa73823", + "name": "Listen to roku command events", + "wires": [ + [ + "dcc93b3ba73bee14" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "exposeAsEntityConfig": "", + "eventType": "roku_command", + "eventData": "", + "waitForRunning": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "$outputData(\"eventData\").event_type", + "valueType": "jsonata" + } + ], + "x": 210, + "y": 3200 + }, + { + "id": "dcc93b3ba73bee14", + "type": "switch", + "z": "b70ee13eafa73823", + "name": "Event switch", + "wires": [ + [], + [ + "0cd947d505af3e73" + ], + [ + "1649296f3891a37c" + ], + [ + "8fd5e325dc59160a" + ], + [], + [ + "bb3c4a6174931a21" + ], + [ + "71916041b8ca3d07" + ], + [], + [], + [], + [], + [], + [] + ], + "property": "payload.event.key", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "Play", + "vt": "str" + }, + { + "t": "eq", + "v": "Rev", + "vt": "str" + }, + { + "t": "eq", + "v": "Fwd", + "vt": "str" + }, + { + "t": "eq", + "v": "Select", + "vt": "str" + }, + { + "t": "eq", + "v": "Home", + "vt": "str" + }, + { + "t": "eq", + "v": "Left", + "vt": "str" + }, + { + "t": "eq", + "v": "Right", + "vt": "str" + }, + { + "t": "eq", + "v": "Down", + "vt": "str" + }, + { + "t": "eq", + "v": "Up", + "vt": "str" + }, + { + "t": "eq", + "v": "Back", + "vt": "str" + }, + { + "t": "eq", + "v": "Info", + "vt": "str" + }, + { + "t": "eq", + "v": "PowerOn", + "vt": "str" + }, + { + "t": "eq", + "v": "PowerOff", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 13, + "x": 490, + "y": 3220 + }, + { + "id": "8fd5e325dc59160a", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Shift the scene", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_button.press", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_button.livingroom_shift_scene" + ], + "labelId": [], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": true, + "domain": "input_button", + "service": "press", + "x": 880, + "y": 3200 + }, + { + "id": "e04092e8f97898cf", + "type": "trigger", + "z": "b70ee13eafa73823", + "name": "wait 1 sec", + "wires": [ + [ + "dc7567e498a75b12" + ] + ], + "op1": "", + "op2": "", + "op1type": "nul", + "op2type": "pay", + "duration": "1", + "extend": false, + "overrideDelay": false, + "units": "s", + "reset": "", + "bytopic": "all", + "topic": "topic", + "outputs": 1, + "x": 340, + "y": 2920 + }, + { + "id": "ssc_motion_lr_19dda5bc955", + "type": "server-state-changed", + "z": "b70ee13eafa73823", + "name": "Livingroom Motion Sensor", + "wires": [ + [ + "ca7ee0d8f3f6d02e" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 2, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "binary_sensor.livingroom_motion_sensor_occupancy" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "on", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "", + "forType": "num", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": true, + "ignoreCurrentStateUnavailable": true, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 150, + "y": 580 + }, + { + "id": "ca7ee0d8f3f6d02e", + "type": "api-current-state", + "z": "b70ee13eafa73823", + "name": "Motion - lights already on?", + "wires": [ + [], + [ + "ec6ae14bf7d95e92" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "light.living_room", + "state_type": "str", + "blockInputOverrides": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "string", + "valueType": "entityState" + } + ], + "for": "0", + "forType": "num", + "forUnits": "minutes", + "override_topic": false, + "state_location": "payload", + "override_payload": "msg", + "entity_location": "data", + "override_data": "msg", + "x": 520, + "y": 580 + }, + { + "id": "dining_route_001", + "type": "function", + "z": "b70ee13eafa73823", + "name": "Swap to no-dining scene if dining table off", + "wires": [ + [ + "f07c5e952b2f368b" + ] + ], + "func": "const states = global.get('homeassistant')?.homeAssistantLatest?.states || {};\nconst diningOn = states['light.living_room_dining_table']?.state === 'on';\nif (!diningOn) {\n msg.entity_id = msg.entity_id.replace(/_ha$/, '') + '_no_dining';\n}\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1560, + "y": 160 + }, + { + "id": "dining_scene_toggle_001", + "type": "function", + "z": "b70ee13eafa73823", + "name": "Dining toggle: apply scene variant", + "wires": [ + [ + "dining_scene_apply_001" + ], + [ + "dining_light_off_001" + ], + [ + "dining_light_on_001" + ] + ], + "func": "const states = global.get('homeassistant')?.homeAssistantLatest?.states || {};\nconst diningOn = states['light.living_room_dining_table']?.state === 'on';\n\nconst mainLights = [\n 'light.living_room_ceiling_1',\n 'light.living_room_ceiling_2',\n 'light.living_room_ceiling_3',\n 'light.living_room_bookshelf',\n 'light.living_room_top_of_bar'\n];\nconst sceneActive = mainLights.some(id => states[id]?.state === 'on');\n\nif (!sceneActive) {\n return diningOn ? [null, { ...msg }, null] : [null, null, { ...msg }];\n}\n\nconst selectorName = states['input_select.livingroom_scene_selector']?.state || '';\nconst slug = selectorName.toLowerCase()\n .replace(/[^a-z0-9 ]/g, '')\n .trim()\n .replace(/ +/g, '_');\n\nconst sceneId = diningOn\n ? 'scene.livingroom_' + slug + '_no_dining'\n : 'scene.livingroom_' + slug + '_ha';\n\nreturn [{ ...msg, entity_id: sceneId }, diningOn ? { ...msg } : null, null];", + "outputs": 3, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1060, + "y": 1340 + }, + { + "id": "dining_scene_apply_001", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Apply scene variant", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "scene.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "{{ entity_id }}" + ], + "labelId": [], + "data": "{\"transition\":0.5}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "scene", + "service": "turn_on", + "x": 1300, + "y": 1300 + }, + { + "id": "dining_light_off_001", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Turn off dining lamp", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "light.turn_off", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_dining_table" + ], + "labelId": [], + "data": "{\"transition\":0.5}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "light", + "service": "turn_off", + "x": 1300, + "y": 1380 + }, + { + "id": "dining_light_on_001", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Turn on dining lamp", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.living_room_dining_table" + ], + "labelId": [], + "data": "{\"transition\":0.5}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "all", + "blockInputOverrides": false, + "domain": "light", + "service": "turn_on", + "x": 1300, + "y": 1460 + }, + { + "id": "p2catch_lr", + "type": "catch", + "z": "b70ee13eafa73823", + "name": "Catch all errors", + "wires": [ + [ + "p2fmt_lr" + ] + ], + "scope": null, + "uncaught": false, + "x": 160, + "y": 3860 + }, + { + "id": "p2fmt_lr", + "type": "function", + "z": "b70ee13eafa73823", + "name": "Format error", + "wires": [ + [ + "p2ntfy_lr" + ] + ], + "func": "const err = (msg.error && msg.error.message) ? msg.error.message : String(msg.payload || 'Unknown error');\nconst src = (msg.error && msg.error.source) ? (msg.error.source.name || msg.error.source.id || '') : '';\nmsg.payload = JSON.stringify({\n title: 'Node-RED Error: Living room',\n message: err + (src ? '\\n\\nNode: ' + src : '')\n});\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "timeout": "", + "x": 400, + "y": 3860 + }, + { + "id": "p2ntfy_lr", + "type": "api-call-service", + "z": "b70ee13eafa73823", + "name": "Notify error", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{{{payload}}}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 660, + "y": 3860 } ] \ No newline at end of file