Node node-red-node-ui-list

The errors:

7 Jan 20:14:55 - [info] Started flows
(node:1935) MaxListenersExceededWarning: Possible EventEmitter memory leak detec                                                                                                                                                             ted. 11 open listeners added. Use emitter.setMaxListeners() to increase limit
(node:1935) MaxListenersExceededWarning: Possible EventEmitter memory leak detec                                                                                                                                                             ted. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [sqlitedb:b310cf81.322a5] opened /home/pi/pvkbeheer.db                                                                                                                                                              ok
17 Jan 20:14:55 - [info] [mqtt-broker:mqttdomoticz] Connected to broker: mqtt://                                                                                                                                                             localhost:1883

Solved the problems with the single quotes.
I made a script that read all seperate datasets and makes one off them so they can be send to my domoticz or another remote domoticz server i manage..
Domoticz receives this string and make one or more sets of it and executes them.. local or remote

var sel;
var nwobj;
var i;

sel = msg.payload.selected;
nwobj = msg.payload.output[msg.payload.selected]

json = "";
teken = "";
for (i = 0; i < nwobj.length; i++) 
{
  json = json + teken + JSON.stringify(nwobj[i]);
  teken = ",";
}

json = "[" + json + "]";
msg.json = json; 
msg.oms3 = sel;
msg.payload=sel     // deze waarde hebben andere list nodes nodig om te bepalen wat aan/uit
flow.set("json",json);

return msg;
2 Likes

It was terrific to find this list node. Thanks for that!
I am trying to "size down" my UI components. Is that all just done in the overall CSS for the deployed flows? Or can I size down the list entries by using a tag in the input?

Any chance of making dark theme icons usable? The fa icons disappear when using a Dark theme.

I have since learned that the icons are scaleable, which is quite nice. Also, the color is settable. Forgive my ignorance.

The only issue I am seeing with the "switch" node is one where setting the msg.payload to 0 or 1 does not update the switch.

In my case, I am parsing messages from a device which are simple ascii strings.
The first switch grabs the SCAN: indicator which is unique and has two values, ON or OFF.
The second switch decides the switch state based on "ON" or "OFF" and then from each of those outputs there is a Change node to set the msg.payload to "0" or "1" for the Switch node.

The switch itself works fine, and the colors and icons change when the switch is pressed.

So my TWO issues are:

  1. How to set the state of the switch at startup (because the state is known to be "OFF")
  2. How to set the state of the switch based on my scenario above. Fixing that issue really fixes 1.

I will grab these few nodes and make a test flow to add here shortly.

To set the switchboth the message value and the type must match what the switch sends out... so if it sends string "ON" - you need to send it a string "ON" to set it on... if it's sending 1 that can be a string "1" or a number 1 - and again the input must match the output.

Odd. I am sending a flow context variable as output. Why is that limitation in place?

why is that a limitation ? If a switch sends "on" or "off" I wouldn't expect to be able to send "banana" to it to set it ? if you are sending out the value of flow.foo then you must inject the value flow.foo to set it.

I would expect the switch itself to be able to send anything it likes, rather anything it is configured to send for On or Off, which is what the configuration controls of the switch node imply.

I have it working now given your advice. Thank you.

[{"id":"f37a6189.cd2a7","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6440daca.bd7fd4","type":"ui_text","z":"f37a6189.cd2a7","group":"f107a634.e6cec8","order":12,"width":4,"height":1,"name":"LinkedInfoTest","label":"","format":"{{msg.payload}}","layout":"row-left","x":640,"y":260,"wires":[]},{"id":"b206e84a.c62a28","type":"switch","z":"f37a6189.cd2a7","name":"replySwitchTest","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"ALE LINK: ","vt":"str"},{"t":"cont","v":"SCAN:","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":330,"y":260,"wires":[["6440daca.bd7fd4"],["853bfdd6.37627"]]},{"id":"4f353263.db8f6c","type":"debug","z":"f37a6189.cd2a7","name":"scanToggleOutputTest","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":740,"y":560,"wires":[]},{"id":"4a26cc0e.494314","type":"ui_switch","z":"f37a6189.cd2a7","name":"testScan","label":"TESTScan","tooltip":"","group":"f107a634.e6cec8","order":1,"width":2,"height":1,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"fa-spinner fa-pulse fa-2x fa-fw","oncolor":"red","offvalue":"0","offvalueType":"str","officon":"fa-spinner fa-2x fa-fw","offcolor":"green","x":620,"y":480,"wires":[["485675eb.2aa03c"]]},{"id":"5509cea0.df5ad","type":"inject","z":"f37a6189.cd2a7","name":"SCAN ON","topic":"","payload":"SCAN: ON","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":240,"wires":[["b206e84a.c62a28"]]},{"id":"a5f6ab3f.e7bd48","type":"inject","z":"f37a6189.cd2a7","name":"SCAN OFF","topic":"","payload":"SCAN: OFF","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":300,"wires":[["b206e84a.c62a28"]]},{"id":"fea4d38e.3d9f1","type":"debug","z":"f37a6189.cd2a7","name":"sstOnDebug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":670,"y":320,"wires":[]},{"id":"102429e4.558906","type":"debug","z":"f37a6189.cd2a7","name":"sstOffDebug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":670,"y":380,"wires":[]},{"id":"853bfdd6.37627","type":"function","z":"f37a6189.cd2a7","name":"","func":"context.set(\"scanon\", \"SCAN ON\\r\");\ncontext.set(\"scanoff\", \"SCAN OFF\\r\");\nnode.warn(\"payload:\" + msg.payload);\nif(msg.payload.includes(\"ON\"))\n{\n    msg.payload = \"1\";\n}\nelse\n{\n    msg.payload = \"0\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":480,"wires":[["4a26cc0e.494314","4f353263.db8f6c"]]},{"id":"485675eb.2aa03c","type":"change","z":"f37a6189.cd2a7","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"str","to":"scanon","tot":"flow"},{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"str","to":"scanoff","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":480,"wires":[["4f353263.db8f6c"]]},{"id":"f107a634.e6cec8","type":"ui_group","z":"","name":"RadioStatus","tab":"84281f8b.45787","order":5,"disp":false,"width":27,"collapse":false},{"id":"84281f8b.45787","type":"ui_tab","z":"","name":"EnvoyDashboard","icon":"dashboard","order":3,"disabled":false,"hidden":false}]
1 Like