How to get status of multiple devices?

Hi there,
I’m trying to visualize the status of several door sensors.
Therefore I want to have a panel that shows me how many of the doors are open.

I already have a query to get the last status of each sensor in a table by using this query:
SELECT last(“status_int”) FROM “sensors” WHERE $timeFilter GROUP BY “device_name”

If the door is open, the variable “status_int” = 0.
How can I count the 0s in this table and visualize it like: 3/15.

@phofmann welcome to the forum :wave:

there should be a lot of ways to transform and visualize this data. I would suggest sharing some of your unformatted data and then we can mock some of it up and help.

Generally, it sounds like some pattern of transformations could help you achieve your goal. Have you explored those for manipulating your table data?