Automation - variables for entity-id error

Based on the following yaml code, I get a “Template rendered invalid entity IDs:” what is wrong?

alias: Test June 25
description: ""
triggers:
  - trigger: state
    entity_id:
      - light.ug_keller
conditions: []
actions:
  - variables:
      my_var: light.ug_buro
  - sequence:
      - action: light.toggle
        target:
          entity_id: "{{my_var}}"
        data: {}
mode: single

This code, with ug_keller and ug_buro replaced with entities that I have, works as expected on my system.

Are you sure light.ug_buro exists on your system? Where and when are you seeing the error?

yes, the entities are right.

I always testing (Run Action) each action, one-by-one.

But it doesn’t works with variables in a sequence. You can just select on sequence level “Run Action” otherwise the previously defined variables will not initialised.

As second option you define the (global)-variables on the top of Actions. But in this case, you cannot testing (Run Action) the lower actions one-by-one. The only one solution for testing will be the trigger initialisation.