qo-100-dashboard/flow.json
Joachim Hummel 3aa842701f Edit Flow
2021-12-23 12:16:47 +00:00

2 lines
18 KiB
JSON

[{"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":"9ba2a6f1bec1b7f2","type":"tab","label":"QO-100","disabled":false,"info":"[Blogartikel](https://blog.unixweb.de/aufbau-einer-qo-100-sende-und-empfangstation-qrv/)","env":[]},{"id":"553859a056a3a9fa","type":"group","z":"9ba2a6f1bec1b7f2","name":"","style":{"label":true,"color":"#addb7b","fill":"#e3f3d3"},"nodes":["c2f5eb272eac5c5f","cc60a6dd93dd3244","359f4d4fd685e0d1","b9fa04c1b5752afe","d215763a18f731ca","75b6482b8a9a2df4","1edd79e76fc773c6","3563a9718410bd9a","6ddec929453a1205","893ff6bf6e897f01","67932b2d7f19fc5c","62c9cef31b53a92f","cc1b24ef4d605dbe","91e04efb82cf0220","081e6924568948d6","08510d364969b808","d092f9e556521811","ba506444841b3ba2","6d3858104e9a8ec1","e2265a9cae75b92b","fdff7ad7ae4096f4","d104d1752f65d33e","e0e8e651f997ddc6","e0337b4ba6f1808e","9a32ce4ed64f1dd0","3f567cd2a2eea6b8","de8aa673b431f513","fa5d5ed532d632d3","65b9376e7b7d4c58","ee1c7a4358e5cf49","fb4ca044b01e14d1","c582e29846a9f5d9","45b700dfebec9d55","5546dd4d7b8735c2","8027538da632b120"],"x":134,"y":139,"w":1012,"h":962},{"id":"c2f5eb272eac5c5f","type":"mqtt in","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"QO-100 Power / Volt","topic":"esp3/sensor/#","qos":"2","datatype":"auto","broker":"a2c2305b51e328b5","nl":false,"rap":true,"rh":0,"inputs":0,"x":250,"y":260,"wires":[["d104d1752f65d33e","e0e8e651f997ddc6"]]},{"id":"cc60a6dd93dd3244","type":"function","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":240,"wires":[["08510d364969b808"]]},{"id":"359f4d4fd685e0d1","type":"ui_gauge","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","group":"5c8168a014b70296","order":3,"width":0,"height":0,"gtype":"gage","title":"Leistung ","label":"Watt","format":"{{value}}","min":0,"max":"3","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":920,"y":620,"wires":[]},{"id":"b9fa04c1b5752afe","type":"debug","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":240,"wires":[]},{"id":"d215763a18f731ca","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"75b6482b8a9a2df4","type":"switch","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["6d3858104e9a8ec1"],["d215763a18f731ca"],["1edd79e76fc773c6"],["3563a9718410bd9a"],["6ddec929453a1205"],["893ff6bf6e897f01"],["67932b2d7f19fc5c"],["62c9cef31b53a92f"],["cc1b24ef4d605dbe"],["91e04efb82cf0220"],["081e6924568948d6"]]},{"id":"1edd79e76fc773c6","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"3563a9718410bd9a","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"6ddec929453a1205","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"893ff6bf6e897f01","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"67932b2d7f19fc5c","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"62c9cef31b53a92f","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"cc1b24ef4d605dbe","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"91e04efb82cf0220","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"081e6924568948d6","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"08510d364969b808","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["b9fa04c1b5752afe","d092f9e556521811"]]},{"id":"d092f9e556521811","type":"link out","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","mode":"link","links":["ba506444841b3ba2"],"x":975,"y":280,"wires":[]},{"id":"ba506444841b3ba2","type":"link in","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","links":["d092f9e556521811"],"x":415,"y":640,"wires":[["75b6482b8a9a2df4"]]},{"id":"6d3858104e9a8ec1","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["359f4d4fd685e0d1","fdff7ad7ae4096f4"]]},{"id":"e2265a9cae75b92b","type":"comment","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"QO-100 Dashboard für Temperatur und Ausgangsleistung","info":"[https://blog.unixweb.de/aufbau-einer-qo-100-sende-und-empfangstation-qrv/]()","x":410,"y":180,"wires":[]},{"id":"fdff7ad7ae4096f4","type":"ui_chart","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","group":"ada2b860c42255a5","order":3,"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":"d104d1752f65d33e","type":"subflow:25b11cba.cef60c","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"Power","env":[{"name":"filter","value":"esp3/sensor/ads1115_channel_a0-gnd/state","type":"str"}],"x":450,"y":260,"wires":[["cc60a6dd93dd3244"],[]]},{"id":"e0e8e651f997ddc6","type":"subflow:25b11cba.cef60c","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"Temperatur","env":[{"name":"filter","value":"esp3/sensor/bme280_temperature/state","type":"str"}],"x":450,"y":380,"wires":[["e0337b4ba6f1808e"],[]]},{"id":"e0337b4ba6f1808e","type":"ui_gauge","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","group":"5c8168a014b70296","order":2,"width":0,"height":0,"gtype":"gage","title":"Temperatur Endstufe","label":"Celsius","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":720,"y":380,"wires":[]},{"id":"9a32ce4ed64f1dd0","type":"mqtt out","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"ON/OFF","topic":"esp3/switch/remote_relais/command","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"a2c2305b51e328b5","x":620,"y":1000,"wires":[]},{"id":"3f567cd2a2eea6b8","type":"ui_template","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","group":"5c8168a014b70296","name":"Spacer1","order":1,"width":"6","height":"1","format":"<div style=\"width: 98%; background-color: #ffffff; color: green; border: 2px solid #009933;\">","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":920,"y":800,"wires":[[]]},{"id":"de8aa673b431f513","type":"ui_button","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","group":"ada2b860c42255a5","order":9,"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":[["9a32ce4ed64f1dd0","c582e29846a9f5d9"]]},{"id":"fa5d5ed532d632d3","type":"ui_button","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","group":"ada2b860c42255a5","order":10,"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":[["9a32ce4ed64f1dd0","fb4ca044b01e14d1"]]},{"id":"65b9376e7b7d4c58","type":"ui_template","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","group":"5c8168a014b70296","name":"Spacer2","order":4,"width":"0","height":"0","format":"<div style=\"width: 98%; background-color: #ffffff; color: green; border: 2px solid #009933;\">\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":920,"y":840,"wires":[[]]},{"id":"ee1c7a4358e5cf49","type":"ui_template","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","group":"ada2b860c42255a5","name":"Spacer3","order":1,"width":"0","height":"0","format":"<div style=\"width: 98%; background-color: #ffffff; color: green; border: 2px solid #009933;\">","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":920,"y":880,"wires":[[]]},{"id":"fb4ca044b01e14d1","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":940,"wires":[["45b700dfebec9d55"]]},{"id":"c582e29846a9f5d9","type":"change","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":1060,"wires":[["5546dd4d7b8735c2"]]},{"id":"45b700dfebec9d55","type":"delay","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["de8aa673b431f513","fa5d5ed532d632d3"]]},{"id":"5546dd4d7b8735c2","type":"delay","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","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":[["de8aa673b431f513"]]},{"id":"8027538da632b120","type":"ui_template","z":"9ba2a6f1bec1b7f2","g":"553859a056a3a9fa","group":"ada2b860c42255a5","name":"Spacer4","order":12,"width":"0","height":"0","format":"<div style=\"width: 98%; background-color: #ffffff; color: green; border: 2px solid #009933;\">","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":920,"y":920,"wires":[[]]},{"id":"a28dcbdbdb440f6d","type":"ui_spacer","z":"9ba2a6f1bec1b7f2","name":"spacer","group":"ada2b860c42255a5","order":11,"width":1,"height":1},{"id":"49e31be8caced67c","type":"ui_spacer","z":"9ba2a6f1bec1b7f2","name":"spacer","group":"ada2b860c42255a5","order":6,"width":1,"height":1},{"id":"975aaf4b65cf5ec0","type":"ui_spacer","z":"9ba2a6f1bec1b7f2","name":"spacer","group":"ada2b860c42255a5","order":7,"width":1,"height":1},{"id":"b3008d7516da925b","type":"ui_spacer","z":"9ba2a6f1bec1b7f2","name":"spacer","group":"ada2b860c42255a5","order":8,"width":1,"height":1},{"id":"2aaea25a7c4a7f87","type":"ui_spacer","z":"9ba2a6f1bec1b7f2","name":"spacer","group":"ada2b860c42255a5","order":4,"width":1,"height":1},{"id":"c6831535fc9e3c5d","type":"ui_spacer","z":"9ba2a6f1bec1b7f2","name":"spacer","group":"ada2b860c42255a5","order":5,"width":1,"height":1},{"id":"7664b64f1b3bb657","type":"ui_spacer","z":"9ba2a6f1bec1b7f2","name":"spacer","group":"ada2b860c42255a5","order":2,"width":1,"height":1},{"id":"a2c2305b51e328b5","type":"mqtt-broker","name":"Test-Mosquitto","broker":"test.mosquitto.org","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"5c8168a014b70296","type":"ui_group","name":"Sender / QO-100 13cm","tab":"544de2058d600a97","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"ada2b860c42255a5","type":"ui_group","name":"QO-100 13cm","tab":"544de2058d600a97","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"544de2058d600a97","type":"ui_tab","name":"QO-100 Satellite","icon":"dashboard","order":7,"disabled":false,"hidden":false}]