[Solved] Looping through helpers in script possible?

I have around 8 HUE motion sensors in my house. I can write a script that checks them all individually like i did for my doors but that are only 3 (i know should be done in a loop too).

The jinja help file doesn’t give me much info on how to access the Helper if have named motion_sensors.

Any hints are welcome

“Checks them” how? Can you be more specific about what you’re trying to accomplish?

1 Like

If you are trying to check for motion on any of the sensors then probably the best way would be to put them in a helper group. The group sensor will be triggered if any individual sensor in the group is triggered.

They are in a helper group, i would like to run a monthly check to look at battery status and if they go below 10% message me the one (or more) that are below 10%.

I have them in a helpergroup so how can i use a script to loop through the objects in a helpergroup?

See the expand function: Templating - Home Assistant

There are some good low battery blueprints that can save you the trouble. Here is one:

1 Like

Thanks for this that helped