How to use toothbrush state as a trigger for night and morning automations

I currently have a motion detector that switches between overhead bedroom lights to under-bed accent nightlights at specific times of day, but somedays i sleep in or stay up later and would like my toothbrush to change between those automations instead of time of day, how can i do this… Thanks!

Not clear how your automation works if it uses motion detector and times of day - could we see the code?

At a guess I’d say simply replace the trigger in your automation with the toothbrush state changing to “on” or “running” or whatever it is.