# A node-red-contrib-dsm question

**URL:** <https://discourse.nodered.org/t/a-node-red-contrib-dsm-question/4723>\
**Category:** General\
**Created:** [9 November 2018 15:35 UTC](https://discourse.nodered.org/t/a-node-red-contrib-dsm-question/4723 "2018-11-09T15:35:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 November 2018 15:35 UTC](https://discourse.nodered.org/t/a-node-red-contrib-dsm-question/4723/1 "2018-11-09T15:35:31Z")

</div>

I have a question about the dsm node. I am looking at the hysteresis example on the wiki [1] and I want to change it so that it only sends a message on the way down and does nothing on the way up.  
I tried

```auto
        "cross_high": [
            "msg = null;",
            "sm.fill = 'green';"
        ],

```

but then it just passed on the original message.

[1] [https://github.com/cflurin/node-red-contrib-dsm/wiki/Hysteresis](https://github.com/cflurin/node-red-contrib-dsm/wiki/Hysteresis)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [9 November 2018 16:17 UTC](https://discourse.nodered.org/t/a-node-red-contrib-dsm-question/4723/2 "2018-11-09T16:17:26Z")

</div>

There is a dsm variable called `output` for this purpose.

Try:

```auto
        "cross_high": [
            "output = false;",
            "sm.fill = 'green';"
        ],

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 November 2018 16:33 UTC](https://discourse.nodered.org/t/a-node-red-contrib-dsm-question/4723/3 "2018-11-09T16:33:50Z")

</div>

Perfect, thanks. I missed that.  
An excellent node, it just takes a bit of time to get one's head round.

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [9 November 2018 16:54 UTC](https://discourse.nodered.org/t/a-node-red-contrib-dsm-question/4723/4 "2018-11-09T16:54:02Z")

</div>

Thanks! I know I should improve the documentation. First I had to learn how to handle the data and methods. In the meantime, I hope the examples can help.
