Amazon Echo Dot to Trigger Script Running

Hi! all,

I’m new to Home Assistant. I managed to add Yeelight and Broadlink RM Pro as light and switch. With Emulated_Hue, I am able to use Amazon Echo Dot to control my Yeelight and send single command via Broadlink RM Pro.

Next, I would like to send a combo infrared command for switching TV channel which consists of two infrared commands separated by a delay of 0.5 seconds. I plan to do it through script.

Here’s the problem I am facing. So far, I have no success in triggering the script by Amazon Echo Dot. I can use the following command to control my Yeelight:

“Alexa, turn on living room light”

However, when I try :

“Alexa, turn on back office light”

Echo Dot returns :"sorry, I couldn;t find a device or group named “back office light”.

Can anyone help me figure out what goes wrong and how I can use Amazon Echo Dot to control scripts? :pray:

In the script test, I used my Yeelight light for a more visible result and the relevant configuration section is like here:

  customize:
    script.ceiling_light:
      emulated_hue: true
      emulated_hue_name: "back office light" 
emulated_hue:
  exposed_domains:
    - light
    - script
    - switch
script:
  ceiling_light:
    alias: "Ceiling Light"
    sequence:
    # This is written using the Script Syntax
      - service: light.toggle
        entity_id: light.living_room_light
      - delay:
          seconds: 5
      - service: light.toggle
        entity_id: light.living_room_light

The output of http://:8300/api/pi/lights looks like this:
> {"light.living_room_light": {"modelid": "HASS123", "name": "Living Room Light", "state": {"bri": 255, "on": true, "reachable": true}, "swversion": "123", "type": "Dimmable light", "uniqueid": "light.living_room_light"}, "script.ceiling_light": {"modelid": "HASS123", "name": "back office light", "state": {"bri": 0, "on": false, "reachable": true}, "swversion": "123", "type": "Dimmable light", "uniqueid": "script.ceiling_light"}

did you check the alexa app? Are the names spelled correctly?

@anon35356645
As the command called local devices, it didn’t show up in the Alexa app.

mmhhh I don’t get it entirely. After you do DISCOVERY DEVICES in the Alexa app, it should come the names of the SCRIPT “Back Office Light”, as a Wemo switch if I remember correctl.

Or maybe it comes as “Ceiling Light” and does not get the customization name?

@anon35356645. Your reply inspired me to try discovering devices again. At first, it didn’t work out. Strange enough, after I deleted all options and leave only the line “emulated hue:”, all emulated lights and switches including the script showed up. It worked now! Many thanks!

might be a bug, when you have 2 names (inside the script and in customize). I got a similar issues in the past, so now I try to put the names only in one place, and avoid using the customize for the names, if possible

you have a Hue hub? Or just the Xiaomi?

I do have a phisical Hue hub and lights, so in my emulated_hue I put only script and switch (the light part is discovered by HA discovery service.) Better do not mix HUE and emulated_hue.

I would take out the light in the emulated_hue.

Your xhiaomi light is a script not a light

I don’t have a Hue hub. I use emulated hue to control the Xiaomi light and I worked like a charm. Now that I think I can try using script to achieve something more complex. :smile: