Shelly 1 not working as expected

Need help including Shelly 1 relays in Automations. I have 3 lights connected through Shelly 1 relays.
#1 is a regular light and the Shelly is configured as a toggle switch. (friendly name Parkering)
#2 is some low voltage window lights, this Shelly is configured as a toggle switch and is connected the transformer suppling current to the lights. (friendly name Fonsterbelysning)
#3 is connected to my outside lights and configured as a momentary switch. This lighting circuit has 3 push-button switches, so one push on any of the switches to turn on the lights and next push switches them off. (friendly name Outside Lights)
I have included these switches on my Lovelace dashboard and all three can be switched on and off without problems however when I tried to include #2 and #3 in an automation they will not run.
The automation to switch on the lights looks like this:

alias: Ny Solnedgång
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.lallerod_562_orust_solar_rad_lx
    below: 1.1
condition:
  - condition: template
    value_template: >
      {% set sunset = state_attr('sun.sun', 'next_setting')|as_datetime|as_local
      %} {{ sunset - timedelta(hours=1) < now() <= sunset }}
action:
  - service: homeassistant.turn_on
    data: {}
    target:
      entity_id:
        - light.fonsterbelysning
        - switch.parkeringen
        - switch.nisse_socket_1
        - switch.sonoff_1000ac5b30
        - switch.outside_lights
        - switch.v_rumlights_socket
  - service: notify.mobile_app_peter_iphone_11
    data:
      message: >-
        Solnedgång idag är
        {{as_timestamp(state_attr('sun.sun','next_setting'))|timestamp_custom('%H:%M')}}
        och dagsljus värdet är nu
        {{states('sensor.lallerod_562_orust_solar_rad')}} w/m2.  Skickat från
        Auto 1. Tiden är {{ as_timestamp(now()) | timestamp_custom('%H:%M') }}
      data:
        push: null
        sound: US-EN-Morgan-Freeman-Turning-On-The-Lights.wav
mode: single

The automation to turn off the two problematic Shellys looks like this:

alias: Turn off lighting at midnight (Outside and Window lights)
description: ''
trigger:
  - platform: time
    at: '00:00:00'
condition: []
action:
  - service: homeassistant.turn_off
    data: {}
    target:
      entity_id:
        - switch.parkeringen
        - switch.fonsterbelysning
        - switch.outside_lights
mode: single

Looking at the logs for #2 (Fonsterbelysning) and #3 (Outside lights) I notice that these have become unavailable (=otillgänglig) and switched off (=slogs av) I have no explanation why. I have also noticed that to be able to switch off the outside lights after the automation has failed by using the lovelace dashboard switch I need to press twice to actually switch off the light.


I have tried changing the “switch type” on the Shellys buh this does not help, more importantly the Outside light manual switches will only work if Shelly is configured as a momentary switch. It would be great to hear if anyone else has had issues using Shelly 1 relays and if there are any work-arounds.