A first attempt. I'm pretty sure it can be done much more elegantly!
This sets a variable to indicate if it's after 22:30 (and before 06:30)
Another variable to define if the normal or late night routine is appropriate.
[{"id":"63984354.c2adcc","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"9c6a3ba5.7f7cc8","type":"inject","z":"63984354.c2adcc","name":"22:30","props":[{"p":"payload"}],"repeat":"","crontab":"30 22 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"NIGHT","payloadType":"str","x":120,"y":80,"wires":[["7e567988.1c79f"]]},{"id":"7e567988.1c79f","type":"trigger","z":"63984354.c2adcc","name":"","op1":"","op2":"DAY","op1type":"pay","op2type":"str","duration":"8","extend":false,"overrideDelay":false,"units":"hr","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":300,"y":80,"wires":[["c2a52afa.382ca8"]]},{"id":"c2a52afa.382ca8","type":"change","z":"63984354.c2adcc","name":"","rules":[{"t":"set","p":"nighttime","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":80,"wires":[["f27fc35e.e7d728"]]},{"id":"81f4fb9e.0d802","type":"comment","z":"63984354.c2adcc","name":"Set flow.nighttime to NIGHT at 22:30 and DAY at 06:30","info":"","x":250,"y":40,"wires":[]},{"id":"1fbc230b.9c9b7d","type":"mqtt in","z":"63984354.c2adcc","name":"Phone location input","topic":"","qos":"2","datatype":"auto","broker":"b297f812.f52a8","nl":false,"rap":true,"rh":0,"x":130,"y":220,"wires":[["2511b89c.dc5a4"]]},{"id":"2511b89c.dc5a4","type":"function","z":"63984354.c2adcc","name":"Set normal or latenight routine","func":"if (msg.location == \"home\" && flow.get('nighttime') == \"DAY\") // or however you tell the location. //arrived home during daytime\n{\n flow.set('routine', \"NORMAL\");\n}\n\nif (msg.location != \"home\" && flow.get('nighttime') == \"NIGHT\" && flow.get('routine') != \"NORMAL\") // did not get home during daytime\n{\n flow.set('routine', \"LATENIGHT\");\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":220,"wires":[[]]},{"id":"fac6f848.e71c","type":"switch","z":"63984354.c2adcc","name":"Normal or Latenight?","property":"routine","propertyType":"flow","rules":[{"t":"eq","v":"NORMAL","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":580,"y":340,"wires":[["fc9615f4.74b08"],["a55b8528.0a5a4"]]},{"id":"fc9615f4.74b08","type":"function","z":"63984354.c2adcc","name":"Normal nighttime routine","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":320,"wires":[[]]},{"id":"a55b8528.0a5a4","type":"function","z":"63984354.c2adcc","name":"Late night routine","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":360,"wires":[[]]},{"id":"f27fc35e.e7d728","type":"switch","z":"63984354.c2adcc","name":"Only at 06:30","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"DAY","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":120,"wires":[["5cd84e36.29e9e8"]]},{"id":"5cd84e36.29e9e8","type":"change","z":"63984354.c2adcc","name":"Reset flow.routine","rules":[{"t":"set","p":"routine","pt":"flow","to":"LATENIGHT","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":120,"wires":[[]]},{"id":"e1dd78a.4832488","type":"comment","z":"63984354.c2adcc","name":"Process phone location data","info":"","x":160,"y":180,"wires":[]},{"id":"dc9d3bea.96b4b8","type":"inject","z":"63984354.c2adcc","name":"Repeat as required","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":340,"wires":[["5d3e448e.d720a4"]]},{"id":"5d3e448e.d720a4","type":"switch","z":"63984354.c2adcc","name":"Is it nighttime?","property":"nighttime","propertyType":"flow","rules":[{"t":"eq","v":"NIGHT","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":360,"y":340,"wires":[["fac6f848.e71c"]]},{"id":"4eee9531.57611c","type":"comment","z":"63984354.c2adcc","name":"However you trigger night time switching etc","info":"","x":210,"y":300,"wires":[]},{"id":"b297f812.f52a8","type":"mqtt-broker","name":"MQTT 192.168.1.11","broker":"192.168.1.11","port":"1883","clientid":"","usetls":false,"compatmode":false,"protocolVersion":4,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]