diff --git a/.config.users.json b/.config.users.json index 80ae2c2..7370482 100644 --- a/.config.users.json +++ b/.config.users.json @@ -17,8 +17,10 @@ } }, "debug": { - "filter": "filterCurrent", - "filteredNodes": [], + "filter": "filterSelected", + "filteredNodes": [ + "8f36fe00cbd87c8b" + ], "clearType": "all" }, "menu-menu-item-sidebar": true, diff --git a/.config.users.json.backup b/.config.users.json.backup index 7a54ea8..24bb921 100644 --- a/.config.users.json.backup +++ b/.config.users.json.backup @@ -17,9 +17,12 @@ } }, "debug": { - "filter": "filterCurrent", - "filteredNodes": [], - "clearType": "filtered" + "filter": "filterSelected", + "filteredNodes": [ + "9a65295b93ac3155", + "8f36fe00cbd87c8b" + ], + "clearType": "all" }, "menu-menu-item-sidebar": true, "menu-menu-item-palette": true diff --git a/.flows.json.backup b/.flows.json.backup index 57fa4bb..30f44fb 100644 --- a/.flows.json.backup +++ b/.flows.json.backup @@ -1457,7 +1457,7 @@ "name": "", "group": "8bb63e2d106e61a9", "order": 7, - "width": "4", + "width": "2", "height": "1", "passthru": false, "label": "", @@ -2790,11 +2790,11 @@ "type": "function", "z": "8e9c7f123e3fa72b", "name": "ButtonCtrl", - "func": "if (msg.topic != topic_tx_request)\n{\n // Inputs \n if (debug_input) node.warn(\"Topic = \" + msg.topic)\n /*\n * POWER\n */\n if (msg.topic == topic_power)\n {\n if (debug_input) node.warn(\"Received Power signal = \" + msg.payload)\n state_power = msg.payload\n }\n /*\n * SOURCE CD\n */\n if (msg.topic == topic_cd)\n {\n if (debug_input) node.warn(\"Received source to CD\")\n state_changed |= state_source != \"cd\"\n state_source = \"cd\"\n }\n /*\n * SOURCE AG03\n */\n if (msg.topic == topic_ag03)\n {\n if (debug_input) node.warn(\"Received source to AG03\")\n state_changed |= state_source != \"ag03\"\n state_source = \"ag03\"\n }\n /*\n * SOURCE RASPI\n */\n if (msg.topic == topic_raspi)\n {\n if (debug_input) node.warn(\"Received source to RASPI\")\n state_changed |= state_source != \"raspi\"\n state_source = \"raspi\"\n }\n /*\n * SOURCE PHONO\n */\n if (msg.topic == topic_phono)\n {\n if (debug_input) node.warn(\"Received source to PHONO\")\n state_changed |= state_source != \"phono\"\n state_source = \"phono\"\n }\n}\nelse\n{\n /*\n * Enabled\n */\n if (!state_power)\n {\n state_changed |= state_enabled \n state_enabled = false\n tm = null\n }\n else\n {\n if (tm == null)\n {\n tm = msg.payload\n }\n if (msg.payload - tm > 1000)\n {\n state_changed |= !state_enabled \n state_enabled = true\n }\n }\n \n if (state_changed){\n if (debug_tx) node.error(\"State is changed. Sending out messages\")\n if (debug_tx) node.warn(\"Power = \" + state_power)\n if (debug_tx) node.warn(\"Source = \" + state_source)\n state_changed = false\n /*\n * Uncolored Buttons\n */\n var msg_other = { topic: \"other\", enabled: state_enabled };\n /*\n * CD\n */\n if (state_source == \"cd\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_cd = { topic: \"cd\", enabled: state_enabled, background: background };\n /*\n * RASPI\n */\n if (state_source == \"raspi\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_raspi = { topic: \"raspi\", enabled: state_enabled, background: background };\n /*\n * PHONO\n */\n if (state_source == \"phono\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_phono = { topic: \"phono\", enabled: state_enabled, background: background };\n /*\n * AG03\n */\n if (state_source == \"ag03\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_ag03 = { topic: \"ag03\", enabled: state_enabled, background: background };\n //\n return [msg_other, msg_cd, msg_raspi, msg_phono, msg_ag03];\n }\n}", - "outputs": 5, + "func": "if (msg.topic != topic_tx_request)\n{\n // Inputs \n if (debug_input) node.warn(\"Topic = \" + msg.topic)\n /*\n * POWER\n */\n if (msg.topic == topic_power)\n {\n if (debug_input) node.warn(\"Received Power signal = \" + msg.payload)\n state_power = msg.payload\n }\n /*\n * SOURCE CD\n */\n if (msg.topic == topic_cd)\n {\n if (debug_input) node.warn(\"Received source to CD\")\n state_changed |= state_source != \"cd\"\n state_source = \"cd\"\n }\n /*\n * SOURCE AG03\n */\n if (msg.topic == topic_ag03)\n {\n if (debug_input) node.warn(\"Received source to AG03\")\n state_changed |= state_source != \"ag03\"\n state_source = \"ag03\"\n }\n /*\n * SOURCE RASPI\n */\n if (msg.topic == topic_raspi)\n {\n if (debug_input) node.warn(\"Received source to RASPI\")\n state_changed |= state_source != \"raspi\"\n state_source = \"raspi\"\n }\n /*\n * SOURCE BT\n */\n if (msg.topic == topic_bt)\n {\n if (debug_input) node.warn(\"Received source to BT\")\n state_changed |= state_source != \"bt\"\n state_source = \"bt\"\n }\n /*\n * SOURCE PHONO\n */\n if (msg.topic == topic_phono)\n {\n if (debug_input) node.warn(\"Received source to PHONO\")\n state_changed |= state_source != \"phono\"\n state_source = \"phono\"\n }\n}\nelse\n{\n /*\n * Enabled\n */\n if (!state_power)\n {\n state_changed |= state_enabled \n state_enabled = false\n tm = null\n }\n else\n {\n if (tm == null)\n {\n tm = msg.payload\n }\n if (msg.payload - tm > 1000)\n {\n state_changed |= !state_enabled \n state_enabled = true\n }\n }\n \n if (state_changed){\n if (debug_tx) node.error(\"State is changed. Sending out messages\")\n if (debug_tx) node.warn(\"Power = \" + state_power)\n if (debug_tx) node.warn(\"Source = \" + state_source)\n state_changed = false\n /*\n * Uncolored Buttons\n */\n var msg_other = { topic: \"other\", enabled: state_enabled };\n /*\n * CD\n */\n if (state_source == \"cd\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_cd = { topic: \"cd\", enabled: state_enabled, background: background };\n /*\n * RASPI\n */\n if (state_source == \"raspi\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_raspi = { topic: \"raspi\", enabled: state_enabled, background: background };\n /*\n * PHONO\n */\n if (state_source == \"bt\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_bt = { topic: \"bt\", enabled: state_enabled, background: background };\n if (state_source == \"phono\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_phono = { topic: \"phono\", enabled: state_enabled, background: background };\n /*\n * AG03\n */\n if (state_source == \"ag03\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_ag03 = { topic: \"ag03\", enabled: state_enabled, background: background };\n //\n return [msg_other, msg_cd, msg_raspi, msg_bt, msg_ag03, msg_phono];\n }\n}", + "outputs": 6, "timeout": 0, "noerr": 0, - "initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\ndebug_input = false\ndebug_tx = false\n//\ntopic_power = \"my_apps/gfw/dirk/powerplug/output/1\"\ntopic_cd = \"my_apps/gfw/dirk/remote_ctrl/RAS5/CD\"\ntopic_raspi = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE1\"\ntopic_phono = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE2\"\ntopic_ag03 = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE3\"\ntopic_tx_request = \"tx_request\"\n//\nstate_power = false\nstate_enabled = false\nstate_source = \"\"\nstate_changed = true\n//\ntm = null", + "initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\ndebug_input = false\ndebug_tx = false\n//\ntopic_power = \"my_apps/gfw/dirk/powerplug/output/1\"\ntopic_cd = \"my_apps/gfw/dirk/remote_ctrl/RAS5/CD\"\ntopic_raspi = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE1\"\ntopic_bt = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE2\"\ntopic_phono = \"my_apps/gfw/dirk/remote_ctrl/RAS5/PHONO\"\ntopic_ag03 = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE3\"\ntopic_tx_request = \"tx_request\"\n//\nstate_power = false\nstate_enabled = false\nstate_source = \"\"\nstate_changed = true\n//\ntm = null", "finalize": "", "libs": [], "x": 600, @@ -2811,10 +2811,14 @@ "9e8359b1ca5e794c" ], [ - "fa0a223ba05e771a" + "fa0a223ba05e771a", + "9a65295b93ac3155" ], [ "a7ee780fe5879b1a" + ], + [ + "f46904eacb6aa8cd" ] ] }, @@ -3002,6 +3006,90 @@ "y": 1160, "wires": [] }, + { + "id": "7766316408fa0521", + "type": "mqtt in", + "z": "8e9c7f123e3fa72b", + "name": "", + "topic": "my_apps/gfw/dirk/remote_ctrl/RAS5/PHONO", + "qos": "2", + "datatype": "json", + "broker": "f6f673e95e75873d", + "nl": false, + "rap": true, + "rh": 0, + "inputs": 0, + "x": 210, + "y": 2800, + "wires": [ + [ + "87fdd7ab519e84b8" + ] + ] + }, + { + "id": "f46904eacb6aa8cd", + "type": "ui_button", + "z": "8e9c7f123e3fa72b", + "name": "", + "group": "8bb63e2d106e61a9", + "order": 4, + "width": "2", + "height": "1", + "passthru": false, + "label": "PHONO", + "tooltip": "", + "color": "", + "bgcolor": "{{msg.background}}", + "className": "", + "icon": "", + "payload": "true", + "payloadType": "bool", + "topic": "topic", + "topicType": "msg", + "x": 1120, + "y": 2800, + "wires": [ + [ + "44d87762f26fac90" + ] + ] + }, + { + "id": "44d87762f26fac90", + "type": "mqtt out", + "z": "8e9c7f123e3fa72b", + "name": "", + "topic": "my_apps/gfw/dirk/remote_ctrl/RAS5/PHONO", + "qos": "", + "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", + "broker": "f6f673e95e75873d", + "x": 1470, + "y": 2800, + "wires": [] + }, + { + "id": "9a65295b93ac3155", + "type": "debug", + "z": "8e9c7f123e3fa72b", + "name": "debug 2", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 1120, + "y": 2860, + "wires": [] + }, { "id": "3261d3bb95b50d09", "type": "comment", @@ -6308,7 +6396,7 @@ "topicType": "str", "min": 0, "max": "100", - "step": 1, + "step": "5", "className": "", "x": 660, "y": 1600, diff --git a/flows.json b/flows.json index 7841ffb..5ae0deb 100644 --- a/flows.json +++ b/flows.json @@ -1457,7 +1457,7 @@ "name": "", "group": "8bb63e2d106e61a9", "order": 7, - "width": "4", + "width": "2", "height": "1", "passthru": false, "label": "", @@ -2790,11 +2790,11 @@ "type": "function", "z": "8e9c7f123e3fa72b", "name": "ButtonCtrl", - "func": "if (msg.topic != topic_tx_request)\n{\n // Inputs \n if (debug_input) node.warn(\"Topic = \" + msg.topic)\n /*\n * POWER\n */\n if (msg.topic == topic_power)\n {\n if (debug_input) node.warn(\"Received Power signal = \" + msg.payload)\n state_power = msg.payload\n }\n /*\n * SOURCE CD\n */\n if (msg.topic == topic_cd)\n {\n if (debug_input) node.warn(\"Received source to CD\")\n state_changed |= state_source != \"cd\"\n state_source = \"cd\"\n }\n /*\n * SOURCE AG03\n */\n if (msg.topic == topic_ag03)\n {\n if (debug_input) node.warn(\"Received source to AG03\")\n state_changed |= state_source != \"ag03\"\n state_source = \"ag03\"\n }\n /*\n * SOURCE RASPI\n */\n if (msg.topic == topic_raspi)\n {\n if (debug_input) node.warn(\"Received source to RASPI\")\n state_changed |= state_source != \"raspi\"\n state_source = \"raspi\"\n }\n /*\n * SOURCE PHONO\n */\n if (msg.topic == topic_phono)\n {\n if (debug_input) node.warn(\"Received source to PHONO\")\n state_changed |= state_source != \"phono\"\n state_source = \"phono\"\n }\n}\nelse\n{\n /*\n * Enabled\n */\n if (!state_power)\n {\n state_changed |= state_enabled \n state_enabled = false\n tm = null\n }\n else\n {\n if (tm == null)\n {\n tm = msg.payload\n }\n if (msg.payload - tm > 1000)\n {\n state_changed |= !state_enabled \n state_enabled = true\n }\n }\n \n if (state_changed){\n if (debug_tx) node.error(\"State is changed. Sending out messages\")\n if (debug_tx) node.warn(\"Power = \" + state_power)\n if (debug_tx) node.warn(\"Source = \" + state_source)\n state_changed = false\n /*\n * Uncolored Buttons\n */\n var msg_other = { topic: \"other\", enabled: state_enabled };\n /*\n * CD\n */\n if (state_source == \"cd\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_cd = { topic: \"cd\", enabled: state_enabled, background: background };\n /*\n * RASPI\n */\n if (state_source == \"raspi\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_raspi = { topic: \"raspi\", enabled: state_enabled, background: background };\n /*\n * PHONO\n */\n if (state_source == \"phono\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_phono = { topic: \"phono\", enabled: state_enabled, background: background };\n /*\n * AG03\n */\n if (state_source == \"ag03\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_ag03 = { topic: \"ag03\", enabled: state_enabled, background: background };\n //\n return [msg_other, msg_cd, msg_raspi, msg_phono, msg_ag03];\n }\n}", - "outputs": 5, + "func": "if (msg.topic != topic_tx_request)\n{\n // Inputs \n if (debug_input) node.warn(\"Topic = \" + msg.topic)\n /*\n * POWER\n */\n if (msg.topic == topic_power)\n {\n if (debug_input) node.warn(\"Received Power signal = \" + msg.payload)\n state_power = msg.payload\n }\n /*\n * SOURCE CD\n */\n if (msg.topic == topic_cd)\n {\n if (debug_input) node.warn(\"Received source to CD\")\n state_changed |= state_source != \"cd\"\n state_source = \"cd\"\n }\n /*\n * SOURCE AG03\n */\n if (msg.topic == topic_ag03)\n {\n if (debug_input) node.warn(\"Received source to AG03\")\n state_changed |= state_source != \"ag03\"\n state_source = \"ag03\"\n }\n /*\n * SOURCE RASPI\n */\n if (msg.topic == topic_raspi)\n {\n if (debug_input) node.warn(\"Received source to RASPI\")\n state_changed |= state_source != \"raspi\"\n state_source = \"raspi\"\n }\n /*\n * SOURCE BT\n */\n if (msg.topic == topic_bt)\n {\n if (debug_input) node.warn(\"Received source to BT\")\n state_changed |= state_source != \"bt\"\n state_source = \"bt\"\n }\n /*\n * SOURCE PHONO\n */\n if (msg.topic == topic_phono)\n {\n if (debug_input) node.warn(\"Received source to PHONO\")\n state_changed |= state_source != \"phono\"\n state_source = \"phono\"\n }\n}\nelse\n{\n /*\n * Enabled\n */\n if (!state_power)\n {\n state_changed |= state_enabled \n state_enabled = false\n tm = null\n }\n else\n {\n if (tm == null)\n {\n tm = msg.payload\n }\n if (msg.payload - tm > 1000)\n {\n state_changed |= !state_enabled \n state_enabled = true\n }\n }\n \n if (state_changed){\n if (debug_tx) node.error(\"State is changed. Sending out messages\")\n if (debug_tx) node.warn(\"Power = \" + state_power)\n if (debug_tx) node.warn(\"Source = \" + state_source)\n state_changed = false\n /*\n * Uncolored Buttons\n */\n var msg_other = { topic: \"other\", enabled: state_enabled };\n /*\n * CD\n */\n if (state_source == \"cd\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_cd = { topic: \"cd\", enabled: state_enabled, background: background };\n /*\n * RASPI\n */\n if (state_source == \"raspi\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_raspi = { topic: \"raspi\", enabled: state_enabled, background: background };\n /*\n * PHONO\n */\n if (state_source == \"bt\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_bt = { topic: \"bt\", enabled: state_enabled, background: background };\n if (state_source == \"phono\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_phono = { topic: \"phono\", enabled: state_enabled, background: background };\n /*\n * AG03\n */\n if (state_source == \"ag03\")\n {\n background = \"#257ce0\"\n }\n else\n {\n background = \"#007b6d\"\n \n }\n var msg_ag03 = { topic: \"ag03\", enabled: state_enabled, background: background };\n //\n return [msg_other, msg_cd, msg_raspi, msg_bt, msg_ag03, msg_phono];\n }\n}", + "outputs": 6, "timeout": 0, "noerr": 0, - "initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\ndebug_input = false\ndebug_tx = false\n//\ntopic_power = \"my_apps/gfw/dirk/powerplug/output/1\"\ntopic_cd = \"my_apps/gfw/dirk/remote_ctrl/RAS5/CD\"\ntopic_raspi = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE1\"\ntopic_phono = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE2\"\ntopic_ag03 = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE3\"\ntopic_tx_request = \"tx_request\"\n//\nstate_power = false\nstate_enabled = false\nstate_source = \"\"\nstate_changed = true\n//\ntm = null", + "initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\ndebug_input = false\ndebug_tx = false\n//\ntopic_power = \"my_apps/gfw/dirk/powerplug/output/1\"\ntopic_cd = \"my_apps/gfw/dirk/remote_ctrl/RAS5/CD\"\ntopic_raspi = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE1\"\ntopic_bt = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE2\"\ntopic_phono = \"my_apps/gfw/dirk/remote_ctrl/RAS5/PHONO\"\ntopic_ag03 = \"my_apps/gfw/dirk/remote_ctrl/RAS5/LINE3\"\ntopic_tx_request = \"tx_request\"\n//\nstate_power = false\nstate_enabled = false\nstate_source = \"\"\nstate_changed = true\n//\ntm = null", "finalize": "", "libs": [], "x": 600, @@ -2815,6 +2815,9 @@ ], [ "a7ee780fe5879b1a" + ], + [ + "f46904eacb6aa8cd" ] ] }, @@ -3002,6 +3005,73 @@ "y": 1160, "wires": [] }, + { + "id": "7766316408fa0521", + "type": "mqtt in", + "z": "8e9c7f123e3fa72b", + "name": "", + "topic": "my_apps/gfw/dirk/remote_ctrl/RAS5/PHONO", + "qos": "2", + "datatype": "json", + "broker": "f6f673e95e75873d", + "nl": false, + "rap": true, + "rh": 0, + "inputs": 0, + "x": 210, + "y": 2800, + "wires": [ + [ + "87fdd7ab519e84b8" + ] + ] + }, + { + "id": "f46904eacb6aa8cd", + "type": "ui_button", + "z": "8e9c7f123e3fa72b", + "name": "", + "group": "8bb63e2d106e61a9", + "order": 4, + "width": "2", + "height": "1", + "passthru": false, + "label": "PHONO", + "tooltip": "", + "color": "", + "bgcolor": "{{msg.background}}", + "className": "", + "icon": "", + "payload": "true", + "payloadType": "bool", + "topic": "topic", + "topicType": "msg", + "x": 1120, + "y": 2800, + "wires": [ + [ + "44d87762f26fac90" + ] + ] + }, + { + "id": "44d87762f26fac90", + "type": "mqtt out", + "z": "8e9c7f123e3fa72b", + "name": "", + "topic": "my_apps/gfw/dirk/remote_ctrl/RAS5/PHONO", + "qos": "", + "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", + "broker": "f6f673e95e75873d", + "x": 1470, + "y": 2800, + "wires": [] + }, { "id": "3261d3bb95b50d09", "type": "comment",