I am new to using templating, right now I have this template that I found and am using, which returns a list of scenes for my “Office” room (domain). It’s helped me understand a lot about how templates work.
I’ve poked around for a while, but I am having trouble figuring out how (if possible) I can take that list and add another filter to narrow it down to only the scenes that have the “color_scene” tag.
Unfortunately, it looks like it doesn’t work the way you wrote it. The template tester in dev tools returns a blank list. I think I’m having trouble understanding what values are valid when I try to use selectattr() or select().
Where is it documented that “in” is a valid keyword that invokes a test for select()?
Likewise, is there similar documentation for selectattr() that indicates how to use ‘domain’ and ‘eq’?
Did it work at all before? I didn’t really look over the rest of your syntax at all, but now that I do it does not look right… Try this much simplified version instead:
Ahh, now I see what expand does. Never had a reason to use it yet and when passed over in the documentation seemed like its only function was to expand groups, but rather than return a list of entity ids it actually returns a list of entity objects… But in this case you don’t really need that, the entity ids themselves are enough for at least this filtering required so far.
Last thing (for future viewers), since the new and simplified template that Magnus gave me returns the entity_id instead of the name, I had to edit the other section of the .yaml block to refer to the entity_id as well.