How to display a switch with 3 states in Habpanel (ON/OFF/ not available)

Sorry my fault.

Sound like a job for CSS mabe this thread can help a little.

A setup like followin:

Switch SwitchingItem
Contact StateItem_status
Switch StatusItem_state

But you would still need a rule which starts a timer when SwitchingItem gets an command and waits maybe 0,5 seconds if you receive a SteteItem change do nothing, if not set StatusItem to off.

Then use teh proposed sheme the you can shange the UI of the button with css.

Edit: changed the broken link.
Maybe this thread can give you more insight in the css.
I never did CSS on habpanel. I only use basic UI for now.