N00b Node-Red issues

G’day all, I’ve got my Hass.io into a pretty good place and wanted to start exploring automation, specifically using Node-Red. I’ve made a couple of simple ones to get the hang of things but Im not getting the desired results.

These two automations work perfectly if I set the timer values for very short periods (eg 1-2 mins or seconds) but when set to the longer value I actually want, they just never work. :confounded:

What am I doing wrong?

PS, in a couple of the videos I’ve seen, the Node-red items show the status eg halted, that seems super useful but I cant work out how to see what is actually going on with the flow.

You can inject a debug node at any point to help with flow

Thanks, I’ll try that.

Btw do you know how to show the halt states like in this video?

Look for “Halt if” in your event state node as well in your current state node and enter the state you want it to halt on (on / off).

Regarding your flow issue, if you post your code we can help you troubleshoot it, also take advantage of the debug node when troubleshooting.

Howdy, I do have halt off states defined.

I’m happy to post my “code”, just not sure how to get it?

No problem do the following,

Highlight the nodes in your flow
snip_20180822201947

Click on the hamburger on the right ----> Export ----> clipboard
snip_20180822202253

Next click on Export to clipboard. Then come back to the forum and paste. Hope this helps.
snip_20180822202859

1 Like

Great instructions, thank you. :slight_smile:

 [{"id":"1665ac35.d13164","type":"server-state-changed","z":"14dc56de.994fc9","name":"Derek's Lamp","server":"cdc70a7b.b1da78","entityidfilter":"light.dereks_lamp_83","entityidfiltertype":"substring","haltifstate":"off","x":90,"y":120,"wires":[["b2f0bc8c.a837a"]]},{"id":"a9770ab4.3ece68","type":"server-state-changed","z":"14dc56de.994fc9","name":"Rcahel's Lamp","server":"cdc70a7b.b1da78","entityidfilter":"light.rachaels_lamp_56","entityidfiltertype":"substring","haltifstate":"off","x":100,"y":180,"wires":[["29ed8652.ee67da"]]},{"id":"f7554b97.78a038","type":"stoptimer","z":"14dc56de.994fc9","duration":"45","units":"Minute","payloadtype":"str","payloadval":"","name":"","x":560,"y":120,"wires":[["7736fab2.405174","d9caaf0c.806d7"],[]]},{"id":"7736fab2.405174","type":"api-call-service","z":"14dc56de.994fc9","name":"Derek's Lamp Off","server":"cdc70a7b.b1da78","service_domain":"homeassistant","service":"turn_off","data":"{   \"entity_id\": \"light.dereks_lamp_83\" }","mergecontext":"","x":790,"y":120,"wires":[[]]},{"id":"b2f0bc8c.a837a","type":"api-current-state","z":"14dc56de.994fc9","name":"Dereks Lamp","server":"cdc70a7b.b1da78","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"light.dereks_lamp_83","x":310,"y":120,"wires":[["f7554b97.78a038"]]},{"id":"29ed8652.ee67da","type":"api-current-state","z":"14dc56de.994fc9","name":"Rachaels Lamp","server":"cdc70a7b.b1da78","halt_if":"off","override_topic":true,"override_payload":true,"entity_id":"light.rachaels_lamp_56","x":320,"y":180,"wires":[["f7554b97.78a038"]]},{"id":"d9caaf0c.806d7","type":"api-call-service","z":"14dc56de.994fc9","name":"Rachael's Lamp Off","server":"cdc70a7b.b1da78","service_domain":"homeassistant","service":"turn_off","data":"{   \"entity_id\": \"light.rachaels_lamp_56\" }","mergecontext":"","x":790,"y":180,"wires":[[]]},{"id":"cdc70a7b.b1da78","type":"server","z":"","name":"Home Assistant","url":"http://hassio/homeassistant","pass":"978752af1b1846dcb8568451731cfa99"}]

Hmm, now that I know how to export code, I realised I can use the reverse mechanism to import code. So I imported a few examples from:

and had a play around - looks like I was missing putting a “0” in the 2nd payload field within the switch - my short duration tests all worked, so now I’m hoping setting the desired duration will also work. :thinking:

Glad to hear you sorted everything out. :smiley:

I think something I did was dodgy, I broke it into 2 seperate automations and one worked and one didnt - so i blew away the one that didnt and rebuilt it - seems all good now.