A node-red-contrib-dsm question

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

        "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

There is a dsm variable called output for this purpose.

Try:

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

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

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.

1 Like