I am using a template node to create a machine status page. Here is a screenshot.
My problem is when I get a status from a different machine, it clears the machine in red.
The white machine should be green and the red machine should be red.
The LED needs to keep the last value, unless it changes.
I think that I am struggling with storing values. I have looked at the tutorials and the storing value page on the NR site, but I do not understand.
Here is my code:
[{"id":"5116599.e09b4a8","type":"ui_template","z":"ab8609d3.76eee8","group":"f6f1d68f.b33788","name":"InCycle LH35N-3000B","order":4,"width":"0","height":"0","format":"<style>\n.led {\n float: right;\n padding: 3px;\n width: 10px;\n height: 10px;\n margin: 2px 5px 5px 5px;\n border-radius: 0%;\n \n}\n</style>\n\n<div>LH35N-3000B {{msg.topic}}<span class=\"led\" style=\"background-color: {{msg.payload}}; box-shadow: black 0 -1px 1px 0px, inset black 0 -1px 4px, {{msg.payload}} 0 3px 15px;\"></span></div>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":2600,"y":280,"wires":[["8ae78367.ad921"]]},{"id":"8ae78367.ad921","type":"change","z":"ab8609d3.76eee8","name":"","rules":[{"t":"set","p":"lh35n3000b","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2920,"y":200,"wires":[["9980e230.a9d4c"]]},{"id":"9980e230.a9d4c","type":"link out","z":"ab8609d3.76eee8","name":"LED LH35N-3000B Status out","links":["d57a88ba.5a8d08"],"x":3075,"y":200,"wires":[]},{"id":"d57a88ba.5a8d08","type":"link in","z":"ab8609d3.76eee8","name":"LED LH35N-3000B Status in","links":["9980e230.a9d4c","84c214e8.33f3c8","79f69d72.a0f734"],"x":2975,"y":280,"wires":[["a8da5e89.290ef","4a49bfa0.b56b9"]]},{"id":"a8da5e89.290ef","type":"ui_template","z":"ab8609d3.76eee8","group":"df7f71ac.38225","name":"","order":0,"width":"27","height":"10","format":"<!DOCTYPE html>\n<html lang=\"en\">\n <body>\n <style>\n.img {\n width: 100%;\n height: 100%;\n}\n.led35nb {\n position: absolute;\n padding: 3px;\n width: 10px;\n height: 10px;\n margin: 2px 5px 5px 5px;\n border-radius: 0%;\n top: 310px;\n right: 660px;\n}\n.led35n {\n position: absolute;\n padding: 3px;\n width: 10px;\n height: 10px;\n margin: 2px 5px 5px 5px;\n border-radius: 0%;\n top: 280px;\n right: 660px;\n}\n.ledht {\n position: absolute;\n padding: 3px;\n width: 10px;\n height: 10px;\n margin: 2px 5px 5px 5px;\n border-radius: 0%;\n top: 270px;\n right: 360px;\n}\n\n</style>\n <div class=\"container\">\n <a><span class=\"led35nb\" style=\"background-color: {{msg.lh35n3000b}}; box-shadow: black 0 -1px 1px 0px, inset black 0 -1px 4px, {{msg.lh35n3000b}} 0 3px 15px;\"></span></a>\n <a><span class=\"led35n\" style=\"background-color: {{msg.lh35n3000}}; box-shadow: black 0 -1px 1px 0px, inset black 0 -1px 4px, {{msg.lh35n3000}} 0 3px 15px;\"></span></a>\n <a><span class=\"ledht\" style=\"background-color: {{msg.ht}}; box-shadow: black 0 -1px 1px 0px, inset black 0 -1px 4px, {{msg.ht}} 0 3px 15px;\"></span></a>\n <img src=\"/turning.png\" alt=\"turning\" class=\"img\">\n </div>\n \n </body>\n\n</html>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":3100,"y":280,"wires":[[]]},{"id":"4a49bfa0.b56b9","type":"debug","z":"ab8609d3.76eee8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":3130,"y":380,"wires":[]},{"id":"f6f1d68f.b33788","type":"ui_group","z":"","name":"Shaft Turning Room","tab":"157f0329.92370d","order":1,"disp":true,"width":"6","collapse":false},{"id":"df7f71ac.38225","type":"ui_group","z":"","name":"Turning Room","tab":"3679129f.641f9e","disp":true,"width":"27","collapse":false},{"id":"157f0329.92370d","type":"ui_tab","z":"","name":"All - MC Status","icon":"dashboard","order":37},{"id":"3679129f.641f9e","type":"ui_tab","z":"","name":"Testing","icon":"dashboard"}]