# Help with current state node

**URL:** <https://discourse.nodered.org/t/help-with-current-state-node/27785>\
**Category:** General\
**Created:** [4 June 2020 19:24 UTC](https://discourse.nodered.org/t/help-with-current-state-node/27785 "2020-06-04T19:24:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Auto101](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/auto101/32/20157_2.png) [@Auto101](https://discourse.nodered.org/u/Auto101)\
**Post date:** [4 June 2020 19:24 UTC](https://discourse.nodered.org/t/help-with-current-state-node/27785/1 "2020-06-04T19:24:10Z")

</div>

Hi,

The current state node works fine when I trigger this manually .

The current state node shows error when I try to trigger it using an automation from an event.

I am not sure what went wrong here .

--Works fine :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c19cceca05641748fd7753b2bd72fea817bb694b.png)

--Error:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/63bc30bbb13d67993338c94366fd28219db78d48.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [4 June 2020 19:37 UTC](https://discourse.nodered.org/t/help-with-current-state-node/27785/2 "2020-06-04T19:37:44Z")

</div>

put a debug node on the "events' tab and see what is the format and type of the msg.payload. Is the data valid for the current state node?

---

<div class="post-metadata">

**Author:** ![Auto101](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/auto101/32/20157_2.png) [@Auto101](https://discourse.nodered.org/u/Auto101)\
**Post date:** [4 June 2020 19:45 UTC](https://discourse.nodered.org/t/help-with-current-state-node/27785/3 "2020-06-04T19:45:48Z")

</div>

Thanks for the response .Here is the output from debug node of event.

My goal is to turn on a switch based on output of the event node . Before turning on the switch ,I want to check if that switch is on or not .That is why I am using a current state node

```auto
object
event_type: "image_processing.detect_face"
entity_id: "image_processing.face_counter"
event: object
name: "Pav"
confidence: 78.27
entity_id: "image_processing.face_counter"

```

---

<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:** [3 August 2020 19:46 UTC](https://discourse.nodered.org/t/help-with-current-state-node/27785/4 "2020-08-03T19:46:06Z")

</div>

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