# Node-red-simple-gate help needed for debugging and setup

**URL:** <https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885>\
**Category:** General\
**Created:** [12 March 2019 14:09 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885 "2019-03-12T14:09:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimitar](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dimitar](https://discourse.nodered.org/u/dimitar)\
**Post date:** [12 March 2019 14:09 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885/1 "2019-03-12T14:09:48Z")

</div>

Hi everyone,  
I feel like this is the right place to ask about node-red-simple-gate.  
I really like this node for its simplicity and functionality (Thanks drmike)  
I am trying to implement my Hikvisions cameras to turn on a led light integrated with homeassistant presence detection and big timer. Big timers triggers perfect the simple gate but I've got no luck with homeassistant event state.  
I added two inject nodes and connected them with message node for debugging.  
the messages are looking exactly the same with the output of the "Change" node but only the inject nodes are opening the gate. I am digging about a three days in a row what's going on but with no any result. Please if anyone can look at the screenshots and the configuration to point me to my error. Thanks in advance.  
`[{"id":"3ad3baf7.3a85f6","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"1b9cd4b6.16e4bb","type":"server-state-changed","z":"3ad3baf7.3a85f6","name":"At Villa?","server":"6550c169.4f217","entityidfilter":"device_tracker.google_maps_117732613331293269145","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":124.5,"y":277,"wires":[["5382f0e6.47991"]]},{"id":"5382f0e6.47991","type":"change","z":"3ad3baf7.3a85f6","name":"Change","rules":[{"t":"change","p":"payload","pt":"msg","from":"Villa","fromt":"str","to":"open","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"home","fromt":"str","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":427.5,"y":277,"wires":[["fdddc2e.560464","6e6bc24d.7d183c"]]},{"id":"6e6bc24d.7d183c","type":"gate","z":"3ad3baf7.3a85f6","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":true,"x":655.5,"y":287,"wires":[[]]},{"id":"f583c990.e047d8","type":"inject","z":"3ad3baf7.3a85f6","name":"Payload: Villa","topic":"control","payload":"Villa","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":152.5,"y":371,"wires":[["5382f0e6.47991"]]},{"id":"b8a3363.b6ea3c8","type":"inject","z":"3ad3baf7.3a85f6","name":"Payload: home","topic":"control","payload":"home","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":141,"y":429,"wires":[["5382f0e6.47991"]]},{"id":"fdddc2e.560464","type":"debug","z":"3ad3baf7.3a85f6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":660.5,"y":398,"wires":[]},{"id":"6550c169.4f217","type":"server","z":"","name":"Raspberry Pi Homeassistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]`

 ![Presence](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f79490aefd31392df7cd383c2549a80c97fa57c1.jpeg)

---

<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:** [12 March 2019 14:36 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885/2 "2019-03-12T14:36:32Z")

</div>

Show us what you see in the debug node for the working and non-working messages.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [12 March 2019 18:09 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885/3 "2019-03-12T18:09:13Z")

</div>

@dimitar, I'm glad you like the `gate` node and certainly want it to do the job for you. I think the answer @Colin's question will show us the problem.

---

<div class="post-metadata">

**Author:** ![dimitar](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dimitar](https://discourse.nodered.org/u/dimitar)\
**Post date:** [12 March 2019 20:28 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885/4 "2019-03-12T20:28:04Z")

</div>

I was prepared with a screenshot of the debug output but as a new member I was able to post only one picture.  
 ![PresenceMsg](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4b3b9b96ccdb6b51d1731eb578bdc6fe64cb4bfe.jpeg)  
Here the first couple is from the inject node the second is from the event state output of homeassistant.  
Thanks for replying.

---

<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:** [12 March 2019 20:59 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885/5 "2019-03-12T20:59:26Z")

</div>

The obvious difference is that the topics are different. To make open/close work the topic needs to be whatever you have specified for Control Topic in the gate node setup.

---

<div class="post-metadata">

**Author:** ![dimitar](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dimitar](https://discourse.nodered.org/u/dimitar)\
**Post date:** [12 March 2019 21:10 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885/6 "2019-03-12T21:10:06Z")

</div>

Yep that was the problem @Colin thank you for the reply again I was in a loop for three days.  
Yee I am so happy now.!!!!

---

<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:** [12 March 2019 21:20 UTC](https://discourse.nodered.org/t/node-red-simple-gate-help-needed-for-debugging-and-setup/8885/7 "2019-03-12T21:20:53Z")

</div>

There had to be a difference in the messages as all a node knows when it is passed a message is what is in the message. Whenever you get a similar situation compare all aspects of the messages. If necessary you can change the debug to show the full message.
