(All cards on the table)
This is the ENTIRE code - sorry.
Nothing too serious for importing.
Excuse the foreign node. Not important.
And the MQTT nodes....
[{"id":"af11fc823595f51f","type":"mqtt in","z":"d6026c14350dea74","name":"","topic":"A4/tele/SENSOR","qos":"2","datatype":"auto-detect","broker":"4178d9f.f883728","nl":false,"rap":true,"rh":0,"inputs":0,"x":370,"y":500,"wires":[["cf5a29ee76a46ba9","3aa12236c755b6f8"]]},{"id":"cf5a29ee76a46ba9","type":"debug","z":"d6026c14350dea74","name":"A4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":530,"wires":[]},{"id":"3aa12236c755b6f8","type":"function","z":"d6026c14350dea74","name":"Move to payload","func":"let msg1 = {};\nlet power = msg.payload.ENERGY.Today;\nmsg1.payload = power;\nmsg1.topic = \"A4\";\nreturn msg1;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":500,"wires":[["c5af06e77fe26629","72c98d3060450d48"]]},{"id":"4d4a4c32f711a182","type":"ui-gauge","z":"d6026c14350dea74","d":true,"name":"Gauge","group":"9d0aa235d37c5289","order":1,"width":3,"height":"2","gtype":"gauge-battery","gstyle":"needle","title":"gauge","units":"units","icon":"","prefix":"","suffix":"","segments":[{"from":"0","color":"#ea5353"},{"from":"40","color":"#ffc800"},{"from":"70","color":"#5cd65c"}],"min":0,"max":"100","sizeThickness":16,"sizeGap":4,"sizeKeyThickness":8,"styleRounded":true,"styleGlow":false,"className":"","x":1180,"y":290,"wires":[]},{"id":"aa774e2285d75616","type":"ui-gauge-classic","z":"d6026c14350dea74","d":true,"name":"Classic","group":"9d0aa235d37c5289","order":2,"width":"3","height":"3","min":0,"max":"0.1","sectors":[],"major_division":"0.01","minor_division":"0.001","value_decimal_places":"3","scale_decimal_places":"2","label":"Recharging","measurement":"milliWatts","units":"milliWatts","needles":[{"topic":"A1","color":"green","lengthPercent":"100"},{"topic":"A2","color":"yellow","lengthPercent":"100"},{"topic":"A3","color":"orange","lengthPercent":"100"},{"topic":"A4","color":"black","lengthPercent":"100"},{"topic":"A5","color":"brown","lengthPercent":"100"}],"sweep_angle":"180","myclass":"","x":1190,"y":330,"wires":[]},{"id":"9ee45062ba3c8cb5","type":"mqtt in","z":"d6026c14350dea74","name":"","topic":"A5/tele/SENSOR","qos":"2","datatype":"auto-detect","broker":"4178d9f.f883728","nl":false,"rap":true,"rh":0,"inputs":0,"x":450,"y":570,"wires":[["3958009ac6c49b50","3a2a6894c704884d"]]},{"id":"3958009ac6c49b50","type":"debug","z":"d6026c14350dea74","name":"A5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":600,"wires":[]},{"id":"3a2a6894c704884d","type":"function","z":"d6026c14350dea74","name":"Move to payload","func":"let msg1 = {};\nlet power = msg.payload.ENERGY.Today;\nmsg1.payload = power;\nmsg1.topic = \"A5\";\nreturn msg1;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":570,"wires":[["027db0045e511521"]]},{"id":"3a67f99798cf8111","type":"mqtt in","z":"d6026c14350dea74","name":"","topic":"A3/tele/SENSOR","qos":"2","datatype":"auto-detect","broker":"4178d9f.f883728","nl":false,"rap":true,"rh":0,"inputs":0,"x":450,"y":430,"wires":[["dc08c5f98fa021e6","45fa51a010276816"]]},{"id":"dc08c5f98fa021e6","type":"debug","z":"d6026c14350dea74","name":"A3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":460,"wires":[]},{"id":"45fa51a010276816","type":"function","z":"d6026c14350dea74","name":"Move to payload","func":"let msg1 = {};\nlet power = msg.payload.ENERGY.Today;\nmsg1.payload = power;\nmsg1.topic = \"A3\";\nreturn msg1;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":430,"wires":[["17be4774931ab231"]]},{"id":"3e1fcc438fed5ff8","type":"mqtt in","z":"d6026c14350dea74","name":"","topic":"A1/tele/SENSOR","qos":"2","datatype":"auto-detect","broker":"4178d9f.f883728","nl":false,"rap":true,"rh":0,"inputs":0,"x":450,"y":290,"wires":[["aeff4bdae00c4e3f","5392bba75ecdbeb4"]]},{"id":"aeff4bdae00c4e3f","type":"debug","z":"d6026c14350dea74","name":"A1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":320,"wires":[]},{"id":"5392bba75ecdbeb4","type":"function","z":"d6026c14350dea74","name":"Move to payload","func":"let msg1 = {};\nlet power = msg.payload.ENERGY.Today;\nmsg1.payload = power;\nmsg1.topic = \"A1\";\nreturn msg1;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":290,"wires":[["a733610f066c935d"]]},{"id":"efa4923d349d3299","type":"mqtt in","z":"d6026c14350dea74","name":"","topic":"A2/tele/SENSOR","qos":"2","datatype":"auto-detect","broker":"4178d9f.f883728","nl":false,"rap":true,"rh":0,"inputs":0,"x":450,"y":360,"wires":[["951b4184cbf8de11","fa4127f220e09bea"]]},{"id":"951b4184cbf8de11","type":"debug","z":"d6026c14350dea74","name":"A2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":390,"wires":[]},{"id":"fa4127f220e09bea","type":"function","z":"d6026c14350dea74","name":"Move to payload","func":"let msg1 = {};\nlet power = msg.payload.ENERGY.Today;\nmsg1.payload = power;\nmsg1.topic = \"A2\";\nreturn msg1;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":360,"wires":[["2662e1f0c33e58fb"]]},{"id":"0f47080ef1c017d5","type":"debug","z":"d6026c14350dea74","name":"To gauge","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":240,"wires":[]},{"id":"72c98d3060450d48","type":"q-gate","z":"d6026c14350dea74","name":"A4","controlTopic":"control","defaultState":"queueing","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"drop","statusCmd":"status","maxQueueLength":"1","keepNewest":true,"qToggle":false,"persist":false,"storeName":"memory","x":770,"y":650,"wires":[["c5af06e77fe26629"]]},{"id":"c4e2f1c945cf0860","type":"inject","z":"d6026c14350dea74","name":"Resend","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"peek","payloadType":"str","x":770,"y":700,"wires":[["72c98d3060450d48"]]},{"id":"afd12ab3197588de","type":"inject","z":"d6026c14350dea74","name":"A1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A1","payload":"0.003","payloadType":"num","x":1180,"y":690,"wires":[["ab8047171f62a989"]]},{"id":"a733610f066c935d","type":"change","z":"d6026c14350dea74","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"A1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":785,"y":290,"wires":[["8fb20ae72d0d7e0f"]],"l":false},{"id":"2662e1f0c33e58fb","type":"change","z":"d6026c14350dea74","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"A2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":785,"y":360,"wires":[["8fb20ae72d0d7e0f"]],"l":false},{"id":"17be4774931ab231","type":"change","z":"d6026c14350dea74","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"A3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":785,"y":430,"wires":[["8fb20ae72d0d7e0f"]],"l":false},{"id":"c5af06e77fe26629","type":"change","z":"d6026c14350dea74","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"A4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":785,"y":500,"wires":[["8fb20ae72d0d7e0f"]],"l":false},{"id":"027db0045e511521","type":"change","z":"d6026c14350dea74","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"A5","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":785,"y":570,"wires":[["8fb20ae72d0d7e0f"]],"l":false},{"id":"ac0d932f0e48cf6c","type":"inject","z":"d6026c14350dea74","name":"Wipe?","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"blah","x":640,"y":250,"wires":[["e7c7d1014c09ce36"]]},{"id":"2f8943b8d097e51b","type":"ui-gauge-classic","z":"d6026c14350dea74","name":"Classic","group":"9d0aa235d37c5289","order":3,"width":"3","height":"3","min":0,"max":"100","sectors":[],"major_division":"10","minor_division":"1","value_decimal_places":"1","scale_decimal_places":"0","label":"Device Recharging","measurement":"","units":"","needles":[{"topic":"A1","color":"green","lengthPercent":"100"},{"topic":"A2","color":"yellow","lengthPercent":"100"},{"topic":"A3","color":"orange","lengthPercent":"100"},{"topic":"A4","color":"black","lengthPercent":"100"},{"topic":"A5","color":"brown","lengthPercent":"100"},{"topic":"X","color":"white","lengthPercent":"100"}],"sweep_angle":"180","myclass":"powergauge","x":1190,"y":380,"wires":[]},{"id":"19d7b31b68fbfc9c","type":"function","z":"d6026c14350dea74","name":"Upscale","func":"let x = msg.payload;\nmsg.payload = x * 1000;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1085,"y":380,"wires":[["2f8943b8d097e51b","ba6347f91569402b"]],"l":false},{"id":"ba6347f91569402b","type":"debug","z":"d6026c14350dea74","name":"Displayed power","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1220,"y":430,"wires":[]},{"id":"f9c249d1cc7690bd","type":"trigger","z":"d6026c14350dea74","name":"Indicator","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":990,"y":240,"wires":[[]]},{"id":"859607f1d4932f09","type":"inject","z":"d6026c14350dea74","name":"A1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A1","payload":"0.006","payloadType":"num","x":1180,"y":740,"wires":[["ab8047171f62a989"]]},{"id":"314c570d1b610a5f","type":"inject","z":"d6026c14350dea74","name":"A1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A1","payload":"0.009","payloadType":"num","x":1180,"y":790,"wires":[["ab8047171f62a989"]]},{"id":"c41f6ab322e838a4","type":"inject","z":"d6026c14350dea74","name":"A1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A1","payload":"0.015","payloadType":"num","x":1180,"y":840,"wires":[["ab8047171f62a989"]]},{"id":"ded114ac03f09c0b","type":"inject","z":"d6026c14350dea74","name":"A1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A1","payload":"-1","payloadType":"num","x":1180,"y":650,"wires":[["ab8047171f62a989"]]},{"id":"92d8919dcd97c509","type":"inject","z":"d6026c14350dea74","name":"A2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A2","payload":"0.003","payloadType":"num","x":1360,"y":690,"wires":[["e86649a746d53424"]]},{"id":"b5645fbff7146d7f","type":"inject","z":"d6026c14350dea74","name":"A2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A2","payload":"0.006","payloadType":"num","x":1360,"y":740,"wires":[["e86649a746d53424"]]},{"id":"3e5f6fcc89d80e9d","type":"inject","z":"d6026c14350dea74","name":"A2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A2","payload":"0.009","payloadType":"num","x":1360,"y":790,"wires":[["e86649a746d53424"]]},{"id":"6433dda2b21106d7","type":"inject","z":"d6026c14350dea74","name":"A2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A2","payload":"0.015","payloadType":"num","x":1360,"y":840,"wires":[["e86649a746d53424"]]},{"id":"cb0e6e394bd06cdf","type":"inject","z":"d6026c14350dea74","name":"A2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"A2","payload":"-1","payloadType":"num","x":1360,"y":650,"wires":[["e86649a746d53424"]]},{"id":"a5d9130bc3160a1e","type":"ui-template","z":"d6026c14350dea74","group":"","page":"","ui":"81d0a76c830e3379","name":"CSS to allow hiding of needles on any page","order":0,"width":0,"height":0,"head":"","format":"/** this allows hiding of individual needles by sending needle identifier in msg.class to a gauge, for example\n * msg.class = \"hide_needle-1\" // hide needle 1 and show others\n * msg.class = \"hide-needle-2 hide-needle-3\" // hide needles 2 and 3 and show others\n * msg.class = \"\" // shows all needles\n*/\n.hide-needle-1 .o-needle-1,\n.hide-needle-2 .o-needle-2,\n.hide-needle-3 .o-needle-3 {\n visibility: hidden;\n}","storeOutMessages":true,"passthru":true,"resendOnRefresh":true,"templateScope":"site:style","className":"","x":1010,"y":120,"wires":[[]]},{"id":"e9b7526258bd4b35","type":"inject","z":"d6026c14350dea74","name":"Hide needle 1","props":[{"p":"class","v":"hide-needle-1","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":660,"y":50,"wires":[["122137e11bd88ff2"]]},{"id":"7bc1b50a14f583a9","type":"inject","z":"d6026c14350dea74","name":"Hide needle 2","props":[{"p":"class","v":"hide-needle-2","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":660,"y":90,"wires":[["122137e11bd88ff2"]]},{"id":"6827487794a4182d","type":"inject","z":"d6026c14350dea74","name":"Hide needle 3","props":[{"p":"class","v":"hide-needle-3","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":660,"y":130,"wires":[["122137e11bd88ff2"]]},{"id":"3e6aee1c7c8590ce","type":"inject","z":"d6026c14350dea74","name":"Hide needle 4","props":[{"p":"class","v":"hide-needle-4","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":660,"y":170,"wires":[["122137e11bd88ff2"]]},{"id":"6593ac4019458110","type":"inject","z":"d6026c14350dea74","name":"Show all needles","props":[{"p":"class","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":890,"y":50,"wires":[["122137e11bd88ff2"]]},{"id":"11ad21e4229c6977","type":"mqtt in","z":"d6026c14350dea74","name":"","topic":"A4/tele/#","qos":"2","datatype":"auto-detect","broker":"4178d9f.f883728","nl":false,"rap":true,"rh":0,"inputs":0,"x":240,"y":790,"wires":[["d6bd1068eb9e8473"]]},{"id":"d6bd1068eb9e8473","type":"switch","z":"d6026c14350dea74","name":"","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"SENSOR","vt":"str"},{"t":"cont","v":"LWT","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":380,"y":790,"wires":[["3aa12236c755b6f8"],["adfde90782ffa4ae","7339f82343f6843e"]],"outputLabels":["SENSOR","LWT"]},{"id":"f4646181756f0172","type":"inject","z":"d6026c14350dea74","name":"Hide needle 5","props":[{"p":"class","v":"hide-needle-5","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":660,"y":210,"wires":[["122137e11bd88ff2"]]},{"id":"736158aa37366c9c","type":"change","z":"d6026c14350dea74","name":"Hide 4","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"class","pt":"msg","to":"hide-needle-4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":900,"wires":[[]]},{"id":"adfde90782ffa4ae","type":"debug","z":"d6026c14350dea74","name":"LWT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":850,"wires":[]},{"id":"7339f82343f6843e","type":"switch","z":"d6026c14350dea74","name":"Off/Online","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Offline","vt":"str"},{"t":"eq","v":"Online","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":415,"y":910,"wires":[["736158aa37366c9c"],[]],"l":false},{"id":"8b9b72d4e1ad7c07","type":"comment","z":"d6026c14350dea74","name":"New way for needle control","info":"","x":360,"y":740,"wires":[]},{"id":"8fb20ae72d0d7e0f","type":"junction","z":"d6026c14350dea74","x":940,"y":290,"wires":[["6926509cac9da0bb","f9c249d1cc7690bd"]]},{"id":"6926509cac9da0bb","type":"junction","z":"d6026c14350dea74","x":1000,"y":290,"wires":[["aa774e2285d75616","4d4a4c32f711a182","0f47080ef1c017d5","19d7b31b68fbfc9c"]]},{"id":"ab8047171f62a989","type":"junction","z":"d6026c14350dea74","x":1270,"y":720,"wires":[["6926509cac9da0bb"]]},{"id":"e86649a746d53424","type":"junction","z":"d6026c14350dea74","x":1460,"y":690,"wires":[["6926509cac9da0bb"]]},{"id":"e7c7d1014c09ce36","type":"junction","z":"d6026c14350dea74","x":780,"y":250,"wires":[["2662e1f0c33e58fb","c5af06e77fe26629","027db0045e511521","a733610f066c935d","17be4774931ab231"]]},{"id":"122137e11bd88ff2","type":"junction","z":"d6026c14350dea74","x":810,"y":170,"wires":[["2f8943b8d097e51b"]]},{"id":"4178d9f.f883728","type":"mqtt-broker","name":"TimePi","broker":"192.168.17.39","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"20","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"2","birthPayload":"'Nas-T-Nuc online'","birthMsg":{},"closeTopic":"","closePayload":"'Nas-T-Nuc shutting down'","closeMsg":{},"willTopic":"EOM","willQos":"0","willPayload":"'Nas-T-Nuc telemetry failure'","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"9d0aa235d37c5289","type":"ui-group","name":"My Group","page":"0aef6b45c70fc7e6","width":"3","height":"1","order":1,"showTitle":false,"className":"","visible":"true","disabled":"false"},{"id":"81d0a76c830e3379","type":"ui-base","name":"My Dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"showPageTitle":true,"navigationStyle":"default","titleBarStyle":"default"},{"id":"0aef6b45c70fc7e6","type":"ui-page","name":"Power Gauges","ui":"81d0a76c830e3379","path":"/page1","icon":"home","layout":"grid","theme":"b608c93778d60f83","order":2,"className":"","visible":"true","disabled":"false"},{"id":"b608c93778d60f83","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094CE","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]
What to do to see/get the problem:
Inject the Show all needles
button. (Top)
Inject A1
3rd button down.
Inject A2
4th button down.
Check you have 2 needles on the gauge.
Yellow (0.9) and green. (0.6)
Click Hide needle 1
You now have/see the yellow needle. 0.9
Click Hide needle 2
You now have green on 0.6
Yeah, but now both needles should be hidden.
Click Hide needle 1
again.
Now you see the yellow needle pointing at 0.9
I seem to be missing something. Or: I've found a bug.
I'm not looking for points.
But I don't understand what is happening.
You may se I am wanting to change how the messages (MQTT) are parsed.
If it gets a LWT message and it is offline
then it turns off the needle.
But I don't know how to turn it on again.
(Other than turning them ALL on. Which is not wanted.)
Update with more information:
I added the inject
nodes for needles 3 and 4.
All 4 needles visible. All with different values.
4
will NOT turn off.
If I turn off any of the others that needle turns off.
But when I turn off another one, the new one turns off, but the previous one turns back on.