Ah sorry not sure why the code did not come through in the flow. Hopefully this one has it all.
I think this seems to be working. I recreated manually what you did rather than import as i think something odd happened when it imported the flow. I also changed the off section to the off connection on the PIR @craigcurtin it might just have been that and thank you for the nudge in the right direction.
I need to do some testing. When the Good-Bye-Good-Night is on the light is switching off after 30 seconds. which i think you said was the 20 seconds delay and 10 seconds from the PIR blind time. 30 Seconds is more than fine.
I will do more testing today and will report back but from the test i just did its working as i wanted it. Thank you everyone who has commented and @obaldius for really taking the time , i really appreciate it.
Apart from getting it fixed (pending more testing) the main thing is i have learnt something along the way and thats the best bit.
[{"id":"755794255d420f60","type":"group","z":"f8c6eedc9d47547b","name":"Turn Dining Room Light - On - Off - If Alseep or away from home only turn on for 10 seconds","style":{"label":true},"nodes":["50db2ff5b9ceefb5","e67d52df87772633","0c0294a0fc27efc3","b8739c73e00df36a","5319acc36a3a3156","f21381b0771e5f53","a640af87ab430a68","ccacd9e96f0322ca","4f2d4c55caa106b6","48ce0428cf5f1867","6b33770ff8e373d0","fcdb85dd19314c17"],"x":14,"y":1499,"w":1372,"h":242},{"id":"50db2ff5b9ceefb5","type":"server-state-changed","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Dining Room PIR","server":"da3b2d1e.ad751","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.mqtt_sensor_samsung_dining_room_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":120,"y":1560,"wires":[["0c0294a0fc27efc3"],["ccacd9e96f0322ca"]]},{"id":"e67d52df87772633","type":"api-call-service","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Turn on Dining Room Light - Full","server":"da3b2d1e.ad751","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.mqtt_bulb_phillips_dining_room_main"],"data":"{\"brightness\":255,\"rgb_color\":[255,255,255]}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1190,"y":1560,"wires":[[]]},{"id":"0c0294a0fc27efc3","type":"api-current-state","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Light Level","server":"7e20b797.b28178","version":3,"outputs":2,"halt_if":"2000","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.mqtt_sensor_samsung_dining_room_illuminance_lux","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":330,"y":1560,"wires":[["b8739c73e00df36a"],[]]},{"id":"b8739c73e00df36a","type":"api-current-state","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Good-Bye-Good-Night","server":"7e20b797.b28178","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.good_night_good_bye","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":570,"y":1560,"wires":[["a640af87ab430a68"],["5319acc36a3a3156"]]},{"id":"5319acc36a3a3156","type":"within-time-switch","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"","nameInt":"","positionConfig":"b954ab15.fd5738","startTime":"07:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"23:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":810,"y":1620,"wires":[["e67d52df87772633"],["f21381b0771e5f53"]]},{"id":"f21381b0771e5f53","type":"api-call-service","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Turn on Dining Room Light - Dimmed","server":"da3b2d1e.ad751","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.mqtt_bulb_phillips_dining_room_main"],"data":"{\"brightness\":5,\"rgb_color\":[255,255,255]}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":1620,"wires":[[]]},{"id":"a640af87ab430a68","type":"api-call-service","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Turn on Dining Room Light - Dimmed","server":"da3b2d1e.ad751","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.mqtt_bulb_phillips_dining_room_main"],"data":"{\"brightness\":2,\"rgb_color\":[255,255,255]}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":1540,"wires":[[]]},{"id":"ccacd9e96f0322ca","type":"api-current-state","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Good-Bye-Good-Night","server":"7e20b797.b28178","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.good_night_good_bye","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":330,"y":1660,"wires":[["4f2d4c55caa106b6"],["48ce0428cf5f1867"]]},{"id":"4f2d4c55caa106b6","type":"change","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"20 sec","rules":[{"t":"set","p":"delay","pt":"msg","to":"20000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":1640,"wires":[["6b33770ff8e373d0"]]},{"id":"48ce0428cf5f1867","type":"change","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"5 min","rules":[{"t":"set","p":"delay","pt":"msg","to":"300000","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":1700,"wires":[["6b33770ff8e373d0"]]},{"id":"6b33770ff8e373d0","type":"trigger","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"5","extend":false,"overrideDelay":true,"units":"min","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":670,"y":1680,"wires":[["fcdb85dd19314c17"]]},{"id":"fcdb85dd19314c17","type":"api-call-service","z":"f8c6eedc9d47547b","g":"755794255d420f60","name":"Turn off Dining Room Light","server":"da3b2d1e.ad751","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.mqtt_bulb_phillips_dining_room_main"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":1680,"wires":[[]]},{"id":"da3b2d1e.ad751","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"7e20b797.b28178","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"b954ab15.fd5738","type":"position-config","name":"","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""}]