I tried something slightly different:
selector:
entity:
domain: light
entity:
domain: switch
This seems to work without errors.
I tried something slightly different:
selector:
entity:
domain: light
entity:
domain: switch
This seems to work without errors.
Still produces the same warning message for me. Iâve narrowed it down to the moment the blueprint is opened to create an automation, the warning message is generated.
I should clarify that in my previous post I called it an error message but, to be more accurate, itâs a warning. Nevertheless, using the blueprint with this multi-domain syntax does generate warning messages.
In addition, the menu fails to produce a complete list of available entities. In other words, when I use this:
input:
first_entity:
name: First Light
description: Select a light.
selector:
entity:
domain: light
entity:
domain: switch
default: light.hallway_light
It shows me only two entities in the menu, one light and one switch. Thereâs only one switch available, so thatâs fine, but there are many available lights.
I have a second Entity selector defined in the same blueprint:
second_entity:
name: Second Light
description: Select a light.
selector:
entity:
domain: light
default: light.foyer_light
variables:
This oneâs menu lists all available lights (and not just one like in the first selector).
Finally, if I define three domains for the first selector:
input:
first_entity:
name: First Light
description: Select a light.
selector:
entity:
domain: light
entity:
domain: switch
entity:
domain: binary_sensor
default: light.hallway_light
the resulting menu lists all four binary_sensors, only one light, and no switches. Thatâs different from the previous test but equally wrong.
Given that the generated menus are inconsistent, and warning messages are produced, I believe this is a bug, not an undocumented feature. Thereâs no way I would want to release a blueprint that leverages this bug because users are likely to encounter unusual selector behavior.
Wait a minute, isnât the answer here just to use the target selector? It specifically allows you to select multiple entities of the same type.
@123 I just saw your conversation over in the Single user lights blueprint, this is the same situation isnât it?
I think so. I failed to examine the other one closely and assumed it was tackling the âlist of lightsâ issue the same way as this one. However, I was wrong and the other one uses target
constrained to the light
domain.
If the same technique is employed here, the service call will need to be modified to accept target
as opposed to entity_id
.
I recall experimenting with the Target Selector and could only constrain it to a single domain.
I also noticed that the author of this topicâs blueprint has chosen to use an Entity Selector with multiple domains, despite the fact itâs unreliable and logs warning messages.
I tried using the target selector, but while it appears to work, any automations created using it wouldnât actually work. It would throw an error in the logs along the lines of:
2020-12-22 12:19:12 ERROR (MainThread) [homeassistant.components.automation] Blueprint Keep One Light on at a Time generated invalid automation with inputs OrderedDict([(âlight_listâ, OrderedDict([(âentity_idâ, [âlight.basement_stairsâ, âlight.basement_storageâ])]))]): Entity ID entity_id is an invalid entity id for dictionary value @ data[âentity_idâ]. Got None
Did you do this?
I tried, but canât seem to figure out how to do that.