Cant say thanks enough for the support! Really good community here
Ive ended up with this so far. So regardless of any system reboots the date and time will always be correct and only alert me 3 days later, if someone is at home between 4-7pm. The alert will trigger every 30min until i hit the button, creating a updates timestamp which puts it 3 days later again.
[{"id":"b95b265a.908868","type":"api-current-state","z":"bfb78147.85536","name":"","server":"9109b9bf.04e218","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_datetime.water_plants","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":370,"y":680,"wires":[["37e8b62.5c2314a"]]},{"id":"8d3a8516.8dc9b8","type":"inject","z":"bfb78147.85536","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":680,"wires":[["b95b265a.908868"]]},{"id":"7d1aefd3.6ecd2","type":"time-range-switch","z":"bfb78147.85536","name":"","lat":"","lon":"","startTime":"15:00","endTime":"20:00","startOffset":0,"endOffset":0,"x":790,"y":680,"wires":[["2fa0f65b.19993a"],[]]},{"id":"22f8a2ca.ad7a7e","type":"alexa-remote-routine","z":"bfb78147.85536","name":"","account":"9433d58f.c0d298","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"str","value":"Litter Tray needs cleaning"},"devices":["G090P308745508M3","G070RQ1080260CHE"]}},"x":1420,"y":700,"wires":[[]]},{"id":"37e8b62.5c2314a","type":"function","z":"bfb78147.85536","name":"check time","func":"\nif(!msg.payload){\n node.warn(\"msg.payload is empty - not gonna do anything - returning null to stop the msg from travelling to next node!\")\n return null;// stop processing - payload is empty\n}\n\n//some basic setup...\nmsg._72h = 72*60*60*1000; //calculate 72h as a number of ms\nlet time72hoursAgo = Date.now() - msg._72h;//get epoch of 72h ago\nmsg.time72hoursAgo = new Date(time72hoursAgo);//Add time72hoursAgo to the msg (for easy debugging)\nmsg.now = new Date(); //get now time (and add it to the msg for easy debugging)\nmsg.last_event = new Date(msg.payload);//get last_event as a Date object (and add it to the msg for easy debugging)\nmsg.diff = msg.now - msg.last_event; //calculate difference\n\n//now check see if diffeence is greater or equal to 72h\nif(msg.diff >= msg._72h){\n msg.info = \"its time to do something\"\n msg.payload = true;\n} else { \n msg.info = \"not time yet\";\n msg.payload = false;\n //return null;// optionally - just stop processing by returning null\n}\n\n//return a msg so it flows to next node\nreturn msg;","outputs":1,"noerr":0,"x":630,"y":680,"wires":[["7d1aefd3.6ecd2"]]},{"id":"2fa0f65b.19993a","type":"api-current-state","z":"bfb78147.85536","name":"","server":"9109b9bf.04e218","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"person.tom","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":1050,"y":660,"wires":[["22f8a2ca.ad7a7e"],["8bf90602.fa20c8"]]},{"id":"8bf90602.fa20c8","type":"api-current-state","z":"bfb78147.85536","name":"","server":"9109b9bf.04e218","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"person.lolo","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1050,"y":740,"wires":[["22f8a2ca.ad7a7e"],[]]},{"id":"9109b9bf.04e218","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true},{"id":"9433d58f.c0d298","type":"alexa-remote-account","z":"","name":"alexatts","authMethod":"proxy","proxyOwnIp":"192.168.0.8","proxyPort":"3456","cookieFile":"authFile","refreshInterval":"3","alexaServiceHost":"alexa.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","userAgent":"","useWsMqtt":"on","autoInit":"on"}]