# Why doesn't a flow work and another does, being the same?

**URL:** https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645
**Category:** General
**Created:** [23 December 2022 21:17 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645 "2022-12-23T21:17:52Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Phrana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/phrana/32/72525_2.png) [@Phrana](https://discourse.nodered.org/u/Phrana)
#### Post date: [23 December 2022 21:17 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/1 "2022-12-23T21:17:52Z")

</div>

Hello, I have a flow that I have copied (changing the entities) and although the zones are the same, it does not work in one.  
I thought that the switch or the presence sensor would be bad, but I have verified that they work. What am I doing wrong?

```auto
[{"id":"718fdd297bb4fec2","type":"tab","label":"Entrada Automatismo","disabled":false,"info":"","env":[]},{"id":"0574934a842d86b3","type":"api-call-service","z":"718fdd297bb4fec2","name":"Encender luz","server":"2e0f828a.d95dbe","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.conmutador_entrada"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":450,"y":140,"wires":[["616c40b048ed5826","42c7990c36c6784e"]]},{"id":"09707e72f60b88f5","type":"delay","z":"718fdd297bb4fec2","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":440,"y":300,"wires":[["69a108d97cdd0581","3a3319ec4e2f5e4d"]]},{"id":"69a108d97cdd0581","type":"api-call-service","z":"718fdd297bb4fec2","name":"Apagar luz","server":"2e0f828a.d95dbe","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.conmutador_entrada"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":670,"y":300,"wires":[["7b29f8a330158aec"]]},{"id":"616c40b048ed5826","type":"change","z":"718fdd297bb4fec2","name":"Resetear delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"now","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":120,"wires":[["09707e72f60b88f5","3a3319ec4e2f5e4d"]]},{"id":"5d23ee08feb90ca7","type":"server-state-changed","z":"718fdd297bb4fec2","name":"Sensor Entrada","server":"2e0f828a.d95dbe","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.sensor_movimiento_entrada_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":220,"wires":[["02d9c0131c7ce0d2"],["53b336bcc63a3047"]]},{"id":"02d9c0131c7ce0d2","type":"time-range-switch","z":"718fdd297bb4fec2","name":"Oscuridad","lat":"40.110848","lon":"-3.691797","startTime":"17:45","endTime":"02:00","startOffset":0,"endOffset":0,"x":130,"y":140,"wires":[["0574934a842d86b3"],[]]},{"id":"53b336bcc63a3047","type":"time-range-switch","z":"718fdd297bb4fec2","name":"Oscuridad","lat":"40.110848","lon":"-3.691797","startTime":"17:45","endTime":"02:00","startOffset":0,"endOffset":0,"x":130,"y":300,"wires":[["09707e72f60b88f5"],[]]},{"id":"930c45a77e4c143a","type":"comment","z":"718fdd297bb4fec2","name":"Rangos","info":"dawn > antes del amanecer\nnauticalDawn > antes del amanecer (náutico)\nsunrise > amanecer\nsunriseEnd fin del amanecer\nsolarNoon > mediodía solar\ngoldenHour > las horas de oro\ngoldenHourEnd > fin de las horas de oro\nsunsetStart > comienza la puesta de sol\nsunset > puesta del sol\ndusk > comienza la oscuridad\nnauticalDusk > comienza la oscuridad (náutica)\nnight > noche\nnightEnd > fin de la noche\nnadir > parte de la noche más oscura\n","x":1130,"y":240,"wires":[]},{"id":"630cc4eb44c5f355","type":"inject","z":"718fdd297bb4fec2","name":"Apagar manual","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":400,"wires":[["69a108d97cdd0581"]]},{"id":"881e57e35f648efd","type":"inject","z":"718fdd297bb4fec2","name":"Encender manual","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":40,"wires":[["0574934a842d86b3"]]},{"id":"42c7990c36c6784e","type":"debug","z":"718fdd297bb4fec2","name":"debug 16","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":140,"wires":[]},{"id":"3a3319ec4e2f5e4d","type":"debug","z":"718fdd297bb4fec2","name":"debug 17","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":220,"wires":[]},{"id":"7b29f8a330158aec","type":"debug","z":"718fdd297bb4fec2","name":"debug 18","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":300,"wires":[]},{"id":"317076499a763abb","type":"api-call-service","z":"718fdd297bb4fec2","name":"Apagar luz","server":"2e0f828a.d95dbe","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.conmutador_entrada"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":550,"y":520,"wires":[["9152041f3117ad09"]]},{"id":"9152041f3117ad09","type":"debug","z":"718fdd297bb4fec2","name":"debug 30","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":520,"wires":[]},{"id":"6b76e3731ca8ec7c","type":"delay","z":"718fdd297bb4fec2","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":760,"y":440,"wires":[["317076499a763abb"]]},{"id":"64294f8df7d5ff52","type":"change","z":"718fdd297bb4fec2","name":"Resetear delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"now","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":440,"wires":[["6b76e3731ca8ec7c"]]},{"id":"ac742b68274df028","type":"server-state-changed","z":"718fdd297bb4fec2","name":"Conmutador Entrada","server":"2e0f828a.d95dbe","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.conmutador_entrada","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":460,"wires":[["64294f8df7d5ff52"],[]]},{"id":"2e0f828a.d95dbe","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":false}]

```

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [23 December 2022 21:24 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/2 "2022-12-23T21:24:47Z")

</div>

Hi, welcome - I've changed your category from "Creating nodes" to general since this question is not about creating custom nodes. Thanks.

---

<div class="post-metadata">

### Author: ![Phrana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/phrana/32/72525_2.png) [@Phrana](https://discourse.nodered.org/u/Phrana)
#### Post date: [24 December 2022 14:53 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/3 "2022-12-24T14:53:32Z")

</div>

Ok thanks and sorry, I'm new to this and I don't really know where it's going.

---

<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: [24 December 2022 15:13 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/4 "2022-12-24T15:13:53Z")

</div>

> [@Phrana](#):
>
> although the zones are the same, it does not work in one.

Add debug nodes and determine which is the first node that is not doing what it should.

---

<div class="post-metadata">

### Author: ![Phrana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/phrana/32/72525_2.png) [@Phrana](https://discourse.nodered.org/u/Phrana)
#### Post date: [24 December 2022 17:11 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/5 "2022-12-24T17:11:57Z")

</div>

Hello, thanks, I have done it, but nothing appears, all the flows have their corresponding debugs.  
I also have a problem and that in the other flows, they do not respect the 60 seconds, they are on for 3 minutes

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/8/481c4fb3fc19df44de0d60a837b734f760f9b6bf.png)

---

<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: [24 December 2022 17:32 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/6 "2022-12-24T17:32:21Z")

</div>

I don't use HA (few here do, we generally consider it better just to use NR) so don't know what your flow is doing. But if the problem is that nothing is coming from the HA nodes then you will probably be better asking on an HA forum.

---

<div class="post-metadata">

### Author: ![Phrana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/phrana/32/72525_2.png) [@Phrana](https://discourse.nodered.org/u/Phrana)
#### Post date: [24 December 2022 17:39 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/7 "2022-12-24T17:39:36Z")

</div>

I use it with HA because I don't know how to integrate Zigbee devices in any other way, because I also have Wi-Fi devices, but I don't use it from HA, I use it from a web terminal from its 1880 port

---

<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: [24 December 2022 22:04 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/8 "2022-12-24T22:04:44Z")

</div>

> [@Phrana](#):
>
> I use it with HA because I don't know how to integrate Zigbee devices in any other way

That is trivial. Use zigbee2mqtt.

---

<div class="post-metadata">

### Author: ![Phrana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/phrana/32/72525_2.png) [@Phrana](https://discourse.nodered.org/u/Phrana)
#### Post date: [25 December 2022 19:08 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/9 "2022-12-25T19:08:57Z")

</div>

I have it installed to link the devices, but I would like to use node-red

---

<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: [25 December 2022 21:07 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/10 "2022-12-25T21:07:06Z")

</div>

In node red use the built in mqtt nodes to monitor and control the devices through mqtt.

---

<div class="post-metadata">

### Author: ![Phrana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/phrana/32/72525_2.png) [@Phrana](https://discourse.nodered.org/u/Phrana)
#### Post date: [9 January 2023 08:48 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/11 "2023-01-09T08:48:36Z")

</div>

ok, thank you very much

---

<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: [10 March 2023 08:49 UTC](https://discourse.nodered.org/t/why-doesnt-a-flow-work-and-another-does-being-the-same/72645/12 "2023-03-10T08:49:11Z")

</div>

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