Alexa using HA's Cloud - is it possible to invoke scripts ("Alexa mute the TV")

Using HA’s cloud service to integrate to alexa - I could expose harmony hub / remote activities via template switches like so:

  - platform: template
switches:
    netflix:
     value_template: "{{ states.remote.harmony.attributes.current_activity == 'TV Netflix' }}"
     turn_on:
       service: script.turn_on
       entity_id: script.harmony_tv_netflix
     turn_off:
       service: script.turn_on
       entity_id: script.harmony_poweroff

With this I can turn-on/off the netflix activity etc.

I wanted to be able to ask alexa to mute the receiver, something that would trigger:

    service: remote.send_command
    data_template:
      command: Mute
      device: 29753204
      entity_id: remote.harmony

Now in the Alexa docs it appears that a custom skill could be customized by adding ‘intents’ (not 100% sure what that exactly means but I think I get the idea).

Intents could be tied to an HA script, and then utterances created to trigger those intents > scripts. Now to do that it seems I need to customize the alexa skill, which in the case of the “HA Cloud service skill” is not an option.

So the question is, is there a way to achieve this or something similar?

Hoping there is a simpler way that doesn’t involve a customized alexa skill for this.

Scripts are exposed to Alexa as scenes. Any scripts that you haven’t filtered will appear there. You can then set up a routine in Alexa that lets you choose the phrase you want. Just be aware it has to be the exact phrase.

Harry Potter fans can now have Alexa turn on lights by saying ‘ lumos kitchen’. Not that I’ve done anything as childish as that :wink:

1 Like

Very smart, this will do. Had no idea scripts get exposed that way (I filter everything by default)
Will expose a couple scripts and create a few routines
Thanks :slight_smile: