Available entity

Hi i would like to trigger an automation when an light becomes online
specifically a light is switched on at the mains (not by smart /hassio)
i can find lots about atomations when a sensor goes offline but not for going online
i have tried all sorts off settings from device, to state, to numeric state, using On, Off, Unavailavble Available, Online, Offline but just cant find a setting that works

There are many light platforms, so without extra information an answer is impossible.

What is the state ( developer tools ->state) when the light is switched off at the mains ?
What is the state if the light is switched on again ?

It goes from unavailable to on

So something like this :

- id: '1589698429560'
  alias: Light from unavailabe to on
  description: ''
  - entity_id: light.yourlight
    platform: state
    from: 'unavailable'
    to: 'on'
  condition: []

Still something not right. I know the acton is correct as it functions when i press execute.
I would note the the inverted commas dont remain when i go from edit in ui to edit in yaml view.