Alexa and Lights

All my Alexa intents work except the ones where I went off script. This seems to work through the Alexa Dev Console but not through Alexa herself:
ActivateSwitchoffIntent:
action:
service: switch.turn_off
data_template:
entity_id: switch.{{ Switch | replace(" ", “_”) | replace(“light”, “switch”) }}
speech:
type: plain
text: !include alexa_confirm.yaml
I am gussing it has something to do with my entity id line where I added a second replace.

Any ideas?
Thanks,
Dan

You have “open quote” and “close quote” characters instead of double tic characters.
try this:

{{ Switch | replace(" ", "_") | replace("light", "switch")}}

But I would also say, you’re going at this in an overly complex way.
If you want to control switches using Alexa, create a switch slot and give your switches names that relate to their function, not the entity_id.

For example:

If I want to control the kitchen light with a smart-switch.
I create a switch in HA call switch.kitchen_light.
Then in the Alexa skill builder I add a slot called switch of type switches
Then I add a slot value of kitchen light.

1 Like