Something like this should get you going…
[{"id":"4bac02e1.35134c","type":"tab","label":"Flow 10","disabled":false,"info":""},{"id":"abad2e2a.2cf0b","type":"inject","z":"4bac02e1.35134c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":550,"y":330,"wires":[["bd4e10ba.e14aa"]]},{"id":"bd4e10ba.e14aa","type":"switch","z":"4bac02e1.35134c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":400,"wires":[["1fbdc613.9e29ea","7df1dbe.0b60f24"],["a5af65a6.257038"]]},{"id":"1fbdc613.9e29ea","type":"stoptimer","z":"4bac02e1.35134c","duration":"3","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":740,"y":280,"wires":[["2a7bb511.e5e9ca"],[]]},{"id":"2a7bb511.e5e9ca","type":"api-current-state","z":"4bac02e1.35134c","name":"Motion Still On?","server":"663af70e.88b558","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"binary_sensor.wyzesense_bathmotion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":760,"y":350,"wires":[["5d3164d2.90e90c"],["1fbdc613.9e29ea"]]},{"id":"5d3164d2.90e90c","type":"api-call-service","z":"4bac02e1.35134c","name":"turn bath fan on","server":"663af70e.88b558","version":1,"debugenabled":false,"service_domain":"fan","service":"turn_on","entityId":"fan.bathroom","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1000,"y":320,"wires":[[]]},{"id":"a5af65a6.257038","type":"stoptimer","z":"4bac02e1.35134c","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":740,"y":470,"wires":[["cad446fa.290ae8"],[]]},{"id":"138297d7.2652e8","type":"api-call-service","z":"4bac02e1.35134c","name":"turn light off","server":"663af70e.88b558","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.bath","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1120,"y":460,"wires":[[]]},{"id":"cad446fa.290ae8","type":"api-current-state","z":"4bac02e1.35134c","name":"Motion Still On?","server":"663af70e.88b558","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"binary_sensor.wyzesense_bathmotion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":920,"y":460,"wires":[["a5af65a6.257038"],["138297d7.2652e8","3fbcf22d.53f84e"]]},{"id":"7df1dbe.0b60f24","type":"api-current-state","z":"4bac02e1.35134c","name":"Allready on?","server":"663af70e.88b558","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"light.bath","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":754.5078125,"y":402.5234375,"wires":[[],["2e2a21c7.140dde"]]},{"id":"2e2a21c7.140dde","type":"api-call-service","z":"4bac02e1.35134c","name":"turn bath light on","server":"663af70e.88b558","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bath","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1010,"y":380,"wires":[[]]},{"id":"3fbcf22d.53f84e","type":"api-call-service","z":"4bac02e1.35134c","name":"turn bath fan off","server":"663af70e.88b558","version":1,"debugenabled":false,"service_domain":"fan","service":"turn_off","entityId":"fan.bathroom","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1150,"y":520,"wires":[[]]},{"id":"663af70e.88b558","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
It isnt perfect. the 3min timer will remain looping if it doesnt get to 3 mins… ways around it, but it should help you get going.
Personally. mine is always getting little fixes, and to be honest, its a mess but it works.
What helps mostly is having a door sensor. if you are showering and lights turn off… not fun.
or a guest is standing/sitting real still using the toliet lights turn off… no fun
Alot going on:
motion sensor. door sensor, a second door sensor on toliet, and a oil diffuser when the toliet flushes…: