Help with template

Hello,

i try to switch on three different kind of lights.
One is working on a 433Mhz switch, one is a zwave light and one is a TP-Link Wifi Light.
The switch is working properly, but how can I get the other ones to work?
I want to trigger all lights after extracting “room” and “onoff” parameter out of a command in dialogflow.

The code for the switch is the following:

TurnLights:
speech:
text: Turning lights in {{ Room }} {{ OnOff }}
action:
- service_template: >
{%- if OnOff == “on” -%}
switch.turn_on
{%- else -%}
switch.turn_off
{%- endif -%}
data_template:
entity_id: “switch.licht_{{Room}} && light.licht_{{Room}}”

How can I turn on a “light” which is not a “switch” with these commands?
Controlling the lights in the interface of home assistant works well.

Thank you

If you want to turn on or off multiple entities that are not in the same “domain” (i.e., switch, light, etc.), use the homeassistant.turn_on or homeassistant.turn_off service instead of the corresponding switch or light services.

Thank you.
Then this is my new code:

TurnLights:
    speech:
      text: Turning lights in {{ Room }} {{ OnOff }}
    action:             
      - service_template: >
          {%- if OnOff == "on" -%}
            homeassistant.turn_on
          {%- else -%}
            homeassistant.turn_off
          {%- endif -%}
        data_template:
          entity_id: >
            {% if Room == "Wohnzimmer" %}
              # switch
              switch.licht_wohnzimmer
            {% elif Room == "Schlafzimmer" %}
              # switch
              switch.licht_schlafzimmer
            {% elif Room == "Badezimmer" %}
              # ZWave
              light.licht_badezimmer
            {% elif Room == "Esszimmer" %}
              # TP-Link
              light.licht_esszimmer
            {% endif %}

But nothing is toggled, not even in the interface.
What am I doing wrong?

Remove the comments in the entity_id template. You can’t comment a template that way.

Ah, that’s it.
Thanks