# Trigger node not responding as expected (Flashing vLED)

**URL:** <https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934>\
**Category:** General\
**Created:** [2 July 2021 08:47 UTC](https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934 "2021-07-02T08:47:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [2 July 2021 08:47 UTC](https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934/1 "2021-07-02T08:47:07Z")

</div>

I have been trying for hours to write script to dynamically vary the flash rate of a silly vLED on the desktop... always worked for the first flash, then nada. Skipping that for now...

Then I discovered the **Trigger** node... should do the trick very nicely.

send it `msg.reset` it resets  
send it `msg.delay` (with payload as the delay settings it will use) it changes it's frequency

But it doesn't respond the way the directions say it should. It simply keeps on with the preset settings (in this case 250ms)

What am I missing??

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f954f90ba196092b7ad7e0543786f5478ce95c5.png)

```auto
[{"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":610,"y":300,"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":470,"y":300,"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":true,"outs":"end","topic":"delay","topicType":"msg","min":"32","max":"2000","step":1,"x":150,"y":320,"wires":[["c6b10cae.c126a","40d1b12f.76016"]]},{"id":"40d1b12f.76016","type":"debug","z":"af1708dc.4e6ce8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":330,"y":360,"wires":[]},{"id":"c6b10cae.c126a","type":"trigger","z":"af1708dc.4e6ce8","name":"Trigger","op1":"togglenow","op2":"false","op1type":"str","op2type":"bool","duration":"-500","extend":false,"overrideDelay":true,"units":"ms","reset":"reset","bytopic":"all","topic":"topic","outputs":1,"x":320,"y":300,"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":"","payloadType":"date","topic":"reset","topicType":"msg","x":150,"y":280,"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}]

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/21f77d2c93db87fca5f1ee5d0125a63dc1fc520a.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0ae30f5b502bb8248d1246c30eb19b6e4e2a8a71.png) ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/25fbc24660346208747246f6defbb05326ed7232.png)

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [2 July 2021 08:56 UTC](https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934/2 "2021-07-02T08:56:28Z")

</div>

OK... reset works IF you include the text "reset"... this is NOT what the docs say 😛  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9e080ecc78fb0da27cf693aa7e70223f3c1692db.png)

Well.. I guess it does include that option 😊

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f93994a49337205e73193f6c43544bd14524d7b3.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [2 July 2021 08:59 UTC](https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934/3 "2021-07-02T08:59:35Z")

</div>

The help states...

> `delay`
> 
> Sets the delay, in milliseconds, to be applied to the message. This option only applies if the node is configured to allow the message to override the configured default delay interval.
> 
> `reset`
> 
> If a message is received with this property, any timeout or repeat currently in progress will be cleared and no message triggered.

The important parts being "message" "with this property"

as in `msg.reset` and `msg.delay`

  

So, for the dynamic delay, add a change node after slider, set `msg.delay` to `msg.payload`

For the reset, add a change node after the button and set `msg.reset` to boolean `true`

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [2 July 2021 09:02 UTC](https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934/4 "2021-07-02T09:02:04Z")

</div>

This is what I was reading 😊

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/a/ba2cb0c41952f53bf330d232eec707a7c8a2d688.png)

> [@Steve-Mcl](#):
>
> add a change node after slider, set `msg.delay` to `msg.payload`

I will try that now...

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [2 July 2021 09:09 UTC](https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934/5 "2021-07-02T09:09:05Z")

</div>

OK... that worked, thanks 😃

But it is strange that just setting the slider node to `msg.payload` didn't?? (which I believe I had tried...)

My (_now_) working flow...

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/3/73897c9eecb5b74e1e101904a6e8ea9ef317c38c.png)

```auto
[{"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}]

```

---

<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:** [16 July 2021 09:09 UTC](https://discourse.nodered.org/t/trigger-node-not-responding-as-expected-flashing-vled/47934/6 "2021-07-16T09:09:22Z")

</div>

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