Skip to content

Instantly share code, notes, and snippets.

@hotNipi
Last active November 26, 2021 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotNipi/cd90709d95fcba9970bd88205871c3c7 to your computer and use it in GitHub Desktop.
Save hotNipi/cd90709d95fcba9970bd88205871c3c7 to your computer and use it in GitHub Desktop.
Dashboard tips - Gauge with selective input

Make one gauge to show different measurements by selecting source of measurement using regular dashboard buttons acting like radio buttons. Handy solution for situations where screen size is limited but components can't be made smaller anymore.

image

[{"id":"6d08d5ab.a8aa3c","type":"tab","label":"SELECTABLE INPUT","disabled":false,"info":""},{"id":"e3ac04d9.d3c308","type":"ui_ui_control","z":"6d08d5ab.a8aa3c","name":"inject dash events","events":"all","x":170,"y":110,"wires":[["76ef4267.f6b58c"]]},{"id":"76ef4267.f6b58c","type":"link out","z":"6d08d5ab.a8aa3c","name":"dash-init","links":["7814ed99.4469e4","86181860.e50238","4fe3141f.0fa66c"],"x":305,"y":110,"wires":[]},{"id":"29e8935c.6601fc","type":"ui_gauge","z":"6d08d5ab.a8aa3c","name":"","group":"99609e7b.c8ed4","order":2,"width":5,"height":3,"gtype":"gage","title":"{{title}}","label":"","format":"{{value | number:2}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":810,"y":370,"wires":[]},{"id":"15ad39f2.4f9556","type":"function","z":"6d08d5ab.a8aa3c","name":"create groups","func":"var g_members = [\"temperature\",\"humidity\",\"wind\"]\nvar g_limits = [{lo:0,hi:30},{lo:0,hi:100},{lo:0,hi:10}]\nvar g = {\"gaugegroup\":{\"members\":[],\"selected\":\"temperature\"}}\nfor(var i=0;i<g_members.length;i++){\n g.gaugegroup.members.push( {\"topic\":g_members[i],\"lastvalue\":0,\"min\":g_limits[i].lo,\"max\":g_limits[i].hi})\n}\n\nglobal.set(\"buttongroups\",g)\n","outputs":1,"noerr":0,"x":370,"y":60,"wires":[[]]},{"id":"64822339.ba387c","type":"inject","z":"6d08d5ab.a8aa3c","name":"init","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":60,"wires":[["15ad39f2.4f9556"]]},{"id":"cd314554.dc9408","type":"ui_button","z":"6d08d5ab.a8aa3c","name":"temperature","group":"99609e7b.c8ed4","order":1,"width":3,"height":1,"passthru":false,"label":"TEMPERATURE","tooltip":"","color":"","bgcolor":"{{bgr}}","icon":"","payload":"","payloadType":"str","topic":"temperature","x":520,"y":210,"wires":[["1426c20e.a3021e"]]},{"id":"860fe47f.8bb7f8","type":"ui_button","z":"6d08d5ab.a8aa3c","name":"humidity","group":"99609e7b.c8ed4","order":3,"width":3,"height":1,"passthru":false,"label":"HUMIDITY","tooltip":"","color":"","bgcolor":"{{bgr}}","icon":"","payload":"","payloadType":"str","topic":"humidity","x":510,"y":250,"wires":[["1426c20e.a3021e"]]},{"id":"87a34045.d3559","type":"ui_button","z":"6d08d5ab.a8aa3c","name":"wind","group":"99609e7b.c8ed4","order":4,"width":3,"height":1,"passthru":false,"label":"WIND","tooltip":"","color":"","bgcolor":"{{bgr}}","icon":"","payload":"","payloadType":"str","topic":"wind","x":500,"y":290,"wires":[["1426c20e.a3021e"]]},{"id":"ce279d91.f64be","type":"switch","z":"6d08d5ab.a8aa3c","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"temperature","vt":"str"},{"t":"eq","v":"humidity","vt":"str"},{"t":"eq","v":"wind","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":250,"wires":[["cd314554.dc9408"],["860fe47f.8bb7f8"],["87a34045.d3559"]]},{"id":"199657db.8602c8","type":"function","z":"6d08d5ab.a8aa3c","name":"get color","func":"var group = global.get(\"buttongroups.gaugegroup\")\nvar m\nfor(var i=0;i<group.members.length;i++){\n m = {topic:group.members[i].topic}\n m.bgr = group.members[i].topic == group.selected ? 'green' : 'gray'\n node.send(m)\n}\n","outputs":1,"noerr":0,"x":240,"y":250,"wires":[["ce279d91.f64be"]]},{"id":"1426c20e.a3021e","type":"change","z":"6d08d5ab.a8aa3c","name":"set selected","rules":[{"t":"set","p":"buttongroups.gaugegroup.selected","pt":"global","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":250,"wires":[["d985b16f.388de"]]},{"id":"d985b16f.388de","type":"link out","z":"6d08d5ab.a8aa3c","name":"gaugegroup out","links":["86181860.e50238","4fe3141f.0fa66c"],"x":805,"y":250,"wires":[]},{"id":"86181860.e50238","type":"link in","z":"6d08d5ab.a8aa3c","name":"gaugegroup in","links":["d985b16f.388de","76ef4267.f6b58c"],"x":145,"y":250,"wires":[["199657db.8602c8"]]},{"id":"4fe3141f.0fa66c","type":"link in","z":"6d08d5ab.a8aa3c","name":"gauge in","links":["d985b16f.388de","76ef4267.f6b58c"],"x":415,"y":340,"wires":[["c4bcbd8b.30332"]]},{"id":"d00c74c.d252588","type":"inject","z":"6d08d5ab.a8aa3c","name":"","topic":"","payload":"","payloadType":"date","repeat":"2.45","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":420,"wires":[["5de3e70d.177ee8"]]},{"id":"78c363c6.bca72c","type":"change","z":"6d08d5ab.a8aa3c","name":"fake temp","rules":[{"t":"set","p":"payload","pt":"msg","to":"$random()*28","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":380,"wires":[["5adc8e68.a23b3"]]},{"id":"5de3e70d.177ee8","type":"change","z":"6d08d5ab.a8aa3c","name":"fake humidity","rules":[{"t":"set","p":"payload","pt":"msg","to":"$random()*100","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"humidity","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":420,"wires":[["5adc8e68.a23b3"]]},{"id":"ad8abcd7.f3d43","type":"change","z":"6d08d5ab.a8aa3c","name":"fake wind","rules":[{"t":"set","p":"payload","pt":"msg","to":"$random()*8","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"wind","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":460,"wires":[["5adc8e68.a23b3"]]},{"id":"7647d883.4841a8","type":"inject","z":"6d08d5ab.a8aa3c","name":"","topic":"","payload":"","payloadType":"date","repeat":"3.7","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":460,"wires":[["ad8abcd7.f3d43"]]},{"id":"5c564e32.b1d5e","type":"inject","z":"6d08d5ab.a8aa3c","name":"","topic":"","payload":"","payloadType":"date","repeat":"1.3","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":380,"wires":[["78c363c6.bca72c"]]},{"id":"5adc8e68.a23b3","type":"function","z":"6d08d5ab.a8aa3c","name":"store inactive & bypass active","func":"var group = global.get(\"buttongroups.gaugegroup\")\nif(group.selected != msg.topic){\n var member = group.members.find(element => element.topic == msg.topic);\n member.lastvalue = msg.payload\n global.set(\"buttongroups.gaugegroup\",group)\n return\n}\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":390,"wires":[["29e8935c.6601fc"]]},{"id":"c4bcbd8b.30332","type":"function","z":"6d08d5ab.a8aa3c","name":"prepare after selection change","func":"var group = global.get(\"buttongroups.gaugegroup\")\nvar member = group.members.find(element => element.topic == group.selected);\nmsg.title = group.selected.toUpperCase()\nmsg.payload = member.lastvalue\nmsg.ui_control = {min:member.min,max:member.max}\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":350,"wires":[["29e8935c.6601fc"]]},{"id":"99609e7b.c8ed4","type":"ui_group","z":"","name":"GAUGE INPUT SELECTOR","tab":"c38fb46f.de97f8","disp":true,"width":8,"collapse":false},{"id":"c38fb46f.de97f8","type":"ui_tab","z":"","name":"Controls","icon":"dashboard","disabled":false,"hidden":false}]
@rohnershare
Copy link

Hello, thank you for the message. First I have to apologize that I am only now writing. Unfortunately your email went into the spam folder and I only saw it now.
I love your work and the Node Red examples. I also think that it is a bit complicated for the beginner (like me). I am currently spending a lot of time getting involved in Node red. Since I have a project for my farm at home, I would like to get ahead.
I currently have the problem that I am your example

https://flows.nodered.org/flow/cd90709d95fcba9970bd88205871c3c7

use. Here I have 3 measured values ​​that I display in a gauge. The problem is that the values ​​are not correct. In the chart below the current values ​​are logged in the selection at the Flow Dashboard tips - Gauge with selective input, the values ​​are displayed either with 0.0 or with an older value. But this is only ever for one of the three buttons, I use the function for 6 nodes. I've also attached the flow

[{"id":"6dd596c0.510558","type":"subflow","name":"Detect online","info":"","in":[{"x":260,"y":100,"wires":[{"id":"b819ab3d.82ac48"},{"id":"9e8a5611.149218"},{"id":"5e081291.070f0c"}]}],"out":[{"x":1440,"y":140,"wires":[{"id":"a58a8850.3d5e58","port":0},{"id":"9cf35d5a.5c0fb","port":0}]}]},{"id":"b85986e7.098e48","type":"delay","z":"6dd596c0.510558","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":870,"y":160,"wires":[["57e39bb6.e63fd4"]]},{"id":"9cf35d5a.5c0fb","type":"inject","z":"6dd596c0.510558","name":"Startup","repeat":"","crontab":"","once":true,"topic":"","payload":"false","payloadType":"bool","x":930,"y":260,"wires":[["57e39bb6.e63fd4"]]},{"id":"9e8a5611.149218","type":"change","z":"6dd596c0.510558","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":160,"wires":[["b85986e7.098e48"]]},{"id":"f6d33549.af3f78","type":"delay","z":"6dd596c0.510558","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":660,"y":200,"wires":[["b85986e7.098e48"]]},{"id":"b819ab3d.82ac48","type":"change","z":"6dd596c0.510558","name":"Online","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":110,"wires":[["b73f93e2.91396"]]},{"id":"57e39bb6.e63fd4","type":"change","z":"6dd596c0.510558","name":"Offline","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":160,"wires":[["b73f93e2.91396"]]},{"id":"a58a8850.3d5e58","type":"rbe","z":"6dd596c0.510558","name":"","func":"rbe","gap":"","start":"","inout":"out","x":1300,"y":140,"wires":[[]]},{"id":"5e081291.070f0c","type":"change","z":"6dd596c0.510558","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"timeout","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":200,"wires":[["f6d33549.af3f78"]]},{"id":"96afa4d.9bf6758","type":"comment","z":"6dd596c0.510558","name":"Each incoming message will retrigger a new timeout (msg.timeout [ms]) before being reported offline","info":"","x":590,"y":40,"wires":[]},{"id":"b73f93e2.91396","type":"change","z":"6dd596c0.510558","name":"Offline","rules":[{"t":"set","p":"topic","pt":"msg","to":"online","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1170,"y":140,"wires":[["a58a8850.3d5e58"]]},{"id":"b6a3daf7.a23168","type":"tab","label":"OV Diversepilot002","disabled":false,"info":""},{"id":"45149fdf.a2bf68","type":"comment","z":"b6a3daf7.a23168","name":"https://klarsys.github.io/angular-material-icons/","info":"","x":840,"y":180,"wires":[]},{"id":"7adf5f2d.f1c14","type":"comment","z":"b6a3daf7.a23168","name":"http://node-red.blogspot.com/2017/11/node-red-dashboard-output-text-node.html","info":"","x":950,"y":140,"wires":[]},{"id":"4983377a.c15d5","type":"comment","z":"b6a3daf7.a23168","name":"https://github.com/node-red/node-red-dashboard/tree/master/src/components/ui-component/templates","info":"","x":1010,"y":220,"wires":[]},{"id":"23f151a2.60bdfe","type":"comment","z":"b6a3daf7.a23168","name":"befehl für skalierung jede gruppe "hier aber nicht aktiv"","info":"","x":280,"y":140,"wires":[]},{"id":"9b9e92a2.84e558","type":"comment","z":"b6a3daf7.a23168","name":"objekt und msg payload ","info":"\n\nEin Object ist das hier:\n\nmsg.payload = {type:"Raspi", model:"4", name:"homepi"};\n\n\nDas besteht aus den Komponenten msg.payload.type, msg.payload.model und msg.payload.name.\n\n\nEin bool ist das hier:\n\nmsg.payload = true\n\n\nDas kann man nicht umwandeln.\n","x":760,"y":260,"wires":[]},{"id":"688fdc61.589a94","type":"comment","z":"b6a3daf7.a23168","name":"Tino-Secure-Node 001","info":"","x":180,"y":220,"wires":[]},{"id":"87b5d614.be6eb","type":"comment","z":"b6a3daf7.a23168","name":"LED Status","info":"","x":990,"y":1340,"wires":[]},{"id":"4ee52a45.c6ac64","type":"comment","z":"b6a3daf7.a23168","name":"https://flows.nodered.org/flow/7e4bb517ce3a75add0083642ef03e9d8","info":"","x":330,"y":180,"wires":[]},{"id":"bc5faa3e.5639c8","type":"comment","z":"b6a3daf7.a23168","name":"https://forum.iobroker.net/topic/420/beispiel-aktuelles-datum-formatieren-und-ausgeben","info":"","x":390,"y":300,"wires":[]},{"id":"cdd4cd70.3cc8a","type":"comment","z":"b6a3daf7.a23168","name":"https://www.instructables.com/Lora-Temperature-Dashboard/","info":"","x":1720,"y":180,"wires":[]},{"id":"310cb439.ccd19c","type":"comment","z":"b6a3daf7.a23168","name":"For MQTT "user"/"password", use "Application ID"/"default key" ","info":"\n1) Sign in to TTN and go to your application page where "app_1" is your "Application ID" e.g.\nhttps://console.thethingsnetwork.org/applications/app_1\n\n2) For MQTT User, use "Application ID" \n\n3) For MQTT password, scroll to bottom and use "default key" (you need to press the "eye" to see the long text)","x":1710,"y":260,"wires":[]},{"id":"c39c5e3.441ef2","type":"comment","z":"b6a3daf7.a23168","name":"https://www.instructables.com/Lora-Temperature-Dashboard/","info":"","x":1720,"y":220,"wires":[]},{"id":"29452d0b.fece1a","type":"function","z":"b6a3daf7.a23168","name":"Temperature","func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.T\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":940,"wires":[["c0d3b281.bc17d"]]},{"id":"5f8a4c9a.732ccc","type":"function","z":"b6a3daf7.a23168","name":"Pressure","func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.P\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":1120,"wires":[["85948440.e8fb68"]]},{"id":"b2585364.6eab9","type":"function","z":"b6a3daf7.a23168","name":"Device ID","func":"// outputs: 2\nmsg.payload = msg.payload.dev_id\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":880,"wires":[["2302e799.d0b798","b525ee87.dcd658"]]},{"id":"9fa3efc5.c4d208","type":"function","z":"b6a3daf7.a23168","name":"RSSI","func":"// outputs: 2\nmsg.payload = msg.payload.metadata.gateways[0].rssi\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":1160,"wires":[["9f69d487.0dd118","5eb4820f.40f9d4","8a88ca84.fed438"]]},{"id":"770dcffd.46b948","type":"function","z":"b6a3daf7.a23168","name":"SNR","func":"// outputs: 2\nmsg.payload = msg.payload.metadata.gateways[0].snr\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":1200,"wires":[["d1bb4284.bba0c8","e3a31f0f.4daed","f1299b1b.ca1878"]]},{"id":"f0f1f8e8.a0c6f8","type":"function","z":"b6a3daf7.a23168","name":"Brightness","func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.H\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":1080,"wires":[["3847c852.538468"]]},{"id":"78c391c9.fef7d8","type":"function","z":"b6a3daf7.a23168","name":"Humidity","func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.RH\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":980,"wires":[["a87c10a1.af892"]]},{"id":"e67102a.98b7e8","type":"function","z":"b6a3daf7.a23168","name":"VCC","func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.vcc/1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":1040,"wires":[["a8b3d2af.458e88"]]},{"id":"8c597044.80f768","type":"function","z":"b6a3daf7.a23168","name":"Event","func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.event\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":1360,"wires":[["a2f8301f.574db8","375923a5.cf05ac","dfda0579.d24bc","32f9beba.d9ccd2","e6a5c000.f7556"]]},{"id":"562337eb.d6cc18","type":"function","z":"b6a3daf7.a23168","name":"Count","func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.count\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":410,"y":1460,"wires":[["c4eb387a.b8f3b","6f8ec2be.266c7c"]]},{"id":"ed0a4099.5053a8","type":"mqtt in","z":"b6a3daf7.a23168","name":"tilli/devices/diversepilot002/up","topic":"tilli/devices/diversepilot002/up","qos":"2","datatype":"json","broker":"44fdb6de.ed72b","x":140,"y":400,"wires":[["b2585364.6eab9","29452d0b.fece1a","78c391c9.fef7d8","e67102a.98b7e8","f0f1f8e8.a0c6f8","5f8a4c9a.732ccc","9fa3efc5.c4d208","770dcffd.46b948","8c597044.80f768","562337eb.d6cc18","8bfa4641.f21638","b1e6e41e.89f178","db31958c.99102","8659228a.28bbd8","bf265051.7f9268"]]},{"id":"8c230ae3.1dd9b","type":"comment","z":"b6a3daf7.a23168","name":"https://flows.nodered.org/flow/cd90709d95fcba9970bd88205871c3c7","info":"","x":1690,"y":300,"wires":[]},{"id":"ebc21b4f.e003","type":"comment","z":"b6a3daf7.a23168","name":"https://diyprojects.io/node-red-module-dashboard-gui/#.X6sG5lAxmUl","info":"","x":330,"y":260,"wires":[]},{"id":"d1115638.44dc3","type":"comment","z":"b6a3daf7.a23168","name":"https://forum.iobroker.net/topic/420/beispiel-aktuelles-datum-formatieren-und-ausgeben/2","info":"","x":1750,"y":340,"wires":[]},{"id":"8bfa4641.f21638","type":"moment","z":"b6a3daf7.a23168","name":"","topic":"","input":"payload.metadata.time","inputType":"msg","inTz":"ETC/UTC","adjAmount":0,"adjType":"days","adjDir":"add","format":"LLL","locale":"de-DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":520,"y":640,"wires":[["95fcfe74.2f2d08","2cb3289b.e4aac8","6e12c2a8.93b544"]]},{"id":"95fcfe74.2f2d08","type":"debug","z":"b6a3daf7.a23168","name":"last seen","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":790,"y":700,"wires":[]},{"id":"2cb3289b.e4aac8","type":"ui_text","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":4,"width":3,"height":1,"name":"Last seen","label":"","format":"{{msg.payload}}","layout":"row-left","x":780,"y":640,"wires":[]},{"id":"a2f8301f.574db8","type":"function","z":"b6a3daf7.a23168","name":"Telegram Auslösung","func":"if (msg.payload =="4")\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 Bewegung erkannt!"};\nreturn {payload};\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":1240,"wires":[["3b04ef0e.9796a8"]]},{"id":"3b04ef0e.9796a8","type":"telegram sender","z":"b6a3daf7.a23168","name":"","bot":"4a9ea72a.a5ce18","outputs":1,"x":1130,"y":1260,"wires":[["991ece1.f33403"]]},{"id":"991ece1.f33403","type":"debug","z":"b6a3daf7.a23168","name":"Telegram","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","x":1310,"y":1260,"wires":[]},{"id":"375923a5.cf05ac","type":"function","z":"b6a3daf7.a23168","name":"Telegram Prüftaste Auslösung","func":"if (msg.payload =="2")\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 PRÜFTASTE GEDRÜCKT!"};\nreturn {payload};\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":1380,"wires":[["3b04ef0e.9796a8"]]},{"id":"b1e6e41e.89f178","type":"debug","z":"b6a3daf7.a23168","name":"tilli/devices/diversepilot002/up","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":520,"y":460,"wires":[]},{"id":"c0d3b281.bc17d","type":"change","z":"b6a3daf7.a23168","name":"fake temp","rules":[{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1460,"y":860,"wires":[["bc72b504.8bdac8","2e3f0102.cfbb7e"]]},{"id":"a87c10a1.af892","type":"change","z":"b6a3daf7.a23168","name":"fake humidity","rules":[{"t":"set","p":"topic","pt":"msg","to":"humidity","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1450,"y":900,"wires":[["bc72b504.8bdac8","2e3f0102.cfbb7e"]]},{"id":"a8b3d2af.458e88","type":"change","z":"b6a3daf7.a23168","name":"vcc","rules":[{"t":"set","p":"topic","pt":"msg","to":"vcc","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1450,"y":960,"wires":[["7e6f4a7.133a134"]]},{"id":"3847c852.538468","type":"change","z":"b6a3daf7.a23168","name":"fake brightness","rules":[{"t":"set","p":"topic","pt":"msg","to":"brightness","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1000,"wires":[["bc72b504.8bdac8","2e3f0102.cfbb7e"]]},{"id":"350e5fa0.3c05d","type":"comment","z":"b6a3daf7.a23168","name":"LED Status","info":"","x":1630,"y":380,"wires":[]},{"id":"47e0a2f8.ebef44","type":"comment","z":"b6a3daf7.a23168","name":"neue gruppe hier zuert drücken sonst kein wert im dashboard","info":"","x":1480,"y":420,"wires":[]},{"id":"85948440.e8fb68","type":"change","z":"b6a3daf7.a23168","name":"fake pressure","rules":[{"t":"set","p":"topic","pt":"msg","to":"pressure","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1040,"wires":[[]]},{"id":"9f69d487.0dd118","type":"change","z":"b6a3daf7.a23168","name":"fake rssi","rules":[{"t":"set","p":"topic","pt":"msg","to":"rssi","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1080,"wires":[[]]},{"id":"d1bb4284.bba0c8","type":"change","z":"b6a3daf7.a23168","name":"fake snr","rules":[{"t":"set","p":"topic","pt":"msg","to":"snr","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1120,"wires":[[]]},{"id":"c4eb387a.b8f3b","type":"ui_text","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":15,"width":2,"height":1,"name":"Count","label":"Count","format":"{{msg.payload}}","layout":"row-left","x":570,"y":1460,"wires":[]},{"id":"e3a31f0f.4daed","type":"debug","z":"b6a3daf7.a23168","name":"last seen","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":610,"y":1240,"wires":[]},{"id":"5eb4820f.40f9d4","type":"debug","z":"b6a3daf7.a23168","name":"last seen","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":630,"y":1160,"wires":[]},{"id":"f1299b1b.ca1878","type":"ui_text","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":11,"width":2,"height":1,"name":"SNR","label":"SNR","format":"{{msg.payload}}","layout":"row-left","x":530,"y":1300,"wires":[]},{"id":"8a88ca84.fed438","type":"ui_text","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":14,"width":2,"height":1,"name":"RSSI","label":"RSSI","format":"{{msg.payload}}","layout":"row-left","x":830,"y":1180,"wires":[]},{"id":"db31958c.99102","type":"function","z":"b6a3daf7.a23168","name":"Gatyeway ID","func":"// outputs: 2\nmsg.payload = msg.payload.metadata.gateways[0].gtw_id\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":1520,"wires":[["1e9ebb7e.4023e5"]]},{"id":"1e9ebb7e.4023e5","type":"change","z":"b6a3daf7.a23168","name":"Gayteway Name","rules":[{"t":"change","p":"payload","pt":"msg","from":"eui-b827ebfffe8ea2ac","fromt":"str","to":"1_CH_PRATTELN_iC880A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"eui-b827ebfffeba844f","fromt":"str","to":"2_DE_BROMBACH_iC880A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"eui-b827ebfffed2573e","fromt":"str","to":"3_DE_MUENSTERTAL_iC880A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"eui-58a0cbfffe802a64","fromt":"str","to":"4_CH_Rocco_Fitnessstudio","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"eui-3133303734002500","fromt":"str","to":"001_Rent_Mikrotik8_GSM","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":1520,"wires":[["17b394a7.d567bb"]]},{"id":"17b394a7.d567bb","type":"ui_text","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":13,"width":6,"height":1,"name":"Gateway","label":"Gateway","format":"{{msg.payload}}","layout":"row-left","x":700,"y":1520,"wires":[]},{"id":"dfda0579.d24bc","type":"function","z":"b6a3daf7.a23168","name":"Telegram Sabotage","func":"if (msg.payload =="8")\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 Sabotage !"};\nreturn {payload};\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":790,"y":1340,"wires":[["3b04ef0e.9796a8"]]},{"id":"35202200.71d0a6","type":"ui_toast","z":"b6a3daf7.a23168","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1390,"y":1580,"wires":[]},{"id":"5fee8ecb.459f7","type":"ttn downlink","z":"b6a3daf7.a23168","name":"","app":"294556ce.ffa602","dev_id":"diversepilot002","port":"1","confirmed":true,"schedule":"replace","x":2270,"y":1440,"wires":[]},{"id":"32f9beba.d9ccd2","type":"change","z":"b6a3daf7.a23168","name":"Zahl in Text","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"Heartbeat","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"2","fromt":"num","to":"Taster gedrückt","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"4","fromt":"num","to":"Bewegung!","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"8","fromt":"num","to":"Sabotage!","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"16","fromt":"num","to":"Ext.-Alarm","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":1460,"wires":[["52dc6616.07d0c","35202200.71d0a6","6ae5d83b.2755a8","c01a603b.ecb408"]]},{"id":"52dc6616.07d0c","type":"function","z":"b6a3daf7.a23168","name":"Color Mapping","func":"switch (msg.payload) {\n\ncase "Heartbeat" : \n msg.color = "green";\n break;\n \ncase "Taster gedrückt" : \n msg.color = "magenta";\n break;\n \ncase "Bewegung!" : \nmsg.color = "red 1";\nbreak;\n\ncase "Sabotage!" : \nmsg.color = "red 1";\nbreak;\n\n\ncase "Ext.-Alarm" : \nmsg.color = "red 1";\nbreak;\n\n \ndefault : \n msg.color = "sgi gray 52";\n break;\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1320,"y":1460,"wires":[["fd1e4ec8.c3e38"]]},{"id":"fd1e4ec8.c3e38","type":"debug","z":"b6a3daf7.a23168","name":"last seen","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1510,"y":1440,"wires":[]},{"id":"6ae5d83b.2755a8","type":"debug","z":"b6a3daf7.a23168","name":"last seen","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1290,"y":1380,"wires":[]},{"id":"e6a5c000.f7556","type":"debug","z":"b6a3daf7.a23168","name":"last seen","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":890,"y":1500,"wires":[]},{"id":"82c9dc8d.87c11","type":"ui_button","z":"b6a3daf7.a23168","name":"","group":"1aa68b90.5b18d4","order":16,"width":2,"height":1,"passthru":false,"label":"<i class="fa fa-podcast" > blink","tooltip":"","color":"white","bgcolor":"{{background}}","icon":"","payload":"810F","payloadType":"str","topic":"","x":1880,"y":1440,"wires":[["319cf0e6.f709a","5fee8ecb.459f7"]]},{"id":"319cf0e6.f709a","type":"delay","z":"b6a3daf7.a23168","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1750,"y":1540,"wires":[["6176046c.1b3b6c","2bd239b8.7085a6"]]},{"id":"6176046c.1b3b6c","type":"change","z":"b6a3daf7.a23168","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"RED","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1880,"y":1660,"wires":[["82c9dc8d.87c11"]]},{"id":"f59c0526.513b98","type":"change","z":"b6a3daf7.a23168","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"gray","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2220,"y":1660,"wires":[["82c9dc8d.87c11"]]},{"id":"2bd239b8.7085a6","type":"delay","z":"b6a3daf7.a23168","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1980,"y":1560,"wires":[["f59c0526.513b98"]]},{"id":"333b3173.f8af5e","type":"comment","z":"b6a3daf7.a23168","name":"https://discourse.nodered.org/t/switch-button-ui-node-how-to-change-color-background-color-size/33799","info":"","x":1300,"y":1760,"wires":[]},{"id":"c01a603b.ecb408","type":"function","z":"b6a3daf7.a23168","name":"Gate","func":"if (msg.payload === "Heartbeat")node.send({ui_control:{icon:"fa-2x fa fa-heartbeat "},bgcolor:"black",color:"#2EFE2E",label :"Heartbeat",payload:msg.payload});\n\nif (msg.payload === "Taster gedrückt")node.send({ui_control:{icon:"fa-2x fa fa-hand-o-right"},bgcolor:"black",color:"#2EFE2E",label : "Taster",payload:msg.payload});\n\nif (msg.payload === "Bewegung!")node.send({ui_control:{icon:"fa-2x fa fa-eye"},bgcolor:"#EF0509",color:"#F1EC40",label : "Bewegung",payload:msg.payload});\n\nif (msg.payload === "Sabotage!")node.send({ui_control:{icon:"fa-2x fa fa-exclamation-triangle"},bgcolor:"#EF0509",color:"#F1EC40",label : "Sabotage",payload:msg.payload});\n\nif (msg.payload === "Ext.-Alarm")node.send({ui_control:{icon:"fa-2x fa fa-arrow-circle-o-right"},bgcolor:"#EF0509",color:"#F1EC40",label : "Ext.Alarm",payload:msg.payload});\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":1880,"wires":[["ce559685.e31d3"]]},{"id":"ce559685.e31d3","type":"ui_button","z":"b6a3daf7.a23168","name":"button","group":"1aa68b90.5b18d4","order":3,"width":3,"height":1,"passthru":true,"label":"{{msg.label}}","tooltip":"","color":"{{msg.color}}","bgcolor":"{{msg.bgcolor}}","icon":"{{msg.icon}}","payload":"pushed","payloadType":"str","topic":"","x":1250,"y":1880,"wires":[[]]},{"id":"1d0c5ada.d760d5","type":"comment","z":"b6a3daf7.a23168","name":"========== BUTTON : change icon, icon color, background color, size icon (for Font Awesome icon) ==========","info":"","x":1010,"y":1980,"wires":[]},{"id":"4b636783.05921","type":"comment","z":"b6a3daf7.a23168","name":"Angular materials icon : Animated","info":"","x":720,"y":1840,"wires":[]},{"id":"5d116238.28ee2c","type":"comment","z":"b6a3daf7.a23168","name":"Font Awesome icon : Not Animated","info":"","x":740,"y":1920,"wires":[]},{"id":"5a8ba290.3582d4","type":"inject","z":"b6a3daf7.a23168","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"Heartbeat","payloadType":"str","x":910,"y":2080,"wires":[["c01a603b.ecb408"]]},{"id":"fbda313e.0befe","type":"inject","z":"b6a3daf7.a23168","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"Taster gedrückt","payloadType":"str","x":920,"y":2120,"wires":[["c01a603b.ecb408"]]},{"id":"51bb1af.aff9664","type":"inject","z":"b6a3daf7.a23168","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"Bewegung!","payloadType":"str","x":910,"y":2160,"wires":[["c01a603b.ecb408"]]},{"id":"692b7a6f.314fec","type":"inject","z":"b6a3daf7.a23168","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"Sabotage!","payloadType":"str","x":910,"y":2200,"wires":[["c01a603b.ecb408"]]},{"id":"3a022df6.57135a","type":"inject","z":"b6a3daf7.a23168","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"Ext.-Alarm","payloadType":"str","x":910,"y":2240,"wires":[["c01a603b.ecb408"]]},{"id":"2302e799.d0b798","type":"ui_text","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":1,"width":4,"height":1,"name":"Device ID","label":"","format":"{{msg.payload}}","layout":"row-left","x":680,"y":880,"wires":[]},{"id":"8659228a.28bbd8","type":"link out","z":"b6a3daf7.a23168","name":"","links":["a7bb21c9.c544","562a4b4d.7accb4","6c6a6edc.967c7","b69fa9e.7a36d58","c076d26e.c24248","44089e5f.a1a0d8","25d76bd7.c8e674","38815cee.7565d4","ab2d02e9.2642f","13af0c32.55958c"],"x":375,"y":360,"wires":[]},{"id":"6e12c2a8.93b544","type":"link out","z":"b6a3daf7.a23168","name":"","links":["c3526d62.c1f7e","98e983de.fda15","62e0ba1c.116584","2a7e82f4.6eb03e","cb0ef488.e9704","2c257e0b.ef04c2","81bc5fd.a395fa","903c6076.cd9db"],"x":735,"y":600,"wires":[]},{"id":"6f8ec2be.266c7c","type":"link out","z":"b6a3daf7.a23168","name":"","links":["acd0233b.acac1","c2f002bc.acde78","f867c61e.6d507","d39b92d0.15923","f1b741ca.0a4328","8febdecc.74b2f8","a63edcdd.330688","6fc96320.7f0a9c","cf2c14fe.67a5e","b9cfafe4.bc461","77c1fbdf.cf25f4"],"x":515,"y":1420,"wires":[]},{"id":"b525ee87.dcd658","type":"link out","z":"b6a3daf7.a23168","name":"","links":["a330aab4.f4f778","22cf7122.e8b73e","938ac199.09826","7e568dc8.3aaaa4","504280f9.0a9f8","b8f36bc.a9a1418","66586b53.53d34c","cfbc468c.ba5d58"],"x":635,"y":820,"wires":[]},{"id":"f386340f.0fa49","type":"subflow:6dd596c0.510558","z":"b6a3daf7.a23168","name":"","env":[],"x":670,"y":400,"wires":[["c5a5ec14.25802"]]},{"id":"bf265051.7f9268","type":"change","z":"b6a3daf7.a23168","name":"Timeout 65 min","rules":[{"t":"set","p":"timeout","pt":"msg","to":"3900000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":400,"wires":[["f386340f.0fa49"]]},{"id":"c5a5ec14.25802","type":"function","z":"b6a3daf7.a23168","name":"Gate","func":"if (msg.payload ==true )node.send({ui_control:{icon:"fa-1x fa fa-wifi"},bgcolor:"black",color:"#00FF40",label :"Online",payload:msg.payload});\nif (msg.payload ==false )node.send({ui_control:{icon:"fa-1x fa fa-exclamation-circle"},bgcolor:"black",color:"#FF0000",label : "Offline",payload:msg.payload});\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":400,"wires":[["cd4e0589.9c6998"]]},{"id":"cd4e0589.9c6998","type":"ui_button","z":"b6a3daf7.a23168","name":"Signal Status","group":"1aa68b90.5b18d4","order":2,"width":2,"height":1,"passthru":true,"label":"{{msg.label}}","tooltip":"","color":"{{msg.color}}","bgcolor":"{{msg.bgcolor}}","icon":"{{msg.icon}}","payload":"pushed","payloadType":"str","topic":"","x":990,"y":400,"wires":[[]]},{"id":"15ac98d9.e3c24f","type":"function","z":"b6a3daf7.a23168","name":"Telegram Auslösung Offline","func":"if (msg.payload ==false)\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 ist offline!!"};\nreturn {payload};\n}\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":460,"wires":[["de3972fd.ea9ef8"]]},{"id":"de3972fd.ea9ef8","type":"telegram sender","z":"b6a3daf7.a23168","name":"","bot":"4a9ea72a.a5ce18","outputs":1,"x":1190,"y":460,"wires":[["746e74f5.d739d4"]]},{"id":"746e74f5.d739d4","type":"debug","z":"b6a3daf7.a23168","name":"Telegram","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","x":1210,"y":520,"wires":[]},{"id":"7e6f4a7.133a134","type":"ui_level","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":18,"width":2,"height":1,"name":"Batterie","label":"","colorHi":"#00ff40","colorWarn":"#ff9900","colorNormal":"#ff0000","colorOff":"#595959","min":"0","max":"4","segWarn":"2,2","segHigh":"2,8","unit":"V","layout":"sh","channelA":"","channelB":"","decimals":"2","animations":"soft","shape":"1","colorschema":"valuedriven","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"property":"payload","peaktime":3000,"x":1820,"y":1060,"wires":[]},{"id":"bc72b504.8bdac8","type":"ui_chart","z":"b6a3daf7.a23168","name":"","group":"1aa68b90.5b18d4","order":12,"width":6,"height":4,"label":"","chartType":"line","legend":"true","xformat":"dd HH:mm","interpolate":"linear","nodata":"Trend","dot":true,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":1650,"y":840,"wires":[[]]},{"id":"c3bc1f3e.91921","type":"ui_ui_control","z":"b6a3daf7.a23168","name":"inject dash events","events":"all","x":1670,"y":580,"wires":[["85b6d93e.0110d8"]]},{"id":"85b6d93e.0110d8","type":"link out","z":"b6a3daf7.a23168","name":"dash-init","links":["7814ed99.4469e4","4655dc09.ab2974","7992d502.2c43f4"],"x":1805,"y":580,"wires":[]},{"id":"248d8312.1f0874","type":"function","z":"b6a3daf7.a23168","name":"create groups","func":"var g_members = ["temperature","humidity","brightness"]\nvar g_limits = [{lo:-25,hi:70},{lo:0,hi:100},{lo:0,hi:255}]\nvar g = {"gaugegroup":{"members":[],"selected":"temperature"}} //\nfor(var i=0;i<g_members.length;i++){\n g.gaugegroup.members.push( {"topic":g_members[i],"lastvalue2":0,"min":g_limits[i].lo,"max":g_limits[i].hi})\n}\n\nglobal.set("buttongroups",g)\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1870,"y":530,"wires":[[]]},{"id":"3f877ac9.575cb6","type":"inject","z":"b6a3daf7.a23168","name":"init","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1650,"y":530,"wires":[["248d8312.1f0874"]]},{"id":"9196ebeb.18a29","type":"ui_button","z":"b6a3daf7.a23168","name":"temperature","group":"1aa68b90.5b18d4","order":8,"width":2,"height":1,"passthru":false,"label":"TEMPERATURE","tooltip":"","color":"","bgcolor":"{{bgr}}","icon":"","payload":"","payloadType":"str","topic":"temperature","x":2020,"y":680,"wires":[["7ce7a4fc.77f394"]]},{"id":"b116eb18.c4ccb8","type":"ui_button","z":"b6a3daf7.a23168","name":"humidity","group":"1aa68b90.5b18d4","order":9,"width":2,"height":1,"passthru":false,"label":"HUMIDITY","tooltip":"","color":"","bgcolor":"{{bgr}}","icon":"","payload":"","payloadType":"str","topic":"humidity","x":2010,"y":720,"wires":[["7ce7a4fc.77f394"]]},{"id":"bf9d3ac.ecff048","type":"ui_button","z":"b6a3daf7.a23168","name":"brightness","group":"1aa68b90.5b18d4","order":10,"width":2,"height":1,"passthru":false,"label":"BRIGHTNESS","tooltip":"","color":"","bgcolor":"{{bgr}}","icon":"","payload":"","payloadType":"str","topic":"brightness","x":2020,"y":760,"wires":[["7ce7a4fc.77f394"]]},{"id":"f5c2911b.8829e","type":"switch","z":"b6a3daf7.a23168","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"temperature","vt":"str"},{"t":"eq","v":"humidity","vt":"str"},{"t":"eq","v":"brightness","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":720,"wires":[["9196ebeb.18a29"],["b116eb18.c4ccb8"],["bf9d3ac.ecff048"]]},{"id":"3c35892.26cc2f6","type":"function","z":"b6a3daf7.a23168","name":"get color","func":"var group = global.get("buttongroups.gaugegroup")\nvar m\nfor(var i=0;i<group.members.length;i++){\n m = {topic:group.members[i].topic}\n m.bgr = group.members[i].topic == group.selected ? 'blue' : 'gray'\n node.send(m)\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1740,"y":720,"wires":[["f5c2911b.8829e"]]},{"id":"7ce7a4fc.77f394","type":"change","z":"b6a3daf7.a23168","name":"set selected","rules":[{"t":"set","p":"buttongroups.gaugegroup.selected","pt":"global","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":720,"wires":[["3eb2c71e.c5c58"]]},{"id":"3eb2c71e.c5c58","type":"link out","z":"b6a3daf7.a23168","name":"gaugegroup out","links":["4655dc09.ab2974","7992d502.2c43f4"],"x":2305,"y":720,"wires":[]},{"id":"4655dc09.ab2974","type":"link in","z":"b6a3daf7.a23168","name":"gaugegroup in","links":["3eb2c71e.c5c58","85b6d93e.0110d8"],"x":1645,"y":720,"wires":[["3c35892.26cc2f6"]]},{"id":"7992d502.2c43f4","type":"link in","z":"b6a3daf7.a23168","name":"gauge in","links":["3eb2c71e.c5c58","85b6d93e.0110d8"],"x":1915,"y":810,"wires":[["35d649f3.fdf1ce"]]},{"id":"2e3f0102.cfbb7e","type":"function","z":"b6a3daf7.a23168","name":"store inactive & bypass active","func":"var group = global.get("buttongroups.gaugegroup")\nif(group.selected != msg.topic){\n var member = group.members.find(element => element.topic == msg.topic);\n member.lastvalue2 = msg.payload\n global.set("buttongroups.gaugegroup",group)\n return\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2070,"y":860,"wires":[["87cc30e2.696aa8"]]},{"id":"35d649f3.fdf1ce","type":"function","z":"b6a3daf7.a23168","name":"prepare after selection change","func":"var group = global.get("buttongroups.gaugegroup")\nvar member = group.members.find(element => element.topic == group.selected);\nmsg.title = group.selected.toUpperCase()\nmsg.payload = member.lastvalue2\nmsg.ui_control = {min:member.min,max:member.max}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2100,"y":820,"wires":[["87cc30e2.696aa8"]]},{"id":"87cc30e2.696aa8","type":"ui_artlessgauge","z":"b6a3daf7.a23168","group":"1aa68b90.5b18d4","order":7,"width":4,"height":4,"name":"all","icon":"","label":"","unit":"","layout":"radial","decimals":"2","differential":false,"minmax":false,"colorTrack":"#555555","style":"","colorFromTheme":true,"property":"payload","secondary":"secondary","inline":false,"sectors":[{"val":-25,"col":"#f1ec40","t":"min","dot":0},{"val":300,"col":"#f1ec40","t":"max","dot":0}],"lineWidth":3,"bgcolorFromTheme":true,"diffCenter":"","x":2310,"y":840,"wires":[]},{"id":"4c5881d5.8d11d8","type":"comment","z":"b6a3daf7.a23168","name":"lastvalue2","info":"","x":1880,"y":480,"wires":[]},{"id":"f4565e18.c4f4c8","type":"comment","z":"b6a3daf7.a23168","name":"lastvalue2","info":"","x":2160,"y":780,"wires":[]},{"id":"fdc82543.10ff98","type":"comment","z":"b6a3daf7.a23168","name":"lastvalue2","info":"","x":2160,"y":900,"wires":[]},{"id":"e24c988b.699b78","type":"change","z":"b6a3daf7.a23168","name":"","rules":[{"t":"set","p":"ui_control.options.minLabelMinFontSize","pt":"msg","to":"16","tot":"num"},{"t":"set","p":"ui_control.options.maxLabelMinFontSize","pt":"msg","to":"16","tot":"num"},{"t":"set","p":"ui_control.options.labelMinFontSize","pt":"msg","to":"16","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2580,"y":700,"wires":[["8c14a7d9.681bb8"]]},{"id":"8c14a7d9.681bb8","type":"ui_gauge","z":"b6a3daf7.a23168","name":"","group":"39b7a5c6.1e9a8a","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value|number:2}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"3","seg2":"7","x":2750,"y":760,"wires":[]},{"id":"22d7d976.1fa2c6","type":"inject","z":"b6a3daf7.a23168","name":"","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2450,"y":760,"wires":[["f0bfbde4.1a8cf"]]},{"id":"f97cda05.dde058","type":"ui_ui_control","z":"b6a3daf7.a23168","name":"","x":2240,"y":560,"wires":[["95ef6d63.e77fd"]]},{"id":"2d8d8dd6.8c2a82","type":"comment","z":"b6a3daf7.a23168","name":"To send options when dashboard connects","info":"","x":2330,"y":520,"wires":[]},{"id":"95ef6d63.e77fd","type":"delay","z":"b6a3daf7.a23168","name":"","pauseType":"delay","timeout":"40","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2380,"y":620,"wires":[["e24c988b.699b78"]]},{"id":"250f93b0.a9b97c","type":"comment","z":"b6a3daf7.a23168","name":"Let gauge to be initialized before change any options","info":"There will be browser errors otherwise ","x":2520,"y":580,"wires":[]},{"id":"d94b0f1f.2a6f6","type":"comment","z":"b6a3daf7.a23168","name":"Change the options","info":"gauge scales according to predefined card size\ndefined font sizes are not absolute values but minimum values\nFor example if you make your gauge smaller, the changed font sizes may happen to be too large and will overlap.\n\nminLabelMinFontSize - minimum size of min field // number\nmaxLabelMinFontSize - minimum size of max field // number\nlabelMinFontSize - minimum size of units field // numbert\n\ndelete msg.payload cos it does not contain proper value","x":2580,"y":660,"wires":[]},{"id":"f0bfbde4.1a8cf","type":"function","z":"b6a3daf7.a23168","name":"random","func":"msg.payload = Math.random()*10\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2590,"y":760,"wires":[["8c14a7d9.681bb8"]]},{"id":"a651e851.2a2a28","type":"comment","z":"b6a3daf7.a23168","name":"generate random value","info":"","x":2530,"y":800,"wires":[]},{"id":"44fdb6de.ed72b","type":"mqtt-broker","name":"tilli diverese nodes","broker":"eu.thethings.network","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"1aa68b90.5b18d4","type":"ui_group","name":"OV Diversepilot002","tab":"c03f0ae2.a9dfd","order":2,"disp":false,"width":6,"collapse":false},{"id":"4a9ea72a.a5ce18","type":"telegram bot","botname":"alarma2021bot","usernames":"","chatids":"-1001467259300,-1001190964814","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"294556ce.ffa602","type":"ttn app","appId":"tilli","accessKey":"ttn-account-v2.goDkTdxHGK4cBdVAaDDnT2yiZEQWGKFqPr74WN4Eyl8","discovery":"discovery.thethingsnetwork.org:1900"},{"id":"39b7a5c6.1e9a8a","type":"ui_group","name":"Default","tab":"ad12ad91.ab672","order":1,"disp":true,"width":"6","collapse":false},{"id":"c03f0ae2.a9dfd","type":"ui_tab","name":"Devices","icon":"visibility","order":3,"disabled":false,"hidden":false},{"id":"ad12ad91.ab672","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

@hotNipi
Copy link
Author

hotNipi commented Jan 20, 2021

The JSON you have exported contains much more than the issue involves. Also it is not importable, cos something is corrupted.
Try https://jsonformatter.curiousconcept.com/ to see if your exported JSON is valid.

@rohnershare
Copy link

i hope it will go now. when it ist ok you can mail me on rohnershare@gmail.com. if it dont work. here the code

`[
{
"id":"6dd596c0.510558",
"type":"subflow",
"name":"Detect online",
"info":"",
"in":[
{
"x":260,
"y":100,
"wires":[
{
"id":"b819ab3d.82ac48"
},
{
"id":"9e8a5611.149218"
},
{
"id":"5e081291.070f0c"
}
]
}
],
"out":[
{
"x":1440,
"y":140,
"wires":[
{
"id":"a58a8850.3d5e58",
"port":0
},
{
"id":"9cf35d5a.5c0fb",
"port":0
}
]
}
]
},
{
"id":"b85986e7.098e48",
"type":"delay",
"z":"6dd596c0.510558",
"name":"",
"pauseType":"delayv",
"timeout":"5",
"timeoutUnits":"seconds",
"rate":"1",
"nbRateUnits":"1",
"rateUnits":"second",
"randomFirst":"1",
"randomLast":"5",
"randomUnits":"seconds",
"drop":false,
"x":870,
"y":160,
"wires":[
[
"57e39bb6.e63fd4"
]
]
},
{
"id":"9cf35d5a.5c0fb",
"type":"inject",
"z":"6dd596c0.510558",
"name":"Startup",
"repeat":"",
"crontab":"",
"once":true,
"topic":"",
"payload":"false",
"payloadType":"bool",
"x":930,
"y":260,
"wires":[
[
"57e39bb6.e63fd4"
]
]
},
{
"id":"9e8a5611.149218",
"type":"change",
"z":"6dd596c0.510558",
"name":"",
"rules":[
{
"t":"set",
"p":"reset",
"pt":"msg",
"to":"true",
"tot":"bool"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":670,
"y":160,
"wires":[
[
"b85986e7.098e48"
]
]
},
{
"id":"f6d33549.af3f78",
"type":"delay",
"z":"6dd596c0.510558",
"name":"",
"pauseType":"delay",
"timeout":"10",
"timeoutUnits":"milliseconds",
"rate":"1",
"nbRateUnits":"1",
"rateUnits":"second",
"randomFirst":"1",
"randomLast":"5",
"randomUnits":"seconds",
"drop":false,
"x":660,
"y":200,
"wires":[
[
"b85986e7.098e48"
]
]
},
{
"id":"b819ab3d.82ac48",
"type":"change",
"z":"6dd596c0.510558",
"name":"Online",
"rules":[
{
"t":"set",
"p":"payload",
"pt":"msg",
"to":"true",
"tot":"bool"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1030,
"y":110,
"wires":[
[
"b73f93e2.91396"
]
]
},
{
"id":"57e39bb6.e63fd4",
"type":"change",
"z":"6dd596c0.510558",
"name":"Offline",
"rules":[
{
"t":"set",
"p":"payload",
"pt":"msg",
"to":"false",
"tot":"bool"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1030,
"y":160,
"wires":[
[
"b73f93e2.91396"
]
]
},
{
"id":"a58a8850.3d5e58",
"type":"rbe",
"z":"6dd596c0.510558",
"name":"",
"func":"rbe",
"gap":"",
"start":"",
"inout":"out",
"x":1300,
"y":140,
"wires":[
[

     ]
  ]

},
{
"id":"5e081291.070f0c",
"type":"change",
"z":"6dd596c0.510558",
"name":"",
"rules":[
{
"t":"set",
"p":"delay",
"pt":"msg",
"to":"timeout",
"tot":"msg"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":440,
"y":200,
"wires":[
[
"f6d33549.af3f78"
]
]
},
{
"id":"96afa4d.9bf6758",
"type":"comment",
"z":"6dd596c0.510558",
"name":"Each incoming message will retrigger a new timeout (msg.timeout [ms]) before being reported offline",
"info":"",
"x":590,
"y":40,
"wires":[

  ]

},
{
"id":"b73f93e2.91396",
"type":"change",
"z":"6dd596c0.510558",
"name":"Offline",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"online",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1170,
"y":140,
"wires":[
[
"a58a8850.3d5e58"
]
]
},
{
"id":"b6a3daf7.a23168",
"type":"tab",
"label":"OV Diversepilot002",
"disabled":false,
"info":""
},
{
"id":"45149fdf.a2bf68",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://klarsys.github.io/angular-material-icons/",
"info":"",
"x":840,
"y":180,
"wires":[

  ]

},
{
"id":"7adf5f2d.f1c14",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"http://node-red.blogspot.com/2017/11/node-red-dashboard-output-text-node.html",
"info":"",
"x":950,
"y":140,
"wires":[

  ]

},
{
"id":"4983377a.c15d5",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://github.com/node-red/node-red-dashboard/tree/master/src/components/ui-component/templates",
"info":"",
"x":1010,
"y":220,
"wires":[

  ]

},
{
"id":"23f151a2.60bdfe",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"befehl für skalierung jede gruppe "hier aber nicht aktiv"",
"info":"",
"x":280,
"y":140,
"wires":[

  ]

},
{
"id":"9b9e92a2.84e558",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"objekt und msg payload ",
"info":"\n\nEin Object ist das hier:\n\nmsg.payload = {type:"Raspi", model:"4", name:"homepi"};\n\n\nDas besteht aus den Komponenten msg.payload.type, msg.payload.model und msg.payload.name.\n\n\nEin bool ist das hier:\n\nmsg.payload = true\n\n\nDas kann man nicht umwandeln.\n",
"x":760,
"y":260,
"wires":[

  ]

},
{
"id":"688fdc61.589a94",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"Tino-Secure-Node 001",
"info":"",
"x":180,
"y":220,
"wires":[

  ]

},
{
"id":"87b5d614.be6eb",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"LED Status",
"info":"",
"x":990,
"y":1340,
"wires":[

  ]

},
{
"id":"4ee52a45.c6ac64",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://flows.nodered.org/flow/7e4bb517ce3a75add0083642ef03e9d8",
"info":"",
"x":330,
"y":180,
"wires":[

  ]

},
{
"id":"bc5faa3e.5639c8",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://forum.iobroker.net/topic/420/beispiel-aktuelles-datum-formatieren-und-ausgeben",
"info":"",
"x":390,
"y":300,
"wires":[

  ]

},
{
"id":"cdd4cd70.3cc8a",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://www.instructables.com/Lora-Temperature-Dashboard/",
"info":"",
"x":1720,
"y":180,
"wires":[

  ]

},
{
"id":"310cb439.ccd19c",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"For MQTT "user"/"password", use "Application ID"/"default key" ",
"info":"\n1) Sign in to TTN and go to your application page where "app_1" is your "Application ID" e.g.\nhttps://console.thethingsnetwork.org/applications/app_1\n\n2) For MQTT User, use "Application ID" \n\n3) For MQTT password, scroll to bottom and use "default key" (you need to press the "eye" to see the long text)",
"x":1710,
"y":260,
"wires":[

  ]

},
{
"id":"c39c5e3.441ef2",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://www.instructables.com/Lora-Temperature-Dashboard/",
"info":"",
"x":1720,
"y":220,
"wires":[

  ]

},
{
"id":"29452d0b.fece1a",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Temperature",
"func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.T\nreturn msg;\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":490,
"y":940,
"wires":[
[
"c0d3b281.bc17d"
]
]
},
{
"id":"5f8a4c9a.732ccc",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Pressure",
"func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.P\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":480,
"y":1120,
"wires":[
[
"85948440.e8fb68"
]
]
},
{
"id":"b2585364.6eab9",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Device ID",
"func":"// outputs: 2\nmsg.payload = msg.payload.dev_id\nreturn msg;\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":480,
"y":880,
"wires":[
[
"2302e799.d0b798",
"b525ee87.dcd658"
]
]
},
{
"id":"9fa3efc5.c4d208",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"RSSI",
"func":"// outputs: 2\nmsg.payload = msg.payload.metadata.gateways[0].rssi\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":470,
"y":1160,
"wires":[
[
"9f69d487.0dd118",
"5eb4820f.40f9d4",
"8a88ca84.fed438"
]
]
},
{
"id":"770dcffd.46b948",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"SNR",
"func":"// outputs: 2\nmsg.payload = msg.payload.metadata.gateways[0].snr\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":470,
"y":1200,
"wires":[
[
"d1bb4284.bba0c8",
"e3a31f0f.4daed",
"f1299b1b.ca1878"
]
]
},
{
"id":"f0f1f8e8.a0c6f8",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Brightness",
"func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.H\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":490,
"y":1080,
"wires":[
[
"3847c852.538468"
]
]
},
{
"id":"78c391c9.fef7d8",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Humidity",
"func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.RH\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":480,
"y":980,
"wires":[
[
"a87c10a1.af892"
]
]
},
{
"id":"e67102a.98b7e8",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"VCC",
"func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.vcc/1000\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":470,
"y":1040,
"wires":[
[
"a8b3d2af.458e88"
]
]
},
{
"id":"8c597044.80f768",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Event",
"func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.event\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":430,
"y":1360,
"wires":[
[
"a2f8301f.574db8",
"375923a5.cf05ac",
"dfda0579.d24bc",
"32f9beba.d9ccd2",
"e6a5c000.f7556"
]
]
},
{
"id":"562337eb.d6cc18",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Count",
"func":"// outputs: 2\nmsg.payload = msg.payload.payload_fields.count\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":410,
"y":1460,
"wires":[
[
"c4eb387a.b8f3b",
"6f8ec2be.266c7c"
]
]
},
{
"id":"ed0a4099.5053a8",
"type":"mqtt in",
"z":"b6a3daf7.a23168",
"name":"tilli/devices/diversepilot002/up",
"topic":"tilli/devices/diversepilot002/up",
"qos":"2",
"datatype":"json",
"broker":"44fdb6de.ed72b",
"x":140,
"y":400,
"wires":[
[
"b2585364.6eab9",
"29452d0b.fece1a",
"78c391c9.fef7d8",
"e67102a.98b7e8",
"f0f1f8e8.a0c6f8",
"5f8a4c9a.732ccc",
"9fa3efc5.c4d208",
"770dcffd.46b948",
"8c597044.80f768",
"562337eb.d6cc18",
"8bfa4641.f21638",
"b1e6e41e.89f178",
"db31958c.99102",
"8659228a.28bbd8",
"bf265051.7f9268"
]
]
},
{
"id":"8c230ae3.1dd9b",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://flows.nodered.org/flow/cd90709d95fcba9970bd88205871c3c7",
"info":"",
"x":1690,
"y":300,
"wires":[

  ]

},
{
"id":"ebc21b4f.e003",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://diyprojects.io/node-red-module-dashboard-gui/#.X6sG5lAxmUl",
"info":"",
"x":330,
"y":260,
"wires":[

  ]

},
{
"id":"d1115638.44dc3",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://forum.iobroker.net/topic/420/beispiel-aktuelles-datum-formatieren-und-ausgeben/2",
"info":"",
"x":1750,
"y":340,
"wires":[

  ]

},
{
"id":"8bfa4641.f21638",
"type":"moment",
"z":"b6a3daf7.a23168",
"name":"",
"topic":"",
"input":"payload.metadata.time",
"inputType":"msg",
"inTz":"ETC/UTC",
"adjAmount":0,
"adjType":"days",
"adjDir":"add",
"format":"LLL",
"locale":"de-DE",
"output":"payload",
"outputType":"msg",
"outTz":"Europe/Berlin",
"x":520,
"y":640,
"wires":[
[
"95fcfe74.2f2d08",
"2cb3289b.e4aac8",
"6e12c2a8.93b544"
]
]
},
{
"id":"95fcfe74.2f2d08",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"last seen",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":true,
"complete":"true",
"targetType":"full",
"statusVal":"payload",
"statusType":"auto",
"x":790,
"y":700,
"wires":[

  ]

},
{
"id":"2cb3289b.e4aac8",
"type":"ui_text",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":4,
"width":3,
"height":1,
"name":"Last seen",
"label":"",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":780,
"y":640,
"wires":[

  ]

},
{
"id":"a2f8301f.574db8",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Telegram Auslösung",
"func":"if (msg.payload =="4")\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 Bewegung erkannt!"};\nreturn {payload};\n}\n\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":840,
"y":1240,
"wires":[
[
"3b04ef0e.9796a8"
]
]
},
{
"id":"3b04ef0e.9796a8",
"type":"telegram sender",
"z":"b6a3daf7.a23168",
"name":"",
"bot":"4a9ea72a.a5ce18",
"outputs":1,
"x":1130,
"y":1260,
"wires":[
[
"991ece1.f33403"
]
]
},
{
"id":"991ece1.f33403",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"Telegram",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":false,
"complete":"true",
"targetType":"full",
"x":1310,
"y":1260,
"wires":[

  ]

},
{
"id":"375923a5.cf05ac",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Telegram Prüftaste Auslösung",
"func":"if (msg.payload =="2")\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 PRÜFTASTE GEDRÜCKT!"};\nreturn {payload};\n}",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":830,
"y":1380,
"wires":[
[
"3b04ef0e.9796a8"
]
]
},
{
"id":"b1e6e41e.89f178",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"tilli/devices/diversepilot002/up",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":true,
"complete":"true",
"targetType":"full",
"statusVal":"payload",
"statusType":"auto",
"x":520,
"y":460,
"wires":[

  ]

},
{
"id":"c0d3b281.bc17d",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"fake temp",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"temperature",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1460,
"y":860,
"wires":[
[
"bc72b504.8bdac8",
"2e3f0102.cfbb7e"
]
]
},
{
"id":"a87c10a1.af892",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"fake humidity",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"humidity",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1450,
"y":900,
"wires":[
[
"bc72b504.8bdac8",
"2e3f0102.cfbb7e"
]
]
},
{
"id":"a8b3d2af.458e88",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"vcc",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"vcc",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1450,
"y":960,
"wires":[
[
"7e6f4a7.133a134"
]
]
},
{
"id":"3847c852.538468",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"fake brightness",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"brightness",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1440,
"y":1000,
"wires":[
[
"bc72b504.8bdac8",
"2e3f0102.cfbb7e"
]
]
},
{
"id":"350e5fa0.3c05d",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"LED Status",
"info":"",
"x":1630,
"y":380,
"wires":[

  ]

},
{
"id":"47e0a2f8.ebef44",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"neue gruppe hier zuert drücken sonst kein wert im dashboard",
"info":"",
"x":1480,
"y":420,
"wires":[

  ]

},
{
"id":"85948440.e8fb68",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"fake pressure",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"pressure",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1440,
"y":1040,
"wires":[
[

     ]
  ]

},
{
"id":"9f69d487.0dd118",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"fake rssi",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"rssi",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1420,
"y":1080,
"wires":[
[

     ]
  ]

},
{
"id":"d1bb4284.bba0c8",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"fake snr",
"rules":[
{
"t":"set",
"p":"topic",
"pt":"msg",
"to":"snr",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1420,
"y":1120,
"wires":[
[

     ]
  ]

},
{
"id":"c4eb387a.b8f3b",
"type":"ui_text",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":15,
"width":2,
"height":1,
"name":"Count",
"label":"Count",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":570,
"y":1460,
"wires":[

  ]

},
{
"id":"e3a31f0f.4daed",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"last seen",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":true,
"complete":"true",
"targetType":"full",
"statusVal":"payload",
"statusType":"auto",
"x":610,
"y":1240,
"wires":[

  ]

},
{
"id":"5eb4820f.40f9d4",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"last seen",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":true,
"complete":"true",
"targetType":"full",
"statusVal":"payload",
"statusType":"auto",
"x":630,
"y":1160,
"wires":[

  ]

},
{
"id":"f1299b1b.ca1878",
"type":"ui_text",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":11,
"width":2,
"height":1,
"name":"SNR",
"label":"SNR",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":530,
"y":1300,
"wires":[

  ]

},
{
"id":"8a88ca84.fed438",
"type":"ui_text",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":14,
"width":2,
"height":1,
"name":"RSSI",
"label":"RSSI",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":830,
"y":1180,
"wires":[

  ]

},
{
"id":"db31958c.99102",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Gatyeway ID",
"func":"// outputs: 2\nmsg.payload = msg.payload.metadata.gateways[0].gtw_id\nreturn msg;\n\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":350,
"y":1520,
"wires":[
[
"1e9ebb7e.4023e5"
]
]
},
{
"id":"1e9ebb7e.4023e5",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"Gayteway Name",
"rules":[
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"eui-b827ebfffe8ea2ac",
"fromt":"str",
"to":"1_CH_PRATTELN_iC880A",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"eui-b827ebfffeba844f",
"fromt":"str",
"to":"2_DE_BROMBACH_iC880A",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"eui-b827ebfffed2573e",
"fromt":"str",
"to":"3_DE_MUENSTERTAL_iC880A",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"eui-58a0cbfffe802a64",
"fromt":"str",
"to":"4_CH_Rocco_Fitnessstudio",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"eui-3133303734002500",
"fromt":"str",
"to":"001_Rent_Mikrotik8_GSM",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":520,
"y":1520,
"wires":[
[
"17b394a7.d567bb"
]
]
},
{
"id":"17b394a7.d567bb",
"type":"ui_text",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":13,
"width":6,
"height":1,
"name":"Gateway",
"label":"Gateway",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":700,
"y":1520,
"wires":[

  ]

},
{
"id":"dfda0579.d24bc",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Telegram Sabotage",
"func":"if (msg.payload =="8")\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 Sabotage !"};\nreturn {payload};\n}\n\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":790,
"y":1340,
"wires":[
[
"3b04ef0e.9796a8"
]
]
},
{
"id":"35202200.71d0a6",
"type":"ui_toast",
"z":"b6a3daf7.a23168",
"position":"top right",
"displayTime":"3",
"highlight":"",
"sendall":true,
"outputs":0,
"ok":"OK",
"cancel":"",
"raw":false,
"topic":"",
"name":"",
"x":1390,
"y":1580,
"wires":[

  ]

},
{
"id":"5fee8ecb.459f7",
"type":"ttn downlink",
"z":"b6a3daf7.a23168",
"name":"",
"app":"294556ce.ffa602",
"dev_id":"diversepilot002",
"port":"1",
"confirmed":true,
"schedule":"replace",
"x":2270,
"y":1440,
"wires":[

  ]

},
{
"id":"32f9beba.d9ccd2",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"Zahl in Text",
"rules":[
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"1",
"fromt":"num",
"to":"Heartbeat",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"2",
"fromt":"num",
"to":"Taster gedrückt",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"4",
"fromt":"num",
"to":"Bewegung!",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"8",
"fromt":"num",
"to":"Sabotage!",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"16",
"fromt":"num",
"to":"Ext.-Alarm",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1110,
"y":1460,
"wires":[
[
"52dc6616.07d0c",
"35202200.71d0a6",
"6ae5d83b.2755a8",
"c01a603b.ecb408"
]
]
},
{
"id":"52dc6616.07d0c",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Color Mapping",
"func":"switch (msg.payload) {\n\ncase "Heartbeat" : \n msg.color = "green";\n break;\n \ncase "Taster gedrückt" : \n msg.color = "magenta";\n break;\n \ncase "Bewegung!" : \nmsg.color = "red 1";\nbreak;\n\ncase "Sabotage!" : \nmsg.color = "red 1";\nbreak;\n\n\ncase "Ext.-Alarm" : \nmsg.color = "red 1";\nbreak;\n\n \ndefault : \n msg.color = "sgi gray 52";\n break;\n}\n\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":1320,
"y":1460,
"wires":[
[
"fd1e4ec8.c3e38"
]
]
},
{
"id":"fd1e4ec8.c3e38",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"last seen",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":true,
"complete":"true",
"targetType":"full",
"statusVal":"payload",
"statusType":"auto",
"x":1510,
"y":1440,
"wires":[

  ]

},
{
"id":"6ae5d83b.2755a8",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"last seen",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":true,
"complete":"true",
"targetType":"full",
"statusVal":"payload",
"statusType":"auto",
"x":1290,
"y":1380,
"wires":[

  ]

},
{
"id":"e6a5c000.f7556",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"last seen",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":true,
"complete":"true",
"targetType":"full",
"statusVal":"payload",
"statusType":"auto",
"x":890,
"y":1500,
"wires":[

  ]

},
{
"id":"82c9dc8d.87c11",
"type":"ui_button",
"z":"b6a3daf7.a23168",
"name":"",
"group":"1aa68b90.5b18d4",
"order":16,
"width":2,
"height":1,
"passthru":false,
"label":"<i class="fa fa-podcast" > blink",
"tooltip":"",
"color":"white",
"bgcolor":"{{background}}",
"icon":"",
"payload":"810F",
"payloadType":"str",
"topic":"",
"x":1880,
"y":1440,
"wires":[
[
"319cf0e6.f709a",
"5fee8ecb.459f7"
]
]
},
{
"id":"319cf0e6.f709a",
"type":"delay",
"z":"b6a3daf7.a23168",
"name":"",
"pauseType":"delay",
"timeout":"0.5",
"timeoutUnits":"seconds",
"rate":"1",
"nbRateUnits":"1",
"rateUnits":"second",
"randomFirst":"1",
"randomLast":"5",
"randomUnits":"seconds",
"drop":false,
"x":1750,
"y":1540,
"wires":[
[
"6176046c.1b3b6c",
"2bd239b8.7085a6"
]
]
},
{
"id":"6176046c.1b3b6c",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"",
"rules":[
{
"t":"set",
"p":"background",
"pt":"msg",
"to":"RED",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":1880,
"y":1660,
"wires":[
[
"82c9dc8d.87c11"
]
]
},
{
"id":"f59c0526.513b98",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"",
"rules":[
{
"t":"set",
"p":"background",
"pt":"msg",
"to":"gray",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":2220,
"y":1660,
"wires":[
[
"82c9dc8d.87c11"
]
]
},
{
"id":"2bd239b8.7085a6",
"type":"delay",
"z":"b6a3daf7.a23168",
"name":"",
"pauseType":"delay",
"timeout":"3",
"timeoutUnits":"seconds",
"rate":"1",
"nbRateUnits":"1",
"rateUnits":"second",
"randomFirst":"1",
"randomLast":"5",
"randomUnits":"seconds",
"drop":false,
"x":1980,
"y":1560,
"wires":[
[
"f59c0526.513b98"
]
]
},
{
"id":"333b3173.f8af5e",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"https://discourse.nodered.org/t/switch-button-ui-node-how-to-change-color-background-color-size/33799",
"info":"",
"x":1300,
"y":1760,
"wires":[

  ]

},
{
"id":"c01a603b.ecb408",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Gate",
"func":"if (msg.payload === "Heartbeat")node.send({ui_control:{icon:"fa-2x fa fa-heartbeat "},bgcolor:"black",color:"#2EFE2E",label :"Heartbeat",payload:msg.payload});\n\nif (msg.payload === "Taster gedrückt")node.send({ui_control:{icon:"fa-2x fa fa-hand-o-right"},bgcolor:"black",color:"#2EFE2E",label : "Taster",payload:msg.payload});\n\nif (msg.payload === "Bewegung!")node.send({ui_control:{icon:"fa-2x fa fa-eye"},bgcolor:"#EF0509",color:"#F1EC40",label : "Bewegung",payload:msg.payload});\n\nif (msg.payload === "Sabotage!")node.send({ui_control:{icon:"fa-2x fa fa-exclamation-triangle"},bgcolor:"#EF0509",color:"#F1EC40",label : "Sabotage",payload:msg.payload});\n\nif (msg.payload === "Ext.-Alarm")node.send({ui_control:{icon:"fa-2x fa fa-arrow-circle-o-right"},bgcolor:"#EF0509",color:"#F1EC40",label : "Ext.Alarm",payload:msg.payload});\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":1130,
"y":1880,
"wires":[
[
"ce559685.e31d3"
]
]
},
{
"id":"ce559685.e31d3",
"type":"ui_button",
"z":"b6a3daf7.a23168",
"name":"button",
"group":"1aa68b90.5b18d4",
"order":3,
"width":3,
"height":1,
"passthru":true,
"label":"{{msg.label}}",
"tooltip":"",
"color":"{{msg.color}}",
"bgcolor":"{{msg.bgcolor}}",
"icon":"{{msg.icon}}",
"payload":"pushed",
"payloadType":"str",
"topic":"",
"x":1250,
"y":1880,
"wires":[
[

     ]
  ]

},
{
"id":"1d0c5ada.d760d5",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"========== BUTTON : change icon, icon color, background color, size icon (for Font Awesome icon) ==========",
"info":"",
"x":1010,
"y":1980,
"wires":[

  ]

},
{
"id":"4b636783.05921",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"Angular materials icon : Animated",
"info":"",
"x":720,
"y":1840,
"wires":[

  ]

},
{
"id":"5d116238.28ee2c",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"Font Awesome icon : Not Animated",
"info":"",
"x":740,
"y":1920,
"wires":[

  ]

},
{
"id":"5a8ba290.3582d4",
"type":"inject",
"z":"b6a3daf7.a23168",
"name":"",
"props":[
{
"p":"payload"
},
{
"p":"topic",
"vt":"str"
}
],
"repeat":"",
"crontab":"",
"once":true,
"onceDelay":"",
"topic":"",
"payload":"Heartbeat",
"payloadType":"str",
"x":910,
"y":2080,
"wires":[
[
"c01a603b.ecb408"
]
]
},
{
"id":"fbda313e.0befe",
"type":"inject",
"z":"b6a3daf7.a23168",
"name":"",
"props":[
{
"p":"payload"
},
{
"p":"topic",
"vt":"str"
}
],
"repeat":"",
"crontab":"",
"once":true,
"onceDelay":"",
"topic":"",
"payload":"Taster gedrückt",
"payloadType":"str",
"x":920,
"y":2120,
"wires":[
[
"c01a603b.ecb408"
]
]
},
{
"id":"51bb1af.aff9664",
"type":"inject",
"z":"b6a3daf7.a23168",
"name":"",
"props":[
{
"p":"payload"
},
{
"p":"topic",
"vt":"str"
}
],
"repeat":"",
"crontab":"",
"once":true,
"onceDelay":"",
"topic":"",
"payload":"Bewegung!",
"payloadType":"str",
"x":910,
"y":2160,
"wires":[
[
"c01a603b.ecb408"
]
]
},
{
"id":"692b7a6f.314fec",
"type":"inject",
"z":"b6a3daf7.a23168",
"name":"",
"props":[
{
"p":"payload"
},
{
"p":"topic",
"vt":"str"
}
],
"repeat":"",
"crontab":"",
"once":true,
"onceDelay":"",
"topic":"",
"payload":"Sabotage!",
"payloadType":"str",
"x":910,
"y":2200,
"wires":[
[
"c01a603b.ecb408"
]
]
},
{
"id":"3a022df6.57135a",
"type":"inject",
"z":"b6a3daf7.a23168",
"name":"",
"props":[
{
"p":"payload"
},
{
"p":"topic",
"vt":"str"
}
],
"repeat":"",
"crontab":"",
"once":true,
"onceDelay":"",
"topic":"",
"payload":"Ext.-Alarm",
"payloadType":"str",
"x":910,
"y":2240,
"wires":[
[
"c01a603b.ecb408"
]
]
},
{
"id":"2302e799.d0b798",
"type":"ui_text",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":1,
"width":4,
"height":1,
"name":"Device ID",
"label":"",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":680,
"y":880,
"wires":[

  ]

},
{
"id":"8659228a.28bbd8",
"type":"link out",
"z":"b6a3daf7.a23168",
"name":"",
"links":[
"a7bb21c9.c544",
"562a4b4d.7accb4",
"6c6a6edc.967c7",
"b69fa9e.7a36d58",
"c076d26e.c24248",
"44089e5f.a1a0d8",
"25d76bd7.c8e674",
"38815cee.7565d4",
"ab2d02e9.2642f",
"13af0c32.55958c"
],
"x":375,
"y":360,
"wires":[

  ]

},
{
"id":"6e12c2a8.93b544",
"type":"link out",
"z":"b6a3daf7.a23168",
"name":"",
"links":[
"c3526d62.c1f7e",
"98e983de.fda15",
"62e0ba1c.116584",
"2a7e82f4.6eb03e",
"cb0ef488.e9704",
"2c257e0b.ef04c2",
"81bc5fd.a395fa",
"903c6076.cd9db"
],
"x":735,
"y":600,
"wires":[

  ]

},
{
"id":"6f8ec2be.266c7c",
"type":"link out",
"z":"b6a3daf7.a23168",
"name":"",
"links":[
"acd0233b.acac1",
"c2f002bc.acde78",
"f867c61e.6d507",
"d39b92d0.15923",
"f1b741ca.0a4328",
"8febdecc.74b2f8",
"a63edcdd.330688",
"6fc96320.7f0a9c",
"cf2c14fe.67a5e",
"b9cfafe4.bc461",
"77c1fbdf.cf25f4"
],
"x":515,
"y":1420,
"wires":[

  ]

},
{
"id":"b525ee87.dcd658",
"type":"link out",
"z":"b6a3daf7.a23168",
"name":"",
"links":[
"a330aab4.f4f778",
"22cf7122.e8b73e",
"938ac199.09826",
"7e568dc8.3aaaa4",
"504280f9.0a9f8",
"b8f36bc.a9a1418",
"66586b53.53d34c",
"cfbc468c.ba5d58"
],
"x":635,
"y":820,
"wires":[

  ]

},
{
"id":"f386340f.0fa49",
"type":"subflow:6dd596c0.510558",
"z":"b6a3daf7.a23168",
"name":"",
"env":[

  ],
  "x":670,
  "y":400,
  "wires":[
     [
        "c5a5ec14.25802"
     ]
  ]

},
{
"id":"bf265051.7f9268",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"Timeout 65 min",
"rules":[
{
"t":"set",
"p":"timeout",
"pt":"msg",
"to":"3900000",
"tot":"num"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":480,
"y":400,
"wires":[
[
"f386340f.0fa49"
]
]
},
{
"id":"c5a5ec14.25802",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Gate",
"func":"if (msg.payload ==true )node.send({ui_control:{icon:"fa-1x fa fa-wifi"},bgcolor:"black",color:"#00FF40",label :"Online",payload:msg.payload});\nif (msg.payload ==false )node.send({ui_control:{icon:"fa-1x fa fa-exclamation-circle"},bgcolor:"black",color:"#FF0000",label : "Offline",payload:msg.payload});\n\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":830,
"y":400,
"wires":[
[
"cd4e0589.9c6998"
]
]
},
{
"id":"cd4e0589.9c6998",
"type":"ui_button",
"z":"b6a3daf7.a23168",
"name":"Signal Status",
"group":"1aa68b90.5b18d4",
"order":2,
"width":2,
"height":1,
"passthru":true,
"label":"{{msg.label}}",
"tooltip":"",
"color":"{{msg.color}}",
"bgcolor":"{{msg.bgcolor}}",
"icon":"{{msg.icon}}",
"payload":"pushed",
"payloadType":"str",
"topic":"",
"x":990,
"y":400,
"wires":[
[

     ]
  ]

},
{
"id":"15ac98d9.e3c24f",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"Telegram Auslösung Offline",
"func":"if (msg.payload ==false)\n\n{\nlet payload = {chatId:-1001190964814,\ntype:"message"\n,content:"Diversepilot002 ist offline!!"};\nreturn {payload};\n}\n\n\n\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":940,
"y":460,
"wires":[
[
"de3972fd.ea9ef8"
]
]
},
{
"id":"de3972fd.ea9ef8",
"type":"telegram sender",
"z":"b6a3daf7.a23168",
"name":"",
"bot":"4a9ea72a.a5ce18",
"outputs":1,
"x":1190,
"y":460,
"wires":[
[
"746e74f5.d739d4"
]
]
},
{
"id":"746e74f5.d739d4",
"type":"debug",
"z":"b6a3daf7.a23168",
"name":"Telegram",
"active":true,
"tosidebar":true,
"console":true,
"tostatus":false,
"complete":"true",
"targetType":"full",
"x":1210,
"y":520,
"wires":[

  ]

},
{
"id":"7e6f4a7.133a134",
"type":"ui_level",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":18,
"width":2,
"height":1,
"name":"Batterie",
"label":"",
"colorHi":"#00ff40",
"colorWarn":"#ff9900",
"colorNormal":"#ff0000",
"colorOff":"#595959",
"min":"0",
"max":"4",
"segWarn":"2,2",
"segHigh":"2,8",
"unit":"V",
"layout":"sh",
"channelA":"",
"channelB":"",
"decimals":"2",
"animations":"soft",
"shape":"1",
"colorschema":"valuedriven",
"textoptions":"default",
"colorText":"#eeeeee",
"fontLabel":"",
"fontValue":"",
"fontSmall":"",
"colorFromTheme":true,
"textAnimations":false,
"hideValue":false,
"tickmode":"off",
"peakmode":false,
"property":"payload",
"peaktime":3000,
"x":1820,
"y":1060,
"wires":[

  ]

},
{
"id":"bc72b504.8bdac8",
"type":"ui_chart",
"z":"b6a3daf7.a23168",
"name":"",
"group":"1aa68b90.5b18d4",
"order":12,
"width":6,
"height":4,
"label":"",
"chartType":"line",
"legend":"true",
"xformat":"dd HH:mm",
"interpolate":"linear",
"nodata":"Trend",
"dot":true,
"ymin":"",
"ymax":"",
"removeOlder":"1",
"removeOlderPoints":"",
"removeOlderUnit":"86400",
"cutout":0,
"useOneColor":false,
"useUTC":false,
"colors":[
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs":1,
"x":1650,
"y":840,
"wires":[
[

     ]
  ]

},
{
"id":"c3bc1f3e.91921",
"type":"ui_ui_control",
"z":"b6a3daf7.a23168",
"name":"inject dash events",
"events":"all",
"x":1670,
"y":580,
"wires":[
[
"85b6d93e.0110d8"
]
]
},
{
"id":"85b6d93e.0110d8",
"type":"link out",
"z":"b6a3daf7.a23168",
"name":"dash-init",
"links":[
"7814ed99.4469e4",
"4655dc09.ab2974",
"7992d502.2c43f4"
],
"x":1805,
"y":580,
"wires":[

  ]

},
{
"id":"248d8312.1f0874",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"create groups",
"func":"var g_members = ["temperature","humidity","brightness"]\nvar g_limits = [{lo:-25,hi:70},{lo:0,hi:100},{lo:0,hi:255}]\nvar g = {"gaugegroup":{"members":[],"selected":"temperature"}} //\nfor(var i=0;i<g_members.length;i++){\n g.gaugegroup.members.push( {"topic":g_members[i],"lastvalue2":0,"min":g_limits[i].lo,"max":g_limits[i].hi})\n}\n\nglobal.set("buttongroups",g)\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":1870,
"y":530,
"wires":[
[

     ]
  ]

},
{
"id":"3f877ac9.575cb6",
"type":"inject",
"z":"b6a3daf7.a23168",
"name":"init",
"repeat":"",
"crontab":"",
"once":false,
"onceDelay":0.1,
"topic":"",
"payload":"",
"payloadType":"date",
"x":1650,
"y":530,
"wires":[
[
"248d8312.1f0874"
]
]
},
{
"id":"9196ebeb.18a29",
"type":"ui_button",
"z":"b6a3daf7.a23168",
"name":"temperature",
"group":"1aa68b90.5b18d4",
"order":8,
"width":2,
"height":1,
"passthru":false,
"label":"TEMPERATURE",
"tooltip":"",
"color":"",
"bgcolor":"{{bgr}}",
"icon":"",
"payload":"",
"payloadType":"str",
"topic":"temperature",
"x":2020,
"y":680,
"wires":[
[
"7ce7a4fc.77f394"
]
]
},
{
"id":"b116eb18.c4ccb8",
"type":"ui_button",
"z":"b6a3daf7.a23168",
"name":"humidity",
"group":"1aa68b90.5b18d4",
"order":9,
"width":2,
"height":1,
"passthru":false,
"label":"HUMIDITY",
"tooltip":"",
"color":"",
"bgcolor":"{{bgr}}",
"icon":"",
"payload":"",
"payloadType":"str",
"topic":"humidity",
"x":2010,
"y":720,
"wires":[
[
"7ce7a4fc.77f394"
]
]
},
{
"id":"bf9d3ac.ecff048",
"type":"ui_button",
"z":"b6a3daf7.a23168",
"name":"brightness",
"group":"1aa68b90.5b18d4",
"order":10,
"width":2,
"height":1,
"passthru":false,
"label":"BRIGHTNESS",
"tooltip":"",
"color":"",
"bgcolor":"{{bgr}}",
"icon":"",
"payload":"",
"payloadType":"str",
"topic":"brightness",
"x":2020,
"y":760,
"wires":[
[
"7ce7a4fc.77f394"
]
]
},
{
"id":"f5c2911b.8829e",
"type":"switch",
"z":"b6a3daf7.a23168",
"name":"",
"property":"topic",
"propertyType":"msg",
"rules":[
{
"t":"eq",
"v":"temperature",
"vt":"str"
},
{
"t":"eq",
"v":"humidity",
"vt":"str"
},
{
"t":"eq",
"v":"brightness",
"vt":"str"
}
],
"checkall":"true",
"repair":false,
"outputs":3,
"x":1870,
"y":720,
"wires":[
[
"9196ebeb.18a29"
],
[
"b116eb18.c4ccb8"
],
[
"bf9d3ac.ecff048"
]
]
},
{
"id":"3c35892.26cc2f6",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"get color",
"func":"var group = global.get("buttongroups.gaugegroup")\nvar m\nfor(var i=0;i<group.members.length;i++){\n m = {topic:group.members[i].topic}\n m.bgr = group.members[i].topic == group.selected ? 'blue' : 'gray'\n node.send(m)\n}\n",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":1740,
"y":720,
"wires":[
[
"f5c2911b.8829e"
]
]
},
{
"id":"7ce7a4fc.77f394",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"set selected",
"rules":[
{
"t":"set",
"p":"buttongroups.gaugegroup.selected",
"pt":"global",
"to":"topic",
"tot":"msg"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":2200,
"y":720,
"wires":[
[
"3eb2c71e.c5c58"
]
]
},
{
"id":"3eb2c71e.c5c58",
"type":"link out",
"z":"b6a3daf7.a23168",
"name":"gaugegroup out",
"links":[
"4655dc09.ab2974",
"7992d502.2c43f4"
],
"x":2305,
"y":720,
"wires":[

  ]

},
{
"id":"4655dc09.ab2974",
"type":"link in",
"z":"b6a3daf7.a23168",
"name":"gaugegroup in",
"links":[
"3eb2c71e.c5c58",
"85b6d93e.0110d8"
],
"x":1645,
"y":720,
"wires":[
[
"3c35892.26cc2f6"
]
]
},
{
"id":"7992d502.2c43f4",
"type":"link in",
"z":"b6a3daf7.a23168",
"name":"gauge in",
"links":[
"3eb2c71e.c5c58",
"85b6d93e.0110d8"
],
"x":1915,
"y":810,
"wires":[
[
"35d649f3.fdf1ce"
]
]
},
{
"id":"2e3f0102.cfbb7e",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"store inactive & bypass active",
"func":"var group = global.get("buttongroups.gaugegroup")\nif(group.selected != msg.topic){\n var member = group.members.find(element => element.topic == msg.topic);\n member.lastvalue2 = msg.payload\n global.set("buttongroups.gaugegroup",group)\n return\n}\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":2070,
"y":860,
"wires":[
[
"87cc30e2.696aa8"
]
]
},
{
"id":"35d649f3.fdf1ce",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"prepare after selection change",
"func":"var group = global.get("buttongroups.gaugegroup")\nvar member = group.members.find(element => element.topic == group.selected);\nmsg.title = group.selected.toUpperCase()\nmsg.payload = member.lastvalue2\nmsg.ui_control = {min:member.min,max:member.max}\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":2100,
"y":820,
"wires":[
[
"87cc30e2.696aa8"
]
]
},
{
"id":"87cc30e2.696aa8",
"type":"ui_artlessgauge",
"z":"b6a3daf7.a23168",
"group":"1aa68b90.5b18d4",
"order":7,
"width":4,
"height":4,
"name":"all",
"icon":"",
"label":"",
"unit":"",
"layout":"radial",
"decimals":"2",
"differential":false,
"minmax":false,
"colorTrack":"#555555",
"style":"",
"colorFromTheme":true,
"property":"payload",
"secondary":"secondary",
"inline":false,
"sectors":[
{
"val":-25,
"col":"#f1ec40",
"t":"min",
"dot":0
},
{
"val":300,
"col":"#f1ec40",
"t":"max",
"dot":0
}
],
"lineWidth":3,
"bgcolorFromTheme":true,
"diffCenter":"",
"x":2310,
"y":840,
"wires":[

  ]

},
{
"id":"4c5881d5.8d11d8",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"lastvalue2",
"info":"",
"x":1880,
"y":480,
"wires":[

  ]

},
{
"id":"f4565e18.c4f4c8",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"lastvalue2",
"info":"",
"x":2160,
"y":780,
"wires":[

  ]

},
{
"id":"fdc82543.10ff98",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"lastvalue2",
"info":"",
"x":2160,
"y":900,
"wires":[

  ]

},
{
"id":"e24c988b.699b78",
"type":"change",
"z":"b6a3daf7.a23168",
"name":"",
"rules":[
{
"t":"set",
"p":"ui_control.options.minLabelMinFontSize",
"pt":"msg",
"to":"16",
"tot":"num"
},
{
"t":"set",
"p":"ui_control.options.maxLabelMinFontSize",
"pt":"msg",
"to":"16",
"tot":"num"
},
{
"t":"set",
"p":"ui_control.options.labelMinFontSize",
"pt":"msg",
"to":"16",
"tot":"str"
},
{
"t":"delete",
"p":"payload",
"pt":"msg"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":2580,
"y":700,
"wires":[
[
"8c14a7d9.681bb8"
]
]
},
{
"id":"8c14a7d9.681bb8",
"type":"ui_gauge",
"z":"b6a3daf7.a23168",
"name":"",
"group":"39b7a5c6.1e9a8a",
"order":0,
"width":0,
"height":0,
"gtype":"gage",
"title":"gauge",
"label":"units",
"format":"{{value|number:2}}",
"min":0,
"max":10,
"colors":[
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1":"3",
"seg2":"7",
"x":2750,
"y":760,
"wires":[

  ]

},
{
"id":"22d7d976.1fa2c6",
"type":"inject",
"z":"b6a3daf7.a23168",
"name":"",
"repeat":"1",
"crontab":"",
"once":false,
"onceDelay":0.1,
"topic":"",
"payload":"",
"payloadType":"date",
"x":2450,
"y":760,
"wires":[
[
"f0bfbde4.1a8cf"
]
]
},
{
"id":"f97cda05.dde058",
"type":"ui_ui_control",
"z":"b6a3daf7.a23168",
"name":"",
"x":2240,
"y":560,
"wires":[
[
"95ef6d63.e77fd"
]
]
},
{
"id":"2d8d8dd6.8c2a82",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"To send options when dashboard connects",
"info":"",
"x":2330,
"y":520,
"wires":[

  ]

},
{
"id":"95ef6d63.e77fd",
"type":"delay",
"z":"b6a3daf7.a23168",
"name":"",
"pauseType":"delay",
"timeout":"40",
"timeoutUnits":"milliseconds",
"rate":"1",
"nbRateUnits":"1",
"rateUnits":"second",
"randomFirst":"1",
"randomLast":"5",
"randomUnits":"seconds",
"drop":false,
"x":2380,
"y":620,
"wires":[
[
"e24c988b.699b78"
]
]
},
{
"id":"250f93b0.a9b97c",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"Let gauge to be initialized before change any options",
"info":"There will be browser errors otherwise ",
"x":2520,
"y":580,
"wires":[

  ]

},
{
"id":"d94b0f1f.2a6f6",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"Change the options",
"info":"gauge scales according to predefined card size\ndefined font sizes are not absolute values but minimum values\nFor example if you make your gauge smaller, the changed font sizes may happen to be too large and will overlap.\n\nminLabelMinFontSize - minimum size of min field // number\nmaxLabelMinFontSize - minimum size of max field // number\nlabelMinFontSize - minimum size of units field // numbert\n\ndelete msg.payload cos it does not contain proper value",
"x":2580,
"y":660,
"wires":[

  ]

},
{
"id":"f0bfbde4.1a8cf",
"type":"function",
"z":"b6a3daf7.a23168",
"name":"random",
"func":"msg.payload = Math.random()*10\nreturn msg;",
"outputs":1,
"noerr":0,
"initialize":"",
"finalize":"",
"x":2590,
"y":760,
"wires":[
[
"8c14a7d9.681bb8"
]
]
},
{
"id":"a651e851.2a2a28",
"type":"comment",
"z":"b6a3daf7.a23168",
"name":"generate random value",
"info":"",
"x":2530,
"y":800,
"wires":[

  ]

},
{
"id":"44fdb6de.ed72b",
"type":"mqtt-broker",
"name":"tilli diverese nodes",
"broker":"eu.thethings.network",
"port":"1883",
"clientid":"",
"usetls":false,
"compatmode":true,
"keepalive":"60",
"cleansession":true,
"birthTopic":"",
"birthQos":"0",
"birthPayload":"",
"closeTopic":"",
"closePayload":"",
"willTopic":"",
"willQos":"0",
"willPayload":""
},
{
"id":"1aa68b90.5b18d4",
"type":"ui_group",
"name":"OV Diversepilot002",
"tab":"c03f0ae2.a9dfd",
"order":2,
"disp":false,
"width":6,
"collapse":false
},
{
"id":"4a9ea72a.a5ce18",
"type":"telegram bot",
"botname":"alarma2021bot",
"usernames":"",
"chatids":"-1001467259300,-1001190964814",
"baseapiurl":"",
"updatemode":"polling",
"pollinterval":"300",
"usesocks":false,
"sockshost":"",
"socksport":"6667",
"socksusername":"anonymous",
"sockspassword":"",
"bothost":"",
"botpath":"",
"localbotport":"8443",
"publicbotport":"8443",
"privatekey":"",
"certificate":"",
"useselfsignedcertificate":false,
"sslterminated":false,
"verboselogging":false
},
{
"id":"294556ce.ffa602",
"type":"ttn app",
"appId":"tilli",
"accessKey":"ttn-account-v2.goDkTdxHGK4cBdVAaDDnT2yiZEQWGKFqPr74WN4Eyl8",
"discovery":"discovery.thethingsnetwork.org:1900"
},
{
"id":"39b7a5c6.1e9a8a",
"type":"ui_group",
"name":"Default",
"tab":"ad12ad91.ab672",
"order":1,
"disp":true,
"width":"6",
"collapse":false
},
{
"id":"c03f0ae2.a9dfd",
"type":"ui_tab",
"name":"Devices",
"icon":"visibility",
"order":3,
"disabled":false,
"hidden":false
},
{
"id":"ad12ad91.ab672",
"type":"ui_tab",
"name":"Home",
"icon":"dashboard",
"disabled":false,
"hidden":false
}
]`

@lorenzozaccomer
Copy link

lorenzozaccomer commented Nov 26, 2021

Hello,
I have some errors like these:

"TypeError: Cannot read properties of undefined (reading 'find')"
"TypeError: Cannot read properties of undefined (reading 'length')"

@hotNipi how I can solve?

It works, and after clicking a button the errors will not show on debug window, but are annoying.

Thanks # #

@hotNipi
Copy link
Author

hotNipi commented Nov 26, 2021

image
It is because of this function is not called before you start to use the flow.
And most probably you don't use persistent context storage option so every time you restart the node-red, the context variables are whiped and you get those errors again.

Please understand - this is an example but not the fully working solution (even if it seems like one)
You can fix this in many ways and it depends on many things but the simplest is to make that inject node to fire message when node-red initializes
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment