Habpanel simple filter, do i need custom filter and how to implement it?

Hi all,
sorry if this could be a noob question: i’m starting with habpanel, angular and all the stuff behind habpanel.

Need: I’d like to filter a group of roller shutters depending their state to count (or list) the open ones.
So i need a “logical simple” filter: “state = 50 or state = 0”

I’m trying pipe filter due to their simplicity (found many examples in this community):

{{(itemsInGroup('gRollershutters') | filter:{state:'50'}).length}}

but I haven’t found the syntax to implement the OR condition.
Do i need a custom filter and, if yes how i can implement it in habpanel ?
I’ve tried this way but the code of the custom filter isn’t executed; I’ve found some post about it but they span from 2016 to 2020 so isn’t clear what’s the current best way.

I’m using an old 2.2 version (I have to find enough time to upgrade, i’ll do).

Thanks for support

Sorry to bother for this trivial question, can anyone post a quick hint to show me an example so i can go on myself?
thanks a lot

I don’t know the answer to your question, but I’d suggest that you accomplish your counting in OH, not in habpanel. Doing it there ties it to that interface, and reduces your flexibility in the future. If and when you upgrade to OH3, you might find that you prefer MainUI.

There’s a current discussion about counting group members. Obviously the UI stuff won’t work since that’s specific to OH3, but there are some methods for text-based configuration mentioned. I don’t know what will or will not work in your very old OH2.2 system, though.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.