# Node-red flow -set timeout with js

**URL:** <https://discourse.nodered.org/t/node-red-flow-set-timeout-with-js/37710>\
**Category:** General\
**Created:** [18 December 2020 15:27 UTC](https://discourse.nodered.org/t/node-red-flow-set-timeout-with-js/37710 "2020-12-18T15:27:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [21 December 2020 10:26 UTC](https://discourse.nodered.org/t/node-red-flow-set-timeout-with-js/37710/4 "2020-12-21T10:26:15Z")

</div>

with the help of Johannes (JGKK) I managed to use an enocean rocker 4 switch as a dimmer.  
He did a perfect job!  
Please have a look at this threat:

> [@Node-red-contrib-enocean](https://discourse.nodered.org/t/node-red-contrib-enocean/37409):
>
> I am using the above mentioned Node-red Flow and have some problems with a rocker 4 switch. How can I calculate the time between button pressed and button released. Actually I am not able to identify the resulting messages as coming from the same button. Any help appreciated. regards

---

_[View the full topic](https://discourse.nodered.org/t/node-red-flow-set-timeout-with-js/37710)._
