Create a virtual Dimmer or light template for Alexa

I have created lots of automation’s via the Alexa routines feature, which then switches input boolean components in HA to action the request.

This is getting cumbersome using one input boolean for each routine. I would like to create a virtual dimmer in HA then expose this entity to Alexa. This would give me a 100 different responses via the dimmer, using just one entity, is this possible?

Feel very stupid. Just simply create a blank Light template. The world simplest config :slight_smile:

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

       turn_off:

       set_level:

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 !

1 Like

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