[{"id":"25b11cba.cef60c","type":"subflow","name":"topic filter","info":"## MQTT Topic filter\n\n### Description\nFilters messages based on the value of `msg.topic` using standard MQTT topic filter notation.\n* `#` match all\n* `+` match one level\n\n### example filters\n* `home/+/temperature` \n * will match `home/bedroom/temperature`\n * will match `home/livingroom/temperature`\n * will not match `home/room/1/temperature`\n * will not match `room/1/temperature`\n* `home/#` \n * will match `home/location`\n * will match `home/livingroom/temperature`\n * will match `home/livingroom/humidity`\n * will not match `room/1/temperature`\n\n\n### Outputs\n\n#### Output 1 - match\nMessages with a topic that matches the `topic filter` will be sent out this output.\n\n#### Output 2 - no match\nMessages with a topic that does not match the `topic filter` will be sent out this output to permit next level filtering\n","category":"function","in":[{"x":68,"y":80,"wires":[{"id":"8635ef98.051688"}]}],"out":[{"x":340,"y":48,"wires":[{"id":"8635ef98.051688","port":0}]},{"x":340,"y":96,"wires":[{"id":"8635ef98.051688","port":1}]}],"env":[{"name":"filter","type":"str","value":"","ui":{"label":{"en-US":"Topic filter"},"type":"input","opts":{"types":["str"]}}},{"name":"status","type":"bool","value":"true","ui":{"label":{"en-US":"Show topic"},"type":"input","opts":{"types":["bool"]}}}],"color":"#D8BFD8","outputLabels":["Match","No Match"],"icon":"font-awesome/fa-filter","status":{"x":548,"y":160,"wires":[{"id":"45101d0d.e1f88c","port":0},{"id":"ddfcc22.bc6bc4","port":0}]}},{"id":"8635ef98.051688","type":"function","z":"25b11cba.cef60c","name":"filter","func":"var a = msg.topic;\nvar b = env.get(\"filter\") || '#';\n\nif(a===b) { return [msg, null]; }\nif(b==='#') { \n if(a) return [msg, null]; //if topic is something, OK\n return [null, msg];//otherwise, fail!\n}\nvar nameSegments = a.split('/');\nvar filterSegments = b.split('/');\nfor (var i = 0; i < filterSegments.length; i++) {\n var topicSegment = nameSegments[i];\n var patternSegment = filterSegments[i];\n var match = false;\n if(topicSegment === patternSegment) { match = true; }\n if(patternSegment === '+') { match = true; }\n if(patternSegment === '#') { return [msg, null]; }\n if(match === false) { return [null, msg]; }\n}\nif(nameSegments.length !== filterSegments.length) { return [null, msg]; }\n\nreturn [msg, null];\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":192,"y":80,"wires":[[],[]]},{"id":"7d929e05.684e","type":"inject","z":"25b11cba.cef60c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":148,"y":160,"wires":[["c9d341ce.724848"]]},{"id":"45101d0d.e1f88c","type":"function","z":"25b11cba.cef60c","name":"","func":"var b = env.get(\"filter\") || '#';\nnode.status({text:b})\nmsg.payload = b;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":428,"y":144,"wires":[[]]},{"id":"c9d341ce.724848","type":"switch","z":"25b11cba.cef60c","name":"","property":"status","propertyType":"env","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":160,"wires":[["45101d0d.e1f88c"],["ddfcc22.bc6bc4"]]},{"id":"ddfcc22.bc6bc4","type":"function","z":"25b11cba.cef60c","name":"","func":"node.status({})\ndelete msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":428,"y":192,"wires":[[]]},{"id":"eb76d5b2c0dcf6c7","type":"tab","label":"QO-100","disabled":false,"info":"[Blogartikel](https://blog.unixweb.de/aufbau-einer-qo-100-sende-und-empfangstation-qrv/)","env":[]},{"id":"0bf6dbb00d1cf8d7","type":"group","z":"eb76d5b2c0dcf6c7","name":"","style":{"label":true,"color":"#addb7b","fill":"#e3f3d3"},"nodes":["71be1bcc40cc49c4","1e96e4114e770635","7d74f158d9e5b339","fbe1a2f3e7fae5ea","8ffbd2d8da2c68f6","62f6e2120f543eda","a90f9c40724b5d3f","0bf77a264651c4e4","aef9122f965de7c2","2066e9644f27384b","8010ad97b4b83bda","a48ec32f4e0ebad8","ba9ebb110eea1184","af027e08b3748612","4dece049f38a9b06","286665c93a22e79e","386f179330115011","75b2046fc850e63c","6d3345fa39b0d34d","7cb272178506823f","c8570033568c9bfa","6fb02d6a245724a5","49413c35d0d38e0e","71cfca8e2a2a0a09","8db8122468d3ca87","ab49b897a9da0b07","c8f6bdd8f3ac8b7c","ba94777bf608c2cb","b1990ce1fd1198b9","75bce503ed6e6c74","c24227c8872c10d9","286dfaddf7e240f4","c96dc42875fc1cd9","c1168a72c3c18bea"],"x":134,"y":139,"w":1012,"h":962},{"id":"71be1bcc40cc49c4","type":"mqtt in","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"QO-100 Power / Volt","topic":"esp3/sensor/#","qos":"2","datatype":"auto","broker":"1bc789ea.3a5006","nl":false,"rap":true,"rh":0,"inputs":0,"x":250,"y":260,"wires":[["6fb02d6a245724a5","49413c35d0d38e0e"]]},{"id":"1e96e4114e770635","type":"function","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":240,"wires":[["286665c93a22e79e"]]},{"id":"7d74f158d9e5b339","type":"ui_gauge","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","group":"5c8168a014b70296","order":4,"width":0,"height":0,"gtype":"gage","title":"Power","label":"Watt","format":"{{value}}","min":0,"max":"3","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":910,"y":620,"wires":[]},{"id":"fbe1a2f3e7fae5ea","type":"debug","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":240,"wires":[]},{"id":"8ffbd2d8da2c68f6","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"100 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"0.100","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":480,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"62f6e2120f543eda","type":"switch","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0.230","vt":"num"},{"t":"gt","v":"0.237","vt":"num"},{"t":"gt","v":"0.297","vt":"num"},{"t":"gt","v":"0.384","vt":"num"},{"t":"gt","v":"0.469","vt":"num"},{"t":"gt","v":"0.567","vt":"num"},{"t":"gt","v":"0.625","vt":"num"},{"t":"gt","v":"0.693","vt":"num"},{"t":"gt","v":"0.778","vt":"num"},{"t":"gt","v":"0.974","vt":"num"},{"t":"gt","v":"1.060","vt":"num"}],"checkall":"true","repair":true,"outputs":11,"x":510,"y":640,"wires":[["6d3345fa39b0d34d"],["8ffbd2d8da2c68f6"],["a90f9c40724b5d3f"],["0bf77a264651c4e4"],["aef9122f965de7c2"],["2066e9644f27384b"],["8010ad97b4b83bda"],["a48ec32f4e0ebad8"],["ba9ebb110eea1184"],["af027e08b3748612"],["4dece049f38a9b06"]]},{"id":"a90f9c40724b5d3f","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"190 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"0.190","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":520,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"0bf77a264651c4e4","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"370 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"0.370","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":560,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"aef9122f965de7c2","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"590 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"0.590","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":600,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"2066e9644f27384b","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"890 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"0.890","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":640,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"8010ad97b4b83bda","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"1080 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"1.080","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":680,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"a48ec32f4e0ebad8","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"1300 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"1.300","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":720,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"ba9ebb110eea1184","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"1520 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"1.520","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":760,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"af027e08b3748612","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"1860 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"1.860","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":800,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"4dece049f38a9b06","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"2000 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"1.950","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":840,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"286665c93a22e79e","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"String to Number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":240,"wires":[["fbe1a2f3e7fae5ea","386f179330115011"]]},{"id":"386f179330115011","type":"link out","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","mode":"link","links":["75b2046fc850e63c"],"x":975,"y":280,"wires":[]},{"id":"75b2046fc850e63c","type":"link in","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","links":["386f179330115011"],"x":415,"y":640,"wires":[["62f6e2120f543eda"]]},{"id":"6d3345fa39b0d34d","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"0 mW","rules":[{"t":"change","p":"payload","pt":"msg","from":"payload","fromt":"msg","to":"0.000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":440,"wires":[["7d74f158d9e5b339","c8570033568c9bfa"]]},{"id":"7cb272178506823f","type":"comment","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"QO-100 Dashboard für Temperatur und Ausgangsleitung","info":"[https://blog.unixweb.de/aufbau-einer-qo-100-sende-und-empfangstation-qrv/]()","x":410,"y":180,"wires":[]},{"id":"c8570033568c9bfa","type":"ui_chart","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","group":"5c8168a014b70296","order":1,"width":0,"height":0,"label":"Verlauf / Watt","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":940,"y":660,"wires":[[]]},{"id":"6fb02d6a245724a5","type":"subflow:25b11cba.cef60c","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"Power","env":[{"name":"filter","value":"esp3/sensor/ads1115_channel_a0-gnd/state","type":"str"}],"x":450,"y":260,"wires":[["1e96e4114e770635"],[]]},{"id":"49413c35d0d38e0e","type":"subflow:25b11cba.cef60c","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"Temperatur","env":[{"name":"filter","value":"esp3/sensor/bme280_temperature/state","type":"str"}],"x":450,"y":380,"wires":[["71cfca8e2a2a0a09"],[]]},{"id":"71cfca8e2a2a0a09","type":"ui_gauge","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","group":"5c8168a014b70296","order":3,"width":0,"height":0,"gtype":"gage","title":"Temperatur Endstufe","label":"units","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":720,"y":380,"wires":[]},{"id":"8db8122468d3ca87","type":"mqtt out","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"ON/OFF","topic":"esp3/switch/remote_relais/command","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"1bc789ea.3a5006","x":620,"y":1000,"wires":[]},{"id":"ab49b897a9da0b07","type":"ui_template","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","group":"5c8168a014b70296","name":"Spacer1","order":2,"width":"6","height":"1","format":"
","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":920,"y":800,"wires":[[]]},{"id":"c8f6bdd8f3ac8b7c","type":"ui_button","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","group":"5c8168a014b70296","order":7,"width":"3","height":"2","passthru":false,"label":"Ein","tooltip":"","color":"{{color}}","bgcolor":"{{background}}","className":"","icon":"fa-lightbulb-o fa-4x align=left","payload":"ON","payloadType":"str","topic":"topic","topicType":"msg","x":450,"y":1060,"wires":[["8db8122468d3ca87","286dfaddf7e240f4"]]},{"id":"ba94777bf608c2cb","type":"ui_button","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","group":"5c8168a014b70296","order":8,"width":"3","height":"2","passthru":false,"label":"AUS","tooltip":"","color":"{{color}}","bgcolor":"{{background}}","className":"","icon":"fa-power-off fa-4x align=left","payload":"OFF","payloadType":"str","topic":"topic","topicType":"msg","x":450,"y":940,"wires":[["8db8122468d3ca87","c24227c8872c10d9"]]},{"id":"b1990ce1fd1198b9","type":"ui_template","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","group":"5c8168a014b70296","name":"Spacer2","order":6,"width":"0","height":"0","format":"
\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":920,"y":840,"wires":[[]]},{"id":"75bce503ed6e6c74","type":"ui_template","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","group":"5c8168a014b70296","name":"Spacer3","order":9,"width":"0","height":"0","format":"
","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":920,"y":880,"wires":[[]]},{"id":"c24227c8872c10d9","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":940,"wires":[["c96dc42875fc1cd9"]]},{"id":"286dfaddf7e240f4","type":"change","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":1060,"wires":[["c1168a72c3c18bea"]]},{"id":"c96dc42875fc1cd9","type":"delay","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":250,"y":940,"wires":[["c8f6bdd8f3ac8b7c","ba94777bf608c2cb"]]},{"id":"c1168a72c3c18bea","type":"delay","z":"eb76d5b2c0dcf6c7","g":"0bf6dbb00d1cf8d7","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":270,"y":1060,"wires":[["c8f6bdd8f3ac8b7c"]]},{"id":"1bc789ea.3a5006","type":"mqtt-broker","name":"Docker","broker":"192.168.10.137","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":4,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5c8168a014b70296","type":"ui_group","name":"Sender / QO-100 13cm","tab":"544de2058d600a97","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"544de2058d600a97","type":"ui_tab","name":"QO-100 Satellite","icon":"dashboard","order":7,"disabled":false,"hidden":false}]