Light go on or off below an certain brightness level

hello, i'm trying to get an flow working. but just don't know how, and tried a lot to get it working.

I have an zigbee light dimmer in the bathroom, when showering or have a bath the flow does'nt have to do anything. The flow only have to start when the toilet is used. i want to reach this by using the zigbee dimmer above a brightness level and the flow won't start. and when its below the brightness it will start.

who can help me.

[{"id":"932fc630ab6db95b","type":"inject","z":"24aaf87c7c99fa4c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":70,"y":200,"wires":[["c86f745b4d555a37"]]},{"id":"14b92f7f2e92014b","type":"inject","z":"24aaf87c7c99fa4c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":70,"y":240,"wires":[["c86f745b4d555a37"]]},{"id":"c86f745b4d555a37","type":"time-range-switch","z":"24aaf87c7c99fa4c","name":"","lat":"53.13405","lon":"6.56995","startTime":"goldenHour","endTime":"sunrise","startOffset":0,"endOffset":0,"x":180,"y":280,"wires":[["4634dc49ebe82598","fb702f5ef8323397"],[]]},{"id":"bf61ce35077eeb7e","type":"server-state-changed","z":"24aaf87c7c99fa4c","name":"bathroom motion","server":"9b99f28.437031","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.bewegingsensor_badkamer","entityidfiltertype":"substring","outputinitially":false,"state_type":"habool","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","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":100,"y":460,"wires":[["c86f745b4d555a37"],["c86f745b4d555a37"]]},{"id":"fb702f5ef8323397","type":"change","z":"24aaf87c7c99fa4c","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":340,"wires":[["692e2fb15beba7bd"]]},{"id":"4634dc49ebe82598","type":"api-current-state","z":"24aaf87c7c99fa4c","name":"current state below the brightness level, light on.","server":"9b99f28.437031","version":3,"outputs":2,"halt_if":"{\"brightness\":[20]}","halt_if_type":"jsonata","halt_if_compare":"lt","entity_id":"light.badkamer","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":640,"y":280,"wires":[["4688893d38f24c92"],[]]},{"id":"692e2fb15beba7bd","type":"api-current-state","z":"24aaf87c7c99fa4c","name":"current state below the brightness level, light off.","server":"9b99f28.437031","version":3,"outputs":2,"halt_if":"{\"brightness\":[60]}","halt_if_type":"jsonata","halt_if_compare":"lt","entity_id":"light.badkamer","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":740,"y":380,"wires":[[],["a4d3c3d3b90a95da"]]},{"id":"a4d3c3d3b90a95da","type":"delay","z":"24aaf87c7c99fa4c","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1040,"y":320,"wires":[["9da2ef218b8a8860"]]},{"id":"9da2ef218b8a8860","type":"api-call-service","z":"24aaf87c7c99fa4c","name":"","server":"9b99f28.437031","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.badkamer"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"brightness_pct","propertyType":"msg","value":"35","valueType":"str"}],"queue":"none","x":1190,"y":300,"wires":[["8e5fcf27c4299107"]]},{"id":"4688893d38f24c92","type":"api-call-service","z":"24aaf87c7c99fa4c","name":"","server":"9b99f28.437031","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.badkamer"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1190,"y":220,"wires":[["8e5fcf27c4299107"]]},{"id":"8e5fcf27c4299107","type":"debug","z":"24aaf87c7c99fa4c","name":"","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1350,"y":300,"wires":[]},{"id":"9b99f28.437031","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]

Some of those nodes look like Home-Assistant nodes. You might get a response if you ask on the HA forum as not many people here use HA.

It might help if you inserted some 'debug' nodes so you could determine where things are not working.