# Flash LED strips on trigger MQTT

**URL:** <https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358>\
**Category:** General\
**Created:** [2 July 2020 08:17 UTC](https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358 "2020-07-02T08:17:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ranur](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ranur/32/15294_2.png) [@Ranur](https://discourse.nodered.org/u/Ranur)\
**Post date:** [2 July 2020 08:17 UTC](https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358/1 "2020-07-02T08:17:13Z")

</div>

I have a setup in my boat where I use Node Red to control a set of Shelly RGBW2s over MQTT. It works flawlessly, and I have a nice working dashboard. Now I am looking for a ways to make the lights flash on alarm. I have this setup now [https://photos.app.goo.gl/wrCLrP6g5ZpBdxtA6](https://photos.app.goo.gl/wrCLrP6g5ZpBdxtA6) as a trial. What it does is to light up a led strip on my boat when the wind increases beyond a certain threshold and shut down as the wind drops. The trigger could be any sensor I can imagine.  
What I'd like to do is to flicker or strobe the light for a pre defined period of time, then return to previous state. Any ideas on what kind of node to use for such a project?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [2 July 2020 09:06 UTC](https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358/2 "2020-07-02T09:06:15Z")

</div>

the trigger node can be set to repeatedly send a message. Another trigger node could be used to start and reset it.

---

<div class="post-metadata">

**Author:** ![Ranur](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ranur/32/15294_2.png) [@Ranur](https://discourse.nodered.org/u/Ranur)\
**Post date:** [2 July 2020 09:30 UTC](https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358/3 "2020-07-02T09:30:40Z")

</div>

So two trigger nodes in line before the set msg payload nodes? each with two connections to the switch node? One to trigger the action and one to halt it?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [2 July 2020 09:58 UTC](https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358/4 "2020-07-02T09:58:51Z")

</div>

Actually 3 🙂 maybe like this

```auto
[{"id":"80f96dd.bc1d49","type":"inject","z":"c593e272.16862","name":"start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":100,"y":280,"wires":[["bc48a383.7221c"]]},{"id":"bc48a383.7221c","type":"trigger","z":"c593e272.16862","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":290,"y":280,"wires":[["ecb0f17c.3107c"]]},{"id":"ecb0f17c.3107c","type":"trigger","z":"c593e272.16862","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-1","extend":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":380,"y":340,"wires":[["621c220b.f4d83c"]]},{"id":"621c220b.f4d83c","type":"trigger","z":"c593e272.16862","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0.5","extend":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":430,"y":400,"wires":[["f117b6c2.282448"]]},{"id":"f117b6c2.282448","type":"debug","z":"c593e272.16862","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":460,"wires":[]},{"id":"e1d73822.0d8878","type":"inject","z":"c593e272.16862","name":"stop","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":110,"y":340,"wires":[["bc48a383.7221c","ecb0f17c.3107c"]]}]

```

---

<div class="post-metadata">

**Author:** ![Ranur](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ranur/32/15294_2.png) [@Ranur](https://discourse.nodered.org/u/Ranur)\
**Post date:** [3 July 2020 06:20 UTC](https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358/5 "2020-07-03T06:20:39Z")

</div>

> [@dceejay](#):
>
> ```auto
> [{"id":"80f96dd.bc1d49","type":"inject","z":"c593e272.16862","name":"start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":100,"y":280,"wires":[["bc48a383.7221c"]]},{"id":"bc48a383.7221c","type":"trigger","z":"c593e272.16862","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":290,"y":280,"wires":[["ecb0f17c.3107c"]]},{"id":"ecb0f17c.3107c","type":"trigger","z":"c593e272.16862","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-1","extend":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":380,"y":340,"wires":[["621c220b.f4d83c"]]},{"id":"621c220b.f4d83c","type":"trigger","z":"c593e272.16862","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0.5","extend":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":430,"y":400,"wires":[["f117b6c2.282448"]]},{"id":"f117b6c2.282448","type":"debug","z":"c593e272.16862","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":460,"wires":[]},{"id":"e1d73822.0d8878","type":"inject","z":"c593e272.16862","name":"stop","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":110,"y":340,"wires":[["bc48a383.7221c","ecb0f17c.3107c"]]}]
> 
> ```

Thanks! Will try it out. 😃

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 September 2020 06:20 UTC](https://discourse.nodered.org/t/flash-led-strips-on-trigger-mqtt/29358/6 "2020-09-01T06:20:40Z")

</div>

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