How to set device (On/Off) status on UI?

@MCV et al

Anyone knows how to set and display device status (whether it’s currently On or Off)?
My device has the usual On and Off buttons, one of which is supposed to be blue indicated current status.
Currently both On and Off buttons stay green.