Create a virtual Dimmer or light template for Alexa

Hi @lonebaggie
Would it be possible for you to detail how this integrates in the Alexa app ?

Currently, I use the alexa-local node wich is very unstable for me.
In the alexa app I use for creating routines (on adroid), I only see my hue lights and (sometimes) the lights I have created with alexa-local.

If I understand correctly, creating a light template should make the entity discoverable by Alexa ?

I use dummy bulb for triggering event in HA see the following

basically create a routine in the alexa app to change the dummy bulb brightness . Then use the brightness level in ha to trigger anything you want . One bulb 100 different triggers

This … this is so much more clever than what I’m currently doing !
I understand the basic idea, and will read the post you linked carefully.

The question for me is to figure out how to make alexa discover this dummy bulb.

the light template is just a light created in HA .

Dont use alexa-local-node ? node-red ? . I use alexa cloud and before that emulated hue in HA worked fine. Emulated hue will present the bulb to alexa without any problems

Ok so … this very new for me so please excuse my ignorance. If I understand, I should:

_#configuration.yaml_
emulated_hue:
  • Add lights like so:
emulated_hue:
  entities:
    light.bedroom_light:
      name: "Bedside Lamp"
  • Then discover the light with Alexa ?

For now I’ve done the first two steps, but the light doesn’t show up in HA nor anywhere else. If the method is correct, I’ll dig more into it.

Thanks for your help !

Create a light template

- platform: template
    lights:
      alexa_virtual:
        friendly_name: "Alexa Dummy Light"
        turn_on:

        turn_off:

        set_level:

Confirm this is now in HA. You will need to confirm configuration and restart HA . You can turn it off and on in the UI wont do anything except change colour

Once you have the virtual bulb. Expose it with emulated hue

emulated_hue:
  entities:
    light.alexa_virtual:
      name: "Alexa Dummy bulb"

This should now been seen in the alexa app. need to run discover .

You are using a real echo ?

Followed your instructions: it works !
I was not aware until today that this was possible, and this opens a new realm of opportunities for me.

Thanks very much sir !

2 Likes

Hi I’m looking at doing something similar but for exposure to Nodered instead of Alexa.

The above works fine, it gives me a lightbulb in the GUI and the toggle switch and when switching on and off it changes colour in the GUI and NodeRed gets the values. So on/off works perfect.

What I was actually hoping to achieve was getting a dummy light in the GUI that I can also dim. So it’s not just on/off but also a slider to set value between 0-255 or 0-100.

Can anyone help in how I turn the below which gives a light bulb passing on on/off into a light that passes on on/off and %

I expected the set_level line to take care of that but for some reason it doesn’t.

My config is

# Test light
light:
  - platform: template
    lights:
      hallway_lights:
        friendly_name: "Licht gang"
        turn_on:
          #
        turn_off:
          #
        set_level:

I have no issue, passing dim levels from Alexa.

in HA GUI can you change the dummy switch dim levels ?

No it just shows up as a light bulb in the GUI with a toggle switch next to it. So currently can’t enter the level in the GUI.

So I would like this dummy switch to show up as a slider in the GUI, so I can enter the % or brightness in the GUI.

Strange here is my entry

Using a config very similar to yours

@lonebaggie thanks my mistake. It indeed works. I was looking for the slider in the front end

Ok @lonebaggie , I already had the virtual light template as I mentioned in the other thread. But I had limited the emulated_hue to just scripts like this:

emulated_hue:
  type: alexa
  expose_by_default: true
  exposed_domains:
    - script
  entities:
    light.alexa_virtual:
      name: "Alexa Virtual Light"

I saw only 2 of my scripts which worked fine from Alexa. It did not find the Alexa Virtual light.

I then tried using the emulated_hue as above with just the one entity listed and Alexa found every HA device I had plus scripts and automations - 43 new devices! All of them were emulated hue lights and contained duplicates of devices I had already plus the Alexa Virtual Light. So I had to delete them all from Alexa App and change my config to:

emulated_hue:
  exposed_domains:
    - script
  entities:
    light.alexa_virtual:
      name: "Alexa Virtual Light"

and only the scripts are exposed again.

So after looking at the emulated hue thread here I found that I had to explicitly declare hidden: false, like this:

emulated_hue:
  expose_by_default: false
  entities:
    light.alexa_virtual:
      name: "Alexa Virtual Light"
      hidden: false

to finally get just the light to be seen by Alexa.

Thanks for all the help and I hope this helps others find their way.

1 Like

Trouble with HUE Emulated Lights in Hassio 98.5 anyone?

My Emulated hue was working great as mentioned above until I had to rebuild my system. I used the latest version at the time 2.12 (Hassio 98.5). Funny thing is that

  1. my Alexa app now says “device doesn’t support requested data”
  2. I can see the brightness value change in HA using the “States” page. But,…
  3. when Alexa sets it to 1% brightness, HA States show it to be 4
  4. Alexa shows a status of “device malfunction”

My Configuration.yaml looks like this (used to work):

mulated_hue:
 # type: alexa
  host_ip: 192.168.0.xxx
  listen_port: 80
  expose_by_default: false
  exposed_domains:
 #  - light
  entities:
    light.alexa_virtual:
      name: "Alexa Virtual Light"
      hidden: false

I don’t know why it broke and I hope someone can help me get it going again.

Thanks for any help.

Hi there,

I’m thinking about doing the opposite of what the OP did. I have a ton of input_booleans in HA that I use to trigger infrared transmissions in Node-RED using node-red-contrib-broadlink-control.

Does anyone know a way to encode these input_booleans in groups of 16 inside words (or 8/byte) and expose those words/bytes to Node-RED for later decoding?

Thanks.

Maybe input_number with set_value service?

Hi all,

Following the steps that you all said here, I created this:

light:
  - platform: template
    lights:
      theater_lights:
        friendly_name: "Alexa Lux Sim Entrada"
        turn_on:
          service: script.theater_lights_on
        turn_off:
          service: script.theater_lights_off
        


emulated_hue:
  entities:
    light.alexa_virtual:
      name: "Alexa Lux Sim Entrada"

HO assistant finds it, but Alexa is not finding it. Can you help me?

Also, when trying to turn it on I find the following error “Failed to call service light/turn_on. Unable to find service script/theater_lights_on”

Thanks in advance!

You have created a different light template . For Emulated Hue to see that light you need to expose

emulated_hue:
  entities:
    light.theater_lights:
      name: "theater_lights"

edit your service to call the script is wrong, you need an entity id

service: script.turn_on
data:
  entity_id: script.theater_lights_on

Hi,

Sorry, I’m very new on this and trying to understand this codes.

so in configuration.yaml I have to do:

light:
  - platform: template
    lights:
      alexa_virtual:
        friendly_name: "Dummy light"
        turn_on:
            service: script.turn_on
            data:
            entity_id: script.dummy_ligh_on  
        turn_off:
            service: script.turn_off
            data:
            entity_id: script.dummy_ligh_off
        


emulated_hue:
  entities:
    light.dummy_light:
      name: "Dummy light"

If not, I don’t understand in what file the first part of the code has to go.

The part from emulated_hue I imagine that is inside configuration.yaml

The edit the call scrip, I imagine that other than to add this ligts, I have to create a script that has to turn on the device on, correct?

Sorry again, too new and never coded a lot.

Thanks in advance!

Baby steps :slight_smile:

What are you trying to do ?