I want to set the brightness of the toilet light, based on the current time. I think the problem is in the switch-node, because when I cut out the switch-node, everything works just fine.
I could not find any related information topics. Who has a solution for my problem?
[{"id":"cca730ed.d6e4d","type":"comment","z":"393a4b6.bdd58b4","name":"Motion activated toilet light","info":"","x":150,"y":95,"wires":[]},{"id":"8ef37aa0.d8399","type":"server-state-changed","z":"393a4b6.bdd58b4","name":"Motion toilet","server":"18501424.c3841c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.shenzhen_neo_electronics_co_ltd_battery_powered_pir_sensor_v2_sensor_3","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":110,"y":140,"wires":[["18ed3339.0072dd"]]},{"id":"502738d4.8fd8e","type":"api-call-service","z":"393a4b6.bdd58b4","name":"Toilet on","server":"18501424.c3841c","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.08067822c44f3392f7db","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":680,"y":100,"wires":[["843369d7.a83618"]]},{"id":"843369d7.a83618","type":"stoptimer","z":"393a4b6.bdd58b4","duration":"2","units":"Minute","payloadtype":"num","payloadval":"0","name":"2 minuten wachten","x":1120,"y":155,"wires":[["dc5c7bb1.a29e8"],[]]},{"id":"dc5c7bb1.a29e8","type":"api-current-state","z":"393a4b6.bdd58b4","name":"Beweging toilet?","server":"18501424.c3841c","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.shenzhen_neo_electronics_co_ltd_battery_powered_pir_sensor_v2_sensor_3","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1210,"y":215,"wires":[["236edeca.cf3512"],["43d41b43.a12d14"]]},{"id":"236edeca.cf3512","type":"stoptimer","z":"393a4b6.bdd58b4","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"30 seconden wachten","x":1420,"y":155,"wires":[["dc5c7bb1.a29e8"],[]]},{"id":"43d41b43.a12d14","type":"api-call-service","z":"393a4b6.bdd58b4","name":"Toilet off","server":"18501424.c3841c","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.08067822c44f3392f7db","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1420,"y":215,"wires":[[]]},{"id":"c0e698d8.fbe42","type":"switch","z":"393a4b6.bdd58b4","name":"Switch time","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"06:30","vt":"num","v2":"22:15","v2t":"num"},{"t":"btwn","v":"22:16","vt":"num","v2":"06:29","v2t":"num"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":140,"wires":[["502738d4.8fd8e","628da254.9b1b1c"],["63da43ab.f2889c","628da254.9b1b1c"]]},{"id":"18ed3339.0072dd","type":"api-current-state","z":"393a4b6.bdd58b4","name":"What time is it?","server":"18501424.c3841c","version":1,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.time","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":380,"y":60,"wires":[["c0e698d8.fbe42"]]},{"id":"63da43ab.f2889c","type":"api-call-service","z":"393a4b6.bdd58b4","name":"Toilet on","server":"18501424.c3841c","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.08067822c44f3392f7db","data":"{\"brightness_pct\":\"30\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":680,"y":160,"wires":[["843369d7.a83618"]]},{"id":"628da254.9b1b1c","type":"debug","z":"393a4b6.bdd58b4","name":"Output tijd","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":280,"wires":[]},{"id":"3c31bee3.bb59c2","type":"inject","z":"393a4b6.bdd58b4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"msg","x":130,"y":260,"wires":[["18ed3339.0072dd"]]},{"id":"18501424.c3841c","type":"server","z":"","name":"Home Assistant","addon":true}]