My local gym has a json api to track how busy they are, but it’s formatted in a weird way compared to how i’d like to have it displayed in home assistant.
here’s a pseudo version of what they’re doing:
{
"TotalCapacity": 35,
"LocationId": 2345,
"LocationName": "Weight Machines",
"LastUpdatedDateAndTime": "2024-10-02T11:40:27.567",
"LastCount": 8,
"FacilityId": 1122,
"FacilityName": "East Location",
"IsClosed": false
},
{
"TotalCapacity": 100,
"LocationId": 5586,
"LocationName": "Track",
"LastUpdatedDateAndTime": "2024-10-02T11:22:29.68",
"LastCount": 5,
"FacilityId": 987,
"FacilityName": "West Location",
"IsClosed": false
},
and so on. They’re not separated by facility, it’s all one big array. The id numbers seem to be arbitrary and nonconsecutive.
my goal is to have a card for my selected FacilityName containing IsClosed and how full (LastCount / TotalCapacity) each LocationName is at that facility.
is this possible? how would i format the rest sensor?