Loght switches spontaneously - should react to automation

Please check code below.
Sometimes the light switches spontaneously. I don’t have other automations running.
Vitrinenekast should switch together with light studeerkamer
(Although I use the backtics, the code doen’t format , sorry for that’

‘’’

  • id: ‘1574453802729’
    alias: Vitrine kast aan als ook licht studeerkamer aan gaat
    description:’’
    trigger:
    • entity_id: light.studeerkamer
      from: ‘off’
      platform: state
      to: ‘on’
      condition: []
      action:
    • alias:’’
      data: {}
      service: light.turn_on
      entity_id: light.newkaku_02d1d800_2
  • id: ‘vitrinekast_uit’
    alias: Vitrine kast aan als ook licht studeerkamer aan gaat
    description:
    trigger:
    • entity_id: light.studeerkamer
      from: ‘on’
      platform: state
      to: ‘off’
      condition: []
      action:
    • alias: ‘’
      data: {}
      service: light.turn_off
      entity_id: light.newkaku_02d1d800_2

Please format your code as explained in the guide. Without you doing that it’s not possible for people to help you.

The ticks you used, they’re not backticks :wink:

Try this :

- id: '1574453802729'
  alias: Vitrine kast aan als ook licht studeerkamer aan gaat
  trigger:
    entity_id: light.studeerkamer
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      entity_id: light.newkaku_02d1d800_2
    service: light.turn_on

- id: 'vitrinekast_uit'
  alias: Vitrine kast aan als ook licht studeerkamer aan gaat
  trigger:
    entity_id: light.studeerkamer
    platform: state
    to: 'off'
  condition: []
  action:
  - data: 
      entity_id: light.newkaku_02d1d800_2
    service: light.turn_off