# Trigger needed to detect a string status going from 'on' to 'off'

**URL:** https://discourse.nodered.org/t/trigger-needed-to-detect-a-string-status-going-from-on-to-off/84270
**Category:** General
**Created:** [4 January 2024 03:10 UTC](https://discourse.nodered.org/t/trigger-needed-to-detect-a-string-status-going-from-on-to-off/84270 "2024-01-04T03:10:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Outsidewall](https://avatars.discourse-cdn.com/v4/letter/o/e68b1a/32.png) [@Outsidewall](https://discourse.nodered.org/u/Outsidewall)
#### Post date: [4 January 2024 03:10 UTC](https://discourse.nodered.org/t/trigger-needed-to-detect-a-string-status-going-from-on-to-off/84270/1 "2024-01-04T03:10:26Z")

</div>

Hello, I must be missing something, maybe brain cells, I can not seem to find a flow addon that follows the following pattern.  
Detecting a state change of a string from 'on' to 'off' or in fact from any string to another string. Can anyone please point me in the right direction.

Thank you

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [4 January 2024 04:15 UTC](https://discourse.nodered.org/t/trigger-needed-to-detect-a-string-status-going-from-on-to-off/84270/2 "2024-01-04T04:15:52Z")

</div>

You don't need a "addon" for this, as it is at the core of node-red.

I would highly recommend to watch [this complete playlist](https://www.youtube.com/watch?v=ksGeUD26Mw0&list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6&pp=iAQB) to get an understanding of all the basics, it will take at most an hour of your time but it covers all the concepts.

---

<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: [4 January 2024 07:26 UTC](https://discourse.nodered.org/t/trigger-needed-to-detect-a-string-status-going-from-on-to-off/84270/3 "2024-01-04T07:26:33Z")

</div>

> [@Outsidewall](#):
>
> Detecting a state change of a string from 'on' to 'off' or in fact from any string to another string. Can anyone please point me in the right direction

The filter node is what you use to observe changes. The switch node can then be used to route messages.

Your node \> filter node \> switch node

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [4 January 2024 07:48 UTC](https://discourse.nodered.org/t/trigger-needed-to-detect-a-string-status-going-from-on-to-off/84270/4 "2024-01-04T07:48:58Z")

</div>

Further to @Steve-Mcl post, you can also observe changes in a switch node using `!=``previous value`

---

<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: [4 March 2024 07:49 UTC](https://discourse.nodered.org/t/trigger-needed-to-detect-a-string-status-going-from-on-to-off/84270/5 "2024-03-04T07:49:14Z")

</div>

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