Automation with Shelly as Actor/Action

Hi every,
I have a strange behaviour using the automation to light up a shelly 1 switch with automation:
I do have a sensor, and if the sensor is on, I want a shelly to change it’s state to on:

this is the automation I defined:

#automations.yaml
- id: '1575358248051'
  alias: Turn on OnAir when  Pixel Maniacs is Live
  description: ''
  trigger:
  - entity_id: binary_sensor.twitch_pixel_maniacs
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: light.turn_on

My global config looks like this:

...
shelly:
  discovery: true  #add all devices (default)
  sensors:
    - all #show all sensors
  devices:  #configure devices
    - id: "767730"
      light_switch: true  #add this switch as a light
...

The entity_id of the Shelly switch I want to controll is light.shelly_shsw_1_767730

When I add this to the last line of my automation like this:

#automations.yaml
- id: '1575358248051'
  alias: Turn on OnAir when  Pixel Maniacs is Live
  description: ''
  trigger:
  - entity_id: binary_sensor.twitch_pixel_maniacs
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: light.turn_on
    entity_id: light.shelly_shsw_1_767730

hass.io tells me on the main window where all sensors and actors are displayed that the shelly switch is not available?
Any idea what is going wrong at that place?

Thank you so far!
Greets Andi

Do you see “light.shelly_shsw_1_767730” when you go to Developer Tools -> States?

when this happens I do not see it in the Developer Tools -> States

Ok it seems to work, now, do not ask me what I changed, after restarting the system for several times it now works as expected. I do not really know what caused this issue @Burningstone thank you for the help

Update:
This happens on no regular basis, but today after adding new sensors I have the same behaviour that the shelly components are not working

Entity is not available: light.shelly_shsw_XXXX

In the devcenter entity overview i do not see any shelly components

A Shelly 1 is a switch. Are you sure it’s not a switch.shelly_xxxx?

Also, you can rename these in the Entity registry to something that makes sense, like the location of the switch.

When your shelly is ‘unavailable’, it might be that it don’t has a Wifi connection at that time. Can you ping it when it is ‘unavailable’ ?