Sending and "recycling" messages to LCD screen

Hello! I have a project where I send messages from Domoticz home automation system to 4x20 LCD screen connected to ESP8266 microcontroller. I use MQTT and Node-RED to get the messages shown on the LCD screen. My node structure is MQTT IN from Domoticz -> Filter -> Function -> MQTT Out to ESP 8266. This is working fine. The LCD display has 4 rows and 20 characters per row and my intention is to run a node and show certain values for example 5 seconds, then clear the screen and run another node (or some other data inside this same node, if it is possible). The point is to show more messages than can fit to 4 rows by "recycling" the screen and shown data. How could I accomplish this?

I am not sure if I am making any sense, but hopefully you can understand what I am trying to do here and help me. Thanks! :grinning:

So if I understand, you want the esp8266 to display a screen of information, wait a bit and them display different information. That will depend on the code you have on the esp8266.

This is not a Node-RED issue. I suggest you do a google search with ‘esp8266 lcd display options’ to find out how to do it.

Do you just mean that you want to send a sequence of messages to the MQTT node five seconds apart?

Thank you for your message. Basically yes. I have for example 8 devices which data I want to show on the LCD screen. Now I am able to show first four, but last four can't fit on the screen. So I would like to show first four devices for five seconds, then clear the screen and show the other four for five seconds. And repeat this constantly.

I have already managed to show the first four devices, then clear the screen and wait five seconds, but I can't figure out how to jump to another node or MQTT device list.

One way would be to send both sets of data to mqtt, but block one or the other using node-red-contrib-simple-gate nodes.

Hard to advise as not sure of data structure or flow layout.
But i would probably create an array of the data strings and send it through a trigger node, then split the array and rate limit.
e.g.

[{"id":"e97f93fe.a6af28","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":450,"y":100,"wires":[["ec77f1de.073ad8"]]},{"id":"ec77f1de.073ad8","type":"template","z":"bf9e1e33.030598","name":"create array of data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"[\"sssssssssssssssssssssssssssssssss20char5\\nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh20char6\\nrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr20char7\\nlllllllllllllllllllllllllllllllll20char8\",\n\"qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq20char1\\nwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww20char2\\neeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee20char3\\n33333333333333333333333333333333320chr4\"]","output":"json","x":630,"y":100,"wires":[["7e4eb0a1.61b81"]]},{"id":"7e4eb0a1.61b81","type":"change","z":"bf9e1e33.030598","name":"set delay and topic","rules":[{"t":"set","p":"delay","pt":"msg","to":"$count($$.payload)*5","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"topic/pathe/to/lcd","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":100,"wires":[["10fa3500.2f211b"]]},{"id":"10fa3500.2f211b","type":"trigger","z":"bf9e1e33.030598","name":"resend variable delay","op1":"","op2":"","op1type":"pay","op2type":"pay","duration":"0","extend":false,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":900,"y":160,"wires":[["36c23e6d.c2289a"]]},{"id":"f1f97a32.f8459","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":160,"wires":[["10fa3500.2f211b"]]},{"id":"36c23e6d.c2289a","type":"split","z":"bf9e1e33.030598","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1090,"y":160,"wires":[["d0fa5d9a.c243c8"]]},{"id":"e92d5001.fe725","type":"inject","z":"bf9e1e33.030598","name":"reset","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":470,"y":160,"wires":[["f1f97a32.f8459"]]},{"id":"d0fa5d9a.c243c8","type":"delay","z":"bf9e1e33.030598","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1270,"y":160,"wires":[["1019cbe995c63db0"]]},{"id":"1019cbe995c63db0","type":"debug","z":"bf9e1e33.030598","name":"mqtt","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1350,"y":100,"wires":[]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.