REST sensors do not handle array JSON reply bodies

I have been unable to set up a REST sensor that returns an array of JSON objects despite help from the Home Assistant Assistant and Home Assistant Helper GPTs. Please fix the REST sensor YAML definition so that JSON arrays can be specified as return bodies as this is a valid JSON return for a REST request. Thanx.

? any examples which donot work ?

i…e very little info on which you build your request

ChatGPT: How to help us help you - or How to ask a good question

However, you are trying to return a JSON array to what? As in you want that array of objects to be attributes of the sensor itself?

See this post including my solution:

It’s messy but possible. It’s certainly better when the JSON is a dictionary but you can work with arrays.

I want a link to this…

1 Like

You need to have a pro account. If you have one, you just go to the sidebar where the four dots in a square icon is with the label Explore GPTs and click. Up will come a dialog and you type in Home Assistant. There are about 6 or so custom GPTs, only two of which - the ones I’ve used - have lots of comments.

Hope that helps.

So treat value_json as an array? I’ll give it a try, thanx for the tip! I am surprised the Home Assistant GPTs didn’t know about this.

BTW, the documentation for the REST sensors could use some improvement which is why I turned to the Home Assistant GPTs. I found it difficult to find anything. The examples are either lacking or pretty rudimentary and not oriented toward device sensing and control applications.

Feel free to submit improvements — feedback and edit links at the bottom of each page.

That’s a shame. i wanted to make jokes at how bad the answers were.

1 Like