I tried integration_entities, but some of the entities I wanted are disabled and “integration_entities” doesn’t return disabled entities in the list (?)…
Describe your entire flow not just this ‘filter’ what are you actually trying to do. I suspect we have an x/y problem where you’re hooked on a how that may not be the right way to go.
Problem:
When you add devices in zwave_js the device gets built in HA automatically, but many of the configuration entities are build disabled/hidden by default. Some of those entities I always need, so have to manually go enable those entities every time I add a new device, or any time I mess with the zwave controller enough that it rescans/reinitializes all of its devices (rare).
Current Solution:
I made a manually triggered automation that uses the Spook action “homeassistant.enable_entity” to enable the entities on the devices that already exist. That is the automation action shown in the OP, and it works fine.
Desired Solution:
I would like that automation to work on any device that has those same entity types, and don’t want to have to update the automation every single time I add a new zwave device of that type.
So instead of the entity_ids being ‘hard coded’ in the action of the automation, I would like the action to run on any entity that matches the basic pattern:
{% set num = states.number | selectattr('entity_id', 'search', '_motion_light_switch_level') | list %}
{% set sel = states.select | selectattr('entity_id', 'search', '_motion_light_operation_mode|_motion_light_timeout duration') | list %}
{{ (num + sel)|map(attribute='entity_id')|list}}
That is close… The entities that exist but are disabled / not visible do not show up though. I’ll poke around on that to see if I can figure out how to get those to show up in the filter.
For instance you know a light entity exists and it’s from ZWJS. Therefore you should be able to determine its…
(in my case why im realllllly interested in this all of the sudden.) a Zen32 or one of the Jasco multisensors.???
I think dig can help figure out the template to grab attributes about the device (type) for a device from JS and then test if it has one of the known entity patterns you know doesn’t get enabled by default for that device type? Then it’s just a bunch of pattern replaces and firing spook a couple times. Or once to the array…
And on the dimmers I change this parameter for default ON level:
number.<name>_switch_level
That said, I also end up enabling the Auto Off Timer Duration on Zooz ZSE04s too, so it isn’t a GE/Jasco motion switch/dimmer specific issue - although if I could get just those I would be very happy.
EDIT: And of course, thank you for your interest. I thought this would be ‘simple’, but after digging in it clearly is not. It seems to be pretty hard to get an actionable list of DISabled entities to act upon as most calls filter out those entities.
For example doing an integration_entities(‘zwave_js’) doesn’t return any of those DISabled entities. Either do any of the state. queries.
Nope it’s darned near impossible. That’s why I suggested the alternative. You CAN get all the entities off the JS integration then you select all the ones that are that type. Figure out the primary entity_id is, the. Use replace to manufacture the expected entity ID to feed to spook.
Yes it will fail sometimes but if you have a chance in heck of doing it it’ll be some variation of that.