Can I change the colour of default Blue Top Border based on a State

As the title says, now have a door lock and would like to make the Top Blue Colour Red when Unlocked & Green When locked.

I don’t currently have any themes set.

Thanks, Dave