For those interested I’ve sort of solved this through using NodeRed as docker on my unraid server (not within Home Assistant).
My flow is outlined below, but basically I’m creating new entities for my light sensors which don’t update when the lights are on or for five minutes after they turn off and which take the lowest of the last three values seen.
[{"id":"9f3a4518.cbaef8","type":"tab","label":"Hallway light sensor","disabled":false,"info":""},{"id":"432f14d9.e5ec2c","type":"hue-group","z":"9f3a4518.cbaef8","name":"Hallway On","bridge":"ec3a3897.9d15f8","groupid":"4","colornamer":true,"skipevents":false,"x":110,"y":80,"wires":[["3c6b397f.e70676"]]},{"id":"3c6b397f.e70676","type":"change","z":"9f3a4518.cbaef8","name":"Set payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.on","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":80,"wires":[["70043c68.2193a4"]]},{"id":"70043c68.2193a4","type":"switch","z":"9f3a4518.cbaef8","name":"If \"on\" continue","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":80,"wires":[["d4dfca4e.5a4588","195f4963.e40497"]]},{"id":"d4dfca4e.5a4588","type":"change","z":"9f3a4518.cbaef8","name":"Stop lux values updating","rules":[{"t":"set","p":"update_lux","pt":"flow","to":"no","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"no","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":80,"wires":[["694b4ba8.757a74"]]},{"id":"8c1271e.840de9","type":"hue-group","z":"9f3a4518.cbaef8","name":"Hallway Off","bridge":"ec3a3897.9d15f8","groupid":"4","colornamer":true,"skipevents":false,"x":110,"y":220,"wires":[["7859c2e6.ef5e8c"]]},{"id":"a1033e8f.8ce55","type":"change","z":"9f3a4518.cbaef8","name":"Allow lux values to update","rules":[{"t":"set","p":"update_lux","pt":"flow","to":"yes","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"yes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":220,"wires":[["e0763e7c.76d52"]]},{"id":"6809b6e9.cb8058","type":"trigger","z":"9f3a4518.cbaef8","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"5","extend":false,"units":"min","reset":"reset","bytopic":"all","name":"5 min delay","x":650,"y":220,"wires":[["a1033e8f.8ce55"]]},{"id":"195f4963.e40497","type":"change","z":"9f3a4518.cbaef8","name":"Stop timer","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":140,"wires":[["6809b6e9.cb8058"]]},{"id":"b119bb67.1e9f88","type":"smooth","z":"9f3a4518.cbaef8","name":"min of last 3 payloads","property":"payload","action":"min","count":"3","round":"","mult":"single","reduce":false,"x":1120,"y":320,"wires":[["131f4a88.14a955"]]},{"id":"b57e8f29.a4be7","type":"change","z":"9f3a4518.cbaef8","name":"store value","rules":[{"t":"set","p":"inter_hallaverage1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":320,"wires":[["fe25bf67.f0033"]]},{"id":"fe25bf67.f0033","type":"switch","z":"9f3a4518.cbaef8","name":"update?","property":"update_lux","propertyType":"flow","rules":[{"t":"eq","v":"yes","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":320,"wires":[["b0c13ca9.415b"]]},{"id":"b0c13ca9.415b","type":"change","z":"9f3a4518.cbaef8","name":"Payload back to variable","rules":[{"t":"set","p":"payload","pt":"msg","to":"inter_hallaverage1","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":320,"wires":[["b119bb67.1e9f88"]]},{"id":"131f4a88.14a955","type":"change","z":"9f3a4518.cbaef8","name":"store final value","rules":[{"t":"set","p":"hallaverage1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":320,"wires":[["67a20cdb.4e34c4"]]},{"id":"8d470947.cab548","type":"debug","z":"9f3a4518.cbaef8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1710,"y":320,"wires":[]},{"id":"e0763e7c.76d52","type":"debug","z":"9f3a4518.cbaef8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1100,"y":220,"wires":[]},{"id":"694b4ba8.757a74","type":"debug","z":"9f3a4518.cbaef8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":860,"y":80,"wires":[]},{"id":"7859c2e6.ef5e8c","type":"change","z":"9f3a4518.cbaef8","name":"Set payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.on","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":220,"wires":[["3d5e9a4b.443fd6"]]},{"id":"3d5e9a4b.443fd6","type":"switch","z":"9f3a4518.cbaef8","name":"If \"off\" continue","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"false","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":1,"x":460,"y":220,"wires":[["6809b6e9.cb8058"]]},{"id":"67a20cdb.4e34c4","type":"ha-entity","z":"9f3a4518.cbaef8","name":"Hall lux 1","server":"d808cedb.07b0f","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"hall_lux_1"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:weather-sunny"},{"property":"unit_of_measurement","value":"lx"}],"state":"hallaverage1","stateType":"flow","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1520,"y":320,"wires":[["8d470947.cab548"]]},{"id":"ff7489.bb3cab78","type":"poll-state","z":"9f3a4518.cbaef8","name":"Hallway sensor 1","server":"d808cedb.07b0f","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.hue_motion_sensor_1_light_level","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":120,"y":320,"wires":[["d66a9de3.4bccf"]]},{"id":"d66a9de3.4bccf","type":"change","z":"9f3a4518.cbaef8","name":"convert","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":320,"wires":[["b57e8f29.a4be7"]]},{"id":"c3b59aa1.8b0b08","type":"smooth","z":"9f3a4518.cbaef8","name":"min of last 3 payloads","property":"payload","action":"min","count":"3","round":"","mult":"single","reduce":false,"x":1120,"y":380,"wires":[["7aa54ff5.39d83"]]},{"id":"30a2c600.a5e6ea","type":"change","z":"9f3a4518.cbaef8","name":"Payload back to variable","rules":[{"t":"set","p":"payload","pt":"msg","to":"inter_hallaverage2","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":380,"wires":[["c3b59aa1.8b0b08"]]},{"id":"a2616ca3.4a338","type":"switch","z":"9f3a4518.cbaef8","name":"update?","property":"update_lux","propertyType":"flow","rules":[{"t":"eq","v":"yes","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":380,"wires":[["30a2c600.a5e6ea"]]},{"id":"8b2bc634.452078","type":"change","z":"9f3a4518.cbaef8","name":"store value","rules":[{"t":"set","p":"inter_hallaverage2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":380,"wires":[["a2616ca3.4a338"]]},{"id":"ba21ef27.1c807","type":"change","z":"9f3a4518.cbaef8","name":"convert","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":380,"wires":[["8b2bc634.452078"]]},{"id":"451bd4e8.deaecc","type":"poll-state","z":"9f3a4518.cbaef8","name":"Hallway sensor 2","server":"d808cedb.07b0f","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.hue_motion_sensor_1_light_level_2","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":120,"y":380,"wires":[["ba21ef27.1c807"]]},{"id":"7aa54ff5.39d83","type":"change","z":"9f3a4518.cbaef8","name":"store final value","rules":[{"t":"set","p":"hallaverage2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":380,"wires":[["86427565.a86538"]]},{"id":"86427565.a86538","type":"ha-entity","z":"9f3a4518.cbaef8","name":"Hall lux 2","server":"d808cedb.07b0f","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"hall_lux_2"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:weather-sunny"},{"property":"unit_of_measurement","value":"lx"}],"state":"hallaverage2","stateType":"flow","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1520,"y":380,"wires":[["33e1179e.d8c598"]]},{"id":"33e1179e.d8c598","type":"debug","z":"9f3a4518.cbaef8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1710,"y":380,"wires":[]},{"id":"ec3a3897.9d15f8","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.1.145","key":"V6XJR6dUwhZLLvnsWICcftVtKvExPDQRP6fB70Ma","interval":"3000","disableupdates":false},{"id":"d808cedb.07b0f","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]