Can't create light from switch

I have a couple of Shelly 1 installed in my home and want to include one of them into a light group with some Philips hue products.

To do so, I first need to create a light switch based on that switch: https://www.home-assistant.io/integrations/light.switch/

Unfortunately, this doesn’t seem to be working for me.

What I did:

add light from switch

light:
  - platform: switch
    name: Schalter Küche
    entity_id: switch.schalter_kuche

add light to group

- platform: group
  name: Licht Küche und Essen
  entities:
    - light.schalter_kuche #this is the one
    - light.hue_color_pendant_up_1
    - light.hue_color_pendant_down_1

Then I restarted the HA-Server

If I check my developer tools, the light doesn’t show up, just the switch.
Screenshot 2021-04-16 093601

What I would expect is that I get an additional entity called light.schalter_kuche

Any idea why this isn’t working for me?

Thanks for your help - much appreciated :slight_smile:

Try using a u instead of ü in the name.

This is probably it.
The light might be called ligh.schalter_kueche instead. Try avoiding umlauts as some integrations might handle them differently.

Thanks for your inputs! I tried this, but unfortunately the issue persits.

new configuration.yaml entry (restarted HA after):

light:
  - platform: switch
    name: Schalter Kuche
    entity_id: switch.schalter_kuche

But in my entities I still only have switch.schalter_kuche, nothing else.

Does it matter where in the configuration.yaml I put this? I just put it somewhere near the end, right after the default tts entry. No indent before light:, the other indents are as shown.

It can be placed anywhere vertically in the configuration.yaml as log as there are no indents before light:
Do you use light: somewhere else in your config?

1 Like

Can you please take a look into the logs? (Configuration - Logs)

Is this in your configuration.yaml, and are you sure it’s the only light: block in that file?

Sorry for the delay - I just got back home.

So the thing about the number of light: blocks is interesting… My configuration.yaml contains this:

light:
  - platform: switch
    name: Schalter Kuche
    entity_id: switch.schalter_kuche
  - platform: switch
    name: Schalter Esstischlampe
    entity_id: switch.schalter_esstischlampe

#some other stuff here, followed by a bunch of includes, including this:
light: !include light-groups.yaml

Could this be causing issues? If so, how should it be set up?

Regarding the logs: I can’t see anything relating to this issue. Just some warnings related to pyroute2 (whatever that is) and some errors fetching data from philips hue.

Yes, this is the issue, you can only have one light: entry.
I set it up like this:
light: !include_dir_merge_list yamls/light/

Then I have this folder path:
config/yamls/light/
where I can put as many .yaml flies as I want into the light folder.

This is all described here:

With examples for every way to include something.

1 Like

Use light groups: here. Docs — see the paragraph starting “Nesting”.

That did the trick - thanks everybody that helped me out here!

I went with Troon’s suggestion, simply because my setup is pretty basic and I don’t feel the need to put the light-mappings in a different file as well.