API GET /api/states/<entity_id> with multiple entity_ids

I’m trying to get the state from two sensors in Home Assistant using the REST API. I can currently do this using GET /api/states which returns all states or GET /api/states/<entity_id> which returns the state from the selected entity. With the first request is overkill to get the status of only two sensors while with the second I need two separate requests. If there not a way to have the API return the state from two selected sensors only. Something like GET /api/states/<entity_id>,<entity_id>.

Anyone has any ideas how I can optimize this?

3 Likes

I have the same scenario.
I guess a good implementation would be a /api/states/ push that accepts an json array of entitiy-ids and returns the states of these entities.

Are there any news on this?