Handler for Tina Desk Scenes
This commit is contained in:
359
flows.json
359
flows.json
@ -597,6 +597,38 @@
|
|||||||
],
|
],
|
||||||
"icon": "node-red-contrib-huemagic/hue-light.svg"
|
"icon": "node-red-contrib-huemagic/hue-light.svg"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "85c4f81ca9628aea",
|
||||||
|
"type": "subflow",
|
||||||
|
"name": "Tina Desk Scenes Handler",
|
||||||
|
"info": "",
|
||||||
|
"category": "",
|
||||||
|
"in": [
|
||||||
|
{
|
||||||
|
"x": 140,
|
||||||
|
"y": 340,
|
||||||
|
"wires": [
|
||||||
|
{
|
||||||
|
"id": "d0822c2e7fdff092"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"out": [],
|
||||||
|
"env": [],
|
||||||
|
"meta": {},
|
||||||
|
"color": "#DDAA99",
|
||||||
|
"status": {
|
||||||
|
"x": 960,
|
||||||
|
"y": 340,
|
||||||
|
"wires": [
|
||||||
|
{
|
||||||
|
"id": "8ad119b6c6e11ddd",
|
||||||
|
"port": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "eccca853a916b662",
|
"id": "eccca853a916b662",
|
||||||
"type": "group",
|
"type": "group",
|
||||||
@ -1210,9 +1242,7 @@
|
|||||||
"528d5448879fd3db"
|
"528d5448879fd3db"
|
||||||
],
|
],
|
||||||
"x": 54,
|
"x": 54,
|
||||||
"y": 19,
|
"y": 19
|
||||||
"w": 2092,
|
|
||||||
"h": 282
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "0c81dfaed25d225c",
|
"id": "0c81dfaed25d225c",
|
||||||
@ -4743,6 +4773,110 @@
|
|||||||
"y": 140,
|
"y": 140,
|
||||||
"wires": []
|
"wires": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "655050669e5ccf85",
|
||||||
|
"type": "api-call-service",
|
||||||
|
"z": "85c4f81ca9628aea",
|
||||||
|
"name": "Set Scene",
|
||||||
|
"server": "9e87348d.9c1c48",
|
||||||
|
"version": 5,
|
||||||
|
"debugenabled": false,
|
||||||
|
"domain": "scene",
|
||||||
|
"service": "turn_on",
|
||||||
|
"areaId": [],
|
||||||
|
"deviceId": [],
|
||||||
|
"entityId": [
|
||||||
|
"scene.{{payload}}_in_{{topic}}"
|
||||||
|
],
|
||||||
|
"data": "",
|
||||||
|
"dataType": "jsonata",
|
||||||
|
"mergeContext": "",
|
||||||
|
"mustacheAltTags": false,
|
||||||
|
"outputProperties": [],
|
||||||
|
"queue": "none",
|
||||||
|
"x": 670,
|
||||||
|
"y": 340,
|
||||||
|
"wires": [
|
||||||
|
[
|
||||||
|
"8ad119b6c6e11ddd"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8ad119b6c6e11ddd",
|
||||||
|
"type": "function",
|
||||||
|
"z": "85c4f81ca9628aea",
|
||||||
|
"name": "Format",
|
||||||
|
"func": "const str = msg.payload\nvar scene = str.replaceAll(\"_\",\" \")\n\nmsg.dest = msg.topic\n\nmsg.topic = \"Lights Changed\"\nmsg.payload = ('Lights changed to a new scene: ' + scene)\n\nif (msg.payload === 'Lights changed to a new scene: Reset') {\n return null;\n} else {\n return msg;\n}\nreturn msg;",
|
||||||
|
"outputs": 1,
|
||||||
|
"noerr": 0,
|
||||||
|
"initialize": "",
|
||||||
|
"finalize": "",
|
||||||
|
"libs": [],
|
||||||
|
"x": 840,
|
||||||
|
"y": 340,
|
||||||
|
"wires": [
|
||||||
|
[]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "78a73c2d816658d8",
|
||||||
|
"type": "subflow:582b8363c9f33bf8",
|
||||||
|
"z": "85c4f81ca9628aea",
|
||||||
|
"name": "",
|
||||||
|
"x": 710,
|
||||||
|
"y": 420,
|
||||||
|
"wires": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "493106346f58ba03",
|
||||||
|
"type": "switch",
|
||||||
|
"z": "85c4f81ca9628aea",
|
||||||
|
"name": "",
|
||||||
|
"property": "payload",
|
||||||
|
"propertyType": "msg",
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"t": "eq",
|
||||||
|
"v": "Select",
|
||||||
|
"vt": "str"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"t": "else"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"checkall": "true",
|
||||||
|
"repair": false,
|
||||||
|
"outputs": 2,
|
||||||
|
"x": 470,
|
||||||
|
"y": 340,
|
||||||
|
"wires": [
|
||||||
|
[],
|
||||||
|
[
|
||||||
|
"78a73c2d816658d8",
|
||||||
|
"655050669e5ccf85"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d0822c2e7fdff092",
|
||||||
|
"type": "function",
|
||||||
|
"z": "85c4f81ca9628aea",
|
||||||
|
"name": "Remove Spaces",
|
||||||
|
"func": "var str = msg.payload\nmsg.payload = str.replaceAll(\" \",\"_\")\nreturn msg;",
|
||||||
|
"outputs": 1,
|
||||||
|
"noerr": 0,
|
||||||
|
"initialize": "",
|
||||||
|
"finalize": "",
|
||||||
|
"libs": [],
|
||||||
|
"x": 300,
|
||||||
|
"y": 340,
|
||||||
|
"wires": [
|
||||||
|
[
|
||||||
|
"493106346f58ba03"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "cc8645ebae721601",
|
"id": "cc8645ebae721601",
|
||||||
"type": "api-current-state",
|
"type": "api-current-state",
|
||||||
@ -7622,7 +7756,9 @@
|
|||||||
"x": 1590,
|
"x": 1590,
|
||||||
"y": 360,
|
"y": 360,
|
||||||
"wires": [
|
"wires": [
|
||||||
[]
|
[
|
||||||
|
"fc85ca4a4c57b5bf"
|
||||||
|
]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -8420,6 +8556,33 @@
|
|||||||
[]
|
[]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "fc85ca4a4c57b5bf",
|
||||||
|
"type": "api-call-service",
|
||||||
|
"z": "e44b1e7a8ef7ae1d",
|
||||||
|
"name": "Reset Scene Text",
|
||||||
|
"server": "9e87348d.9c1c48",
|
||||||
|
"version": 5,
|
||||||
|
"debugenabled": false,
|
||||||
|
"domain": "input_text",
|
||||||
|
"service": "set_value",
|
||||||
|
"areaId": [],
|
||||||
|
"deviceId": [],
|
||||||
|
"entityId": [
|
||||||
|
"input_text.tina_desk_selected_scene"
|
||||||
|
],
|
||||||
|
"data": "{\t \"value\":\"Day Mode\"\t}",
|
||||||
|
"dataType": "jsonata",
|
||||||
|
"mergeContext": "",
|
||||||
|
"mustacheAltTags": false,
|
||||||
|
"outputProperties": [],
|
||||||
|
"queue": "none",
|
||||||
|
"x": 1810,
|
||||||
|
"y": 360,
|
||||||
|
"wires": [
|
||||||
|
[]
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "134433d6e21dab5b",
|
"id": "134433d6e21dab5b",
|
||||||
"type": "server-state-changed",
|
"type": "server-state-changed",
|
||||||
@ -9077,7 +9240,8 @@
|
|||||||
"y": 340,
|
"y": 340,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"9ae7e308f889137d"
|
"9ae7e308f889137d",
|
||||||
|
"d97b9088ab92e31d"
|
||||||
],
|
],
|
||||||
[]
|
[]
|
||||||
]
|
]
|
||||||
@ -9632,6 +9796,101 @@
|
|||||||
[]
|
[]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "ddf5b7633f597aef",
|
||||||
|
"type": "api-call-service",
|
||||||
|
"z": "3abb5ae57afb4761",
|
||||||
|
"name": "Night Mode",
|
||||||
|
"server": "9e87348d.9c1c48",
|
||||||
|
"version": 5,
|
||||||
|
"debugenabled": false,
|
||||||
|
"domain": "input_select",
|
||||||
|
"service": "select_option",
|
||||||
|
"areaId": [],
|
||||||
|
"deviceId": [],
|
||||||
|
"entityId": [
|
||||||
|
"input_select.tina_desk_scenes"
|
||||||
|
],
|
||||||
|
"data": "{\t \"option\":\"Night Mode\"\t}",
|
||||||
|
"dataType": "jsonata",
|
||||||
|
"mergeContext": "",
|
||||||
|
"mustacheAltTags": false,
|
||||||
|
"outputProperties": [],
|
||||||
|
"queue": "none",
|
||||||
|
"x": 1310,
|
||||||
|
"y": 240,
|
||||||
|
"wires": [
|
||||||
|
[]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d97b9088ab92e31d",
|
||||||
|
"type": "api-current-state",
|
||||||
|
"z": "3abb5ae57afb4761",
|
||||||
|
"name": "Early Night Mode?",
|
||||||
|
"server": "9e87348d.9c1c48",
|
||||||
|
"version": 3,
|
||||||
|
"outputs": 2,
|
||||||
|
"halt_if": "on",
|
||||||
|
"halt_if_type": "str",
|
||||||
|
"halt_if_compare": "is",
|
||||||
|
"entity_id": "input_boolean.early_night_mode",
|
||||||
|
"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": 1110,
|
||||||
|
"y": 280,
|
||||||
|
"wires": [
|
||||||
|
[
|
||||||
|
"ddf5b7633f597aef"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"b8e7db3f58ef8d8d"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b8e7db3f58ef8d8d",
|
||||||
|
"type": "api-call-service",
|
||||||
|
"z": "3abb5ae57afb4761",
|
||||||
|
"name": "Day Mode",
|
||||||
|
"server": "9e87348d.9c1c48",
|
||||||
|
"version": 5,
|
||||||
|
"debugenabled": false,
|
||||||
|
"domain": "input_select",
|
||||||
|
"service": "select_option",
|
||||||
|
"areaId": [],
|
||||||
|
"deviceId": [],
|
||||||
|
"entityId": [
|
||||||
|
"input_select.tina_desk_scenes"
|
||||||
|
],
|
||||||
|
"data": "{\t \"option\":\"Day Mode\"\t}",
|
||||||
|
"dataType": "jsonata",
|
||||||
|
"mergeContext": "",
|
||||||
|
"mustacheAltTags": false,
|
||||||
|
"outputProperties": [],
|
||||||
|
"queue": "none",
|
||||||
|
"x": 1310,
|
||||||
|
"y": 300,
|
||||||
|
"wires": [
|
||||||
|
[]
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "d95d9964546768a5",
|
"id": "d95d9964546768a5",
|
||||||
"type": "server-state-changed",
|
"type": "server-state-changed",
|
||||||
@ -9973,7 +10232,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"x": 100,
|
"x": 100,
|
||||||
"y": 420,
|
"y": 620,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"dfac5d681cf62083"
|
"dfac5d681cf62083"
|
||||||
@ -10001,7 +10260,7 @@
|
|||||||
"to": "",
|
"to": "",
|
||||||
"reg": false,
|
"reg": false,
|
||||||
"x": 290,
|
"x": 290,
|
||||||
"y": 480,
|
"y": 680,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"dfac5d681cf62083"
|
"dfac5d681cf62083"
|
||||||
@ -10018,7 +10277,7 @@
|
|||||||
"payloadval": "0",
|
"payloadval": "0",
|
||||||
"name": "",
|
"name": "",
|
||||||
"x": 500,
|
"x": 500,
|
||||||
"y": 420,
|
"y": 620,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"5123a607588fa737"
|
"5123a607588fa737"
|
||||||
@ -10050,7 +10309,7 @@
|
|||||||
"output_location": "",
|
"output_location": "",
|
||||||
"output_location_type": "none",
|
"output_location_type": "none",
|
||||||
"x": 690,
|
"x": 690,
|
||||||
"y": 420,
|
"y": 620,
|
||||||
"wires": [
|
"wires": [
|
||||||
[]
|
[]
|
||||||
]
|
]
|
||||||
@ -10111,7 +10370,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"x": 100,
|
"x": 100,
|
||||||
"y": 480,
|
"y": 680,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"6755b1d81f7356ad"
|
"6755b1d81f7356ad"
|
||||||
@ -10126,7 +10385,7 @@
|
|||||||
"name": "Downstairs Bathroom",
|
"name": "Downstairs Bathroom",
|
||||||
"info": "",
|
"info": "",
|
||||||
"x": 300,
|
"x": 300,
|
||||||
"y": 420,
|
"y": 620,
|
||||||
"wires": []
|
"wires": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -10245,7 +10504,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"x": 100,
|
"x": 100,
|
||||||
"y": 540,
|
"y": 740,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"f0ef9a565f72dcae"
|
"f0ef9a565f72dcae"
|
||||||
@ -10275,7 +10534,7 @@
|
|||||||
"outputProperties": [],
|
"outputProperties": [],
|
||||||
"queue": "none",
|
"queue": "none",
|
||||||
"x": 530,
|
"x": 530,
|
||||||
"y": 540,
|
"y": 740,
|
||||||
"wires": [
|
"wires": [
|
||||||
[]
|
[]
|
||||||
]
|
]
|
||||||
@ -10311,7 +10570,7 @@
|
|||||||
"entity_location": "data",
|
"entity_location": "data",
|
||||||
"override_data": "msg",
|
"override_data": "msg",
|
||||||
"x": 310,
|
"x": 310,
|
||||||
"y": 540,
|
"y": 740,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"5e7a082800eeb73c"
|
"5e7a082800eeb73c"
|
||||||
@ -10319,6 +10578,78 @@
|
|||||||
[]
|
[]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "5a81041c4a1390b8",
|
||||||
|
"type": "server-state-changed",
|
||||||
|
"z": "eff21041cc941fef",
|
||||||
|
"name": "Tina Desk Scenes",
|
||||||
|
"server": "9e87348d.9c1c48",
|
||||||
|
"version": 4,
|
||||||
|
"exposeToHomeAssistant": false,
|
||||||
|
"haConfig": [
|
||||||
|
{
|
||||||
|
"property": "name",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"property": "icon",
|
||||||
|
"value": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"entityidfilter": "input_select.tina_desk_scenes",
|
||||||
|
"entityidfiltertype": "exact",
|
||||||
|
"outputinitially": false,
|
||||||
|
"state_type": "str",
|
||||||
|
"haltifstate": "",
|
||||||
|
"halt_if_type": "str",
|
||||||
|
"halt_if_compare": "is",
|
||||||
|
"outputs": 1,
|
||||||
|
"output_only_on_state_change": true,
|
||||||
|
"for": "0",
|
||||||
|
"forType": "num",
|
||||||
|
"forUnits": "minutes",
|
||||||
|
"ignorePrevStateNull": false,
|
||||||
|
"ignorePrevStateUnknown": false,
|
||||||
|
"ignorePrevStateUnavailable": false,
|
||||||
|
"ignoreCurrentStateUnknown": false,
|
||||||
|
"ignoreCurrentStateUnavailable": false,
|
||||||
|
"outputProperties": [
|
||||||
|
{
|
||||||
|
"property": "payload",
|
||||||
|
"propertyType": "msg",
|
||||||
|
"value": "",
|
||||||
|
"valueType": "entityState"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"property": "topic",
|
||||||
|
"propertyType": "msg",
|
||||||
|
"value": "tina_desk",
|
||||||
|
"valueType": "str"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"property": "include",
|
||||||
|
"propertyType": "msg",
|
||||||
|
"value": "dining_room",
|
||||||
|
"valueType": "str"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"x": 110,
|
||||||
|
"y": 400,
|
||||||
|
"wires": [
|
||||||
|
[
|
||||||
|
"b19f4a996fd4c2ee"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b19f4a996fd4c2ee",
|
||||||
|
"type": "subflow:85c4f81ca9628aea",
|
||||||
|
"z": "eff21041cc941fef",
|
||||||
|
"name": "",
|
||||||
|
"x": 590,
|
||||||
|
"y": 400,
|
||||||
|
"wires": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "879ee8903841b8f0",
|
"id": "879ee8903841b8f0",
|
||||||
"type": "server-state-changed",
|
"type": "server-state-changed",
|
||||||
|
Reference in New Issue
Block a user