I have been fighting this for days. Below is part of my entry in my lights.yaml. Everything works fine EXCEPT the basement track lights switch to light does not work at all. The others work fine and can be grouped and are operational. The Basement Light Group works, except for the track lights. Please help me see what is wrong here!
The switch.basement_track_lighting_switch is available and is operational. It’s like it never got converted to a light. device. I have tried removing it entirely and re-entering it. Afterwards I would reload the groups and even re-started HA. The rest of the group has no problems, just this one switch to light definition.
I have checked the spelling, etc. Is there a limit to the number of Switch to Light conversions in a lights.yaml file?
These two things don’t look the same to me. In your group you specify light.basement_track_lights yet you mention that switch.basement_track_lighting_switch is working normally. Does the light.basement_track_lights entity turn on and off without an issue?
No, the light.basement_track_lights is not available so it can not be turned on or off. That is the problem, the switch isn’t being converted to a light.
My understanding (which could be wrong of course) is that in the group you use the light. like I did in Basement Work Light, which works fine, meaning that the light identity doesn’t have to match the switch identity, just the switch name. Am I wrong in this understanding?
Your understanding matches mine (if I follow you): the name Basement Track Lights will become basement_track_lights and thus you’d use light. basement_track_lights.
This wouldn’t explain the issue but at least as a test, use the switch entity in your group — you can mix these in a group.
I wonder if there could be anything special about the switch. What type is it and how is it set up? Anything else like an integration for the device or any other related config you can share?
Clasping at straws here…
Maybe also try readding/renaming only those switch and light entities and use single term names and IDs (I’m thinking foo, bar, bas, etc. like we programmers like to use for illustrative purposes).
Well that seems to work okay. I can control all the lights and switch from the group. I took out the light group and switch to light definition and moved it all to my groups.yaml
I would like to keep all my light groups together though in my lights.yaml and since I have the same scenario with my laundry group (which works just fine) I am stumped as to why the basement group isn’t working.
Tom, now that parautenbach’s suggestion worked in a group, I’m now going to type in everything from scratch in the lights.yaml just to make sure about hidden characters, etc. I have checked and rechecked the entity id and it is for sure correct, but let me do this and I’ll report back.
Same exact problem. I removed everything from groups.yaml, and typed in (no copy and paste) everything in a different position in lights.yaml and there is still no light.basement_track_lights. I checked the log prior to doing everything and the only error I can see is the same one I got when I retyped it all in and reloaded the group.
“2021-01-25 23:24:35 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.basement_track_lights” followed by:
“2021-01-25 23:24:36 WARNING (MainThread) [homeassistant.components.cloud.google_config] Error reporting state - 5: Requested entity was not found.”
That’s it. prior to those errors it had “2021-01-25 23:23:50 INFO (MainThread) [homeassistant.components.light] Setting up light.group” then the error.
Light groups go under the light: section, not the group: section. But I suspect you just miss typed this as you have the correct config location shown in your post above.
Go to your developer tools states menu and paste this into the “Filter Entities” section above the first column:
ok, let me first say, I renamed that switch entity to switch.basement_track, just to see if the entity name length would have any effect it does not. Still no light. So I just did what you asked and put switch.basement_track in developer tools and it shows the state as off and the state attributes as:
friendly_name: Basement Track Lighting
Thanks for your help. I tried to delete and re-install the device, but that didn’t help. I then just tried creating a light from another switch I had (different brand) and that didn’t work either. In the end, the ability to change a switch to a light has completely disappeared from my system for some reason. An the logs have NO errors regarding any of the switches/lights that are in lights.yaml. The switch to light conversions that I had in there continue to work just fine, but I cannot create anymore switch to light definitions. So, I just need to figure out how it use to be done before. When you had a switch that you wanted to group with bulbs, how was it done?