Trigger on state "unavailble"

I have a few smartbulbs (Shelly) which from time to time goes to state “Unavailable”. Mainly because someone use the “hardswitch” and cut the power.

Are there anyway to create a event which trigger an action each time the specific device change to or from “unavailable”?

If there are any way to use state:unavailble in condition as well, I would be very happy.

trigger:
  - platform: state
    entity_id: light.your_light_here
    to: 'unavailable'
  - platform: state
    entity_id: light.your_light_here
    from: 'unavailable'
condition:
  - condition: state
    entity_id: light.your_light_here
    state: 'unavailable'