Help translating this HA automation to NR

Hiya

This automation below is perfect - but I would like to have it running in NR.
https://149walnut.com/2018-05-smart-garbage-pt-1-pattern-for-deferring-service-calls-in-home-assistant/

So - a reminder to put the rubbish out on a specific day of the week + time that is immediate if I’m home, but if I’m not home, delayed till I arrive.

I’ve got a Boolean in home assistant for “rubbish day pending” set up.

This is what I’ve got so far - but probably isn’t worth a grain of salt as it doesn’t work properly and I’m very new to this!

[{"id":"de99cc88.9c4a7","type":"tab","label":"Flow 2","disabled":true,"info":""},{"id":"80ed7532.da94a8","type":"api-call-service","z":"de99cc88.9c4a7","name":"","server":"b2baae99.7c976","version":1,"debugenabled":false,"service_domain":"telegram_bot","service":"send_message","entityId":"","data":"{\"message\":\"Rubbish out, IM HOME\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":680,"y":240,"wires":[[]]},{"id":"c30daafa.a9dbc8","type":"inject","z":"de99cc88.9c4a7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 20 * * 4","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":300,"wires":[["2d26bcde.5f5ee4"]]},{"id":"2d26bcde.5f5ee4","type":"trigger-state","z":"de99cc88.9c4a7","name":"Bart track","server":"b2baae99.7c976","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"person.bart_simpson","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":160,"y":380,"wires":[["c45feaf3.2a4f68"],[]]},{"id":"a9d3ce90.478b9","type":"api-call-service","z":"de99cc88.9c4a7","name":"","server":"b2baae99.7c976","version":1,"debugenabled":false,"service_domain":"telegram_bot","service":"send_message","entityId":"","data":"{\"message\":\"Rubbish out, GOT HOME\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":920,"y":480,"wires":[["ba975289.1b70c"]]},{"id":"8e906415.3c17b8","type":"api-call-service","z":"de99cc88.9c4a7","name":"","server":"b2baae99.7c976","version":1,"debugenabled":true,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.rubbish_pending","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":640,"y":380,"wires":[[]]},{"id":"129b086c.9ec7d8","type":"api-current-state","z":"de99cc88.9c4a7","name":"","server":"b2baae99.7c976","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.rubbish_pending","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":560,"y":480,"wires":[["a9d3ce90.478b9"],[]]},{"id":"5e443985.3ff3b8","type":"switch","z":"de99cc88.9c4a7","name":"Home?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"},{"t":"neq","v":"home","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":380,"y":380,"wires":[["80ed7532.da94a8"],["8e906415.3c17b8"]]},{"id":"ba975289.1b70c","type":"api-call-service","z":"de99cc88.9c4a7","name":"","server":"b2baae99.7c976","version":1,"debugenabled":true,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.rubbish_pending","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":940,"y":560,"wires":[[]]},{"id":"c45feaf3.2a4f68","type":"rbe","z":"de99cc88.9c4a7","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":275,"y":380,"wires":[["5e443985.3ff3b8"]],"l":false},{"id":"13db3d5f.52fc53","type":"ha-zone","z":"de99cc88.9c4a7","server":"b2baae99.7c976","name":"","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entities":["person.bart_simpson"],"event":"enter","zones":["zone.home"],"x":180,"y":520,"wires":[["129b086c.9ec7d8"]]},{"id":"b2baae99.7c976","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Any guidance as to the correct method of achieving this is appreciated!

[{"id":"d8a2c269.df76","type":"inject","z":"f61766ce.f85398","name":"Garbage Day","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"15 20 * * 4","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":192,"y":4576,"wires":[["cb35a9d0.476d28"]]},{"id":"cb35a9d0.476d28","type":"api-current-state","z":"f61766ce.f85398","name":"home?","server":"","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"device_tracker.craig_craig","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":354,"y":4576,"wires":[["13d9988a.d42f67"],["426319ef.75f158"]]},{"id":"91f73d08.b97ed","type":"trigger-state","z":"f61766ce.f85398","name":"arrive home","server":"","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"device_tracker.craig_craig","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"home","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":"is_not","comparatorValueDatatype":"str","comparatorValue":"home","propertyValue":"old_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":742,"y":4624,"wires":[["13d9988a.d42f67"],[]]},{"id":"2e4372a5.59bf3e","type":"change","z":"f61766ce.f85398","name":"disable","rules":[{"t":"set","p":"payload","pt":"msg","to":"disable","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":732,"y":4576,"wires":[["91f73d08.b97ed"]]},{"id":"426319ef.75f158","type":"change","z":"f61766ce.f85398","name":"enable","rules":[{"t":"set","p":"payload","pt":"msg","to":"enable","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":514,"y":4624,"wires":[["91f73d08.b97ed"]]},{"id":"13d9988a.d42f67","type":"api-call-service","z":"f61766ce.f85398","name":"Send notifaction","server":"","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":544,"y":4576,"wires":[["2e4372a5.59bf3e"]]}]

Thank you, I’ll take a look! :slightly_smiling_face:

You sir, are amazing! :100:
Thank you!
No need to use the Input Boolean even.

So - what exactly is the change node doing? What is it actually enabling?

They enable and disable the trigger-state node. When the trigger-state node is disabled it doesn’t react to events. So in the example, it only enables the trigger-state node when the current-state node is not reported as home.

1 Like

Brilliant I see the logic, thanks again!