How can I make a led blink on the dashboard?

How can I make a led blink with more intensity as it is done at a value, for example from 75 to 105, the closer to 105 it blinks faster until it is lit

Is it a real led or a dashboard led?

How far have you got? Are you able to control the led? Are you able to make it blink?

The dashboard has virtual LED's? How did I miss that (and still don't see them)? Making an LED matrix with random changing colours is usually one of my first projects on a new platform.

EDIT - Found node-red-contrib-ui-led

1 Like

I know how to control the led but I don't know how to make it blink

Here's one example of blinking led. Explore it to gain your ideas.

[{"id":"c3654bf0.dd1d48","type":"ui_template","z":"407e1abc.6d1cb4","group":"65dfd687.bc39a8","name":"","order":0,"width":"1","height":"1","format":"<style>\n.led {\n    position:absolute;\n    left: 0;\n    right:0;\n    top:0;\n    bottom:0;\n    width: 15px;\n    height: 15px;\n    margin: auto;\n    border-radius: 50%;\n}\n</style>\n\n<div><span class=\"led\" style=\"background-color: {{msg.payload}}; box-shadow: #000000BB 0 -1px 1px 0px, inset #000000AA  0 -1px 4px, {{msg.payload}} 0 3px 15px;\"></span></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":660,"y":960,"wires":[["d6e65627.4ad0c8"]]},{"id":"d4148083.07318","type":"trigger","z":"407e1abc.6d1cb4","name":"blink blue","op1":"colors.led.blue","op2":"colors.led.off","op1type":"global","op2type":"global","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":460,"y":960,"wires":[["c3654bf0.dd1d48"]]},{"id":"48c6152a.00e40c","type":"change","z":"407e1abc.6d1cb4","name":"","rules":[{"t":"set","p":"colors.led","pt":"global","to":"{\"off\":\"#696969\",\"red\":\"red\",\"green\":\"#7aeb7a\",\"blue\":\"#0000ff\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":920,"wires":[[]]},{"id":"35b42b91.fe36a4","type":"inject","z":"407e1abc.6d1cb4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":920,"wires":[["48c6152a.00e40c"]]},{"id":"fa4166a9.ef47a8","type":"trigger","z":"407e1abc.6d1cb4","name":"blink red","op1":"colors.led.red","op2":"colors.led.off","op1type":"global","op2type":"global","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":460,"y":1020,"wires":[["c3654bf0.dd1d48"]]},{"id":"b8ffaaf5.c51ca8","type":"delay","z":"407e1abc.6d1cb4","name":"","pauseType":"random","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"200","randomLast":"500","randomUnits":"milliseconds","drop":false,"x":320,"y":1020,"wires":[["fa4166a9.ef47a8"]]},{"id":"d6e65627.4ad0c8","type":"switch","z":"407e1abc.6d1cb4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"colors.led.blue","vt":"global"}],"checkall":"true","repair":false,"outputs":1,"x":810,"y":960,"wires":[["b8ffaaf5.c51ca8"]]},{"id":"3f1b249.42e3fdc","type":"ui_button","z":"407e1abc.6d1cb4","name":"","group":"65dfd687.bc39a8","order":15,"width":0,"height":0,"passthru":false,"label":"Lit led","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":210,"y":960,"wires":[["d4148083.07318"]]},{"id":"65dfd687.bc39a8","type":"ui_group","name":"Default","tab":"5394d338.3dd19c","order":1,"disp":true,"width":"6","collapse":false},{"id":"5394d338.3dd19c","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Another simple flasher with only three nodes. You just come up with a variable injection. I'm working on a few options myself.

image

[{"id":"af1708dc.4e6ce8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"1cd530d8.0510bf","type":"ui_led","z":"af1708dc.4e6ce8","order":2,"group":"65dfd687.bc39a8","width":"2","height":"2","label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#0000ff","value":"1","valueType":"num"},{"color":"#000000","value":"0","valueType":"num"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":490,"y":80,"wires":[]},{"id":"efde91d9.e81c1","type":"toggle","z":"af1708dc.4e6ce8","name":"","onOffTopic":"","onValue":"1","onType":"num","offValue":"0","offType":"num","toggleTopic":"","toggleValue":"togglenow","toggleType":"str","passOnOff":"always","x":330,"y":80,"wires":[["1cd530d8.0510bf"]]},{"id":"fb9d6499.8dc708","type":"inject","z":"af1708dc.4e6ce8","name":"","props":[{"p":"payload"}],"repeat":".5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"togglenow","payloadType":"str","x":160,"y":80,"wires":[["efde91d9.e81c1"]]},{"id":"65dfd687.bc39a8","type":"ui_group","name":"Default","tab":"5394d338.3dd19c","order":1,"disp":true,"width":"6","collapse":false},{"id":"5394d338.3dd19c","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

After much fuss and hair pulling at my end... and a quick fix by @Steve-Mcl Here is an example that you should be able to adapt.

Exchange the slider's function (just sending a number representing milliseconds) with that of some code that sets increasing frequency ranges based on some other value as needed.

image

[{"id":"af1708dc.4e6ce8","type":"tab","label":"Flasher","disabled":false,"info":""},{"id":"1cd530d8.0510bf","type":"ui_led","z":"af1708dc.4e6ce8","order":2,"group":"85815d64.6c718","width":"2","height":"2","label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#0000ff","value":"true","valueType":"bool"},{"color":"#000000","value":"false","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":570,"y":320,"wires":[]},{"id":"efde91d9.e81c1","type":"toggle","z":"af1708dc.4e6ce8","name":"","onOffTopic":"","onValue":"true","onType":"bool","offValue":"false","offType":"bool","toggleTopic":"","toggleValue":"togglenow","toggleType":"str","passOnOff":"ifChanged","x":570,"y":260,"wires":[["1cd530d8.0510bf"]]},{"id":"95c7325.18127d","type":"ui_slider","z":"af1708dc.4e6ce8","name":"Frequency","label":"slider","tooltip":"","group":"85815d64.6c718","order":0,"width":0,"height":0,"passthru":false,"outs":"end","topic":"delay","topicType":"msg","min":"32","max":"2000","step":1,"x":150,"y":320,"wires":[["97729620.9d6d08"]]},{"id":"c6b10cae.c126a","type":"trigger","z":"af1708dc.4e6ce8","name":"Trigger","op1":"togglenow","op2":"false","op1type":"str","op2type":"bool","duration":"-250","extend":false,"overrideDelay":true,"units":"ms","reset":"reset","bytopic":"all","topic":"topic","outputs":1,"x":360,"y":260,"wires":[["efde91d9.e81c1"]]},{"id":"bafe11a7.88056","type":"ui_button","z":"af1708dc.4e6ce8","name":"","group":"85815d64.6c718","order":2,"width":0,"height":0,"passthru":false,"label":"Reset","tooltip":"","color":"","bgcolor":"","icon":"","payload":"reset","payloadType":"str","topic":"reset","topicType":"msg","x":150,"y":280,"wires":[["c6b10cae.c126a"]]},{"id":"97729620.9d6d08","type":"change","z":"af1708dc.4e6ce8","name":"Magic beans ;)","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":320,"wires":[["c6b10cae.c126a"]]},{"id":"85815d64.6c718","type":"ui_group","name":"","tab":"bb7236c.d277cc8","order":2,"disp":true,"width":"6","collapse":false},{"id":"bb7236c.d277cc8","type":"ui_tab","name":"Flashing LED","icon":"dashboard","disabled":false,"hidden":false}]

I don't want to stick my nose into too many threads....

There is another switch node (as in on/off) but it is a multi position one which slides left/right.

Sorry, I can't remember the name and so may shouldn't post here. But just to suggest a nicer way of doing what you want.

Rather than the reset button and the toggle you would/could just use that node and have 3 positions.

I though I installed it but when I went to look, I can't find it.
Sorry.

Found it!

Multistate switch

1 Like

Thanks... always nice to have more buttons to poke and switches to flip :stuck_out_tongue: And it could work nicely for preset frequency (and reset/off :wink: ) settings.

The toggle node in my flow is not a dashboard toggle switch, it is a logical "toggle switch" that does the state change work for the actual flashing.

Oh. OK.

Um, (sorry) but the trigger node should be able to be set to control the flashing of the ui-led node.

Oh. Ok. Looking at the flow now.

I may (just to help kill some time) see if I can get it a bit better.
(But your toggle node isn't there when I import the flow)

Ok, no, sorry. You are right. I only just got up. Brain not working.

1 Like

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