Motion Time Brightness

When motion detected, turn on a light to half brightness during 1AM and 6AM and full brightness during any other time - using Home Assistant and Node-RED.

Requirements

Node-RED

[{"id":"b92e7625.ce1b78","type":"time-range-switch","z":"9afdaf1d.9b88f","name":"1AM - 6AM","lat":"","lon":"","startTime":"01:00","endTime":"06:00","startOffset":0,"endOffset":0,"x":280,"y":659,"wires":[["e11e681c.0ef608"],["8b92af8d.ffa1f"]]},{"id":"2d980e09.afa542","type":"server-state-changed","z":"9afdaf1d.9b88f","name":"Motion Detected","server":"a77b5e9d.0c69","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.bathroom_motion","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,"x":100,"y":660,"wires":[["b92e7625.ce1b78"],[]]},{"id":"8b92af8d.ffa1f","type":"api-call-service","z":"9afdaf1d.9b88f","name":"Turn on light at 100% brightness","server":"a77b5e9d.0c69","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":530,"y":684,"wires":[[]]},{"id":"e11e681c.0ef608","type":"api-call-service","z":"9afdaf1d.9b88f","name":"Turn on light at 50% brightness","server":"a77b5e9d.0c69","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom","data":"{\"brightness_pct\":\"50\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":520,"y":634,"wires":[[]]},{"id":"a77b5e9d.0c69","type":"server","z":"","name":"Home Assistant","addon":true}]
Node-RED Flow

Copy the above, import into Node-RED, configure the nodes, and deploy the workflow.