# Why DSM node not working correctly

**URL:** <https://discourse.nodered.org/t/why-dsm-node-not-working-correctly/21644>\
**Category:** General\
**Created:** [13 February 2020 11:50 UTC](https://discourse.nodered.org/t/why-dsm-node-not-working-correctly/21644 "2020-02-13T11:50:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpt2007](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@lpt2007](https://discourse.nodered.org/u/lpt2007)\
**Post date:** [13 February 2020 11:50 UTC](https://discourse.nodered.org/t/why-dsm-node-not-working-correctly/21644/1 "2020-02-13T11:50:42Z")

</div>

Why this [node-red-contrib-dsm](https://flows.nodered.org/node/node-red-contrib-dsm) not working? I try to use it to count rf button clicks. On DSM input i get coun 1 or 2 or 3.

```auto
{
    "triggerInput": "count",
    "stateOutput": "payload",
    "currentState": "depressed",
    "states": {
        "pressed-once": {
            "1": "pressed-once"
        },
        "pressed-twice": {
            "2": "pressed-twice"
        },
        "pressed-thrice": {
            "3": "pressed-thrice"
        },
        "depressed": {
            "0": "depressed"
        }
    }
}

```

---

<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:** [15 February 2020 15:51 UTC](https://discourse.nodered.org/t/why-dsm-node-not-working-correctly/21644/2 "2020-02-15T15:51:01Z")

</div>

Could you post your flow?

See:

> [@How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506):
>
> To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly. The easiest way to do that is to click the 'Preformatted Text' button in the toolbar: [image] Then paste in your code or flow json. You should end up with three back-tick characters - ``` - on their own line before and after the code. On standard US English keyboards, this is on the same key as the ~ character. Using the backticks will ens…

and please read the doc and go to the Wiki to see how you can use the dsm node.

---

<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:** [15 April 2020 15:51 UTC](https://discourse.nodered.org/t/why-dsm-node-not-working-correctly/21644/3 "2020-04-15T15:51:06Z")

</div>

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