RESTful simple issue in getting attributes

Im having issues in configuring a REST sensor where the issues shouldnt exist.

Here is an example

Ive mapped the path using path tool online (https://jsonpath.com/)
Ive tried many… variations of the path.

I get nothing from it.
I can GET this using postman and see the results easily.

[
{
“place_id”: 113605019,
“licence”: “Data © OpenStreetMap contributors, ODbL 1.0. OpenStreetMap”,
“osm_type”: “way”,
“osm_id”: 41241895,
“boundingbox”: [
“55.5516358”,
“55.5536442”,
“12.9850659”,
“12.9875533”
],
“lat”: “55.552840849999995”,
“lon”: “12.986350902122808”,
“display_name”: “IKEA, 1, Kulthusgatan, Svågertorp, Väster, Malmö, Malmö kommun, Skåne län, 215 86, Sverige”,
“class”: “shop”,
“type”: “furniture”,
“importance”: 0.11100000000000002
}
]

can anyone get this sensor to populate ?

Can you please correctly format your data by having it with 3 ``` (backquotes) at start and end of the section? I copy/pasted your output in a json viewer and that gives an error so maybe this is where the problem starts. All (just a few) my rest sensors kick back json data, starting with { not [ so something is odd. Check with e.g. the one below, showing my kickback for FX rates
image
Here 'my ’ path is $.rates and the individual attributes I then select are USD, CHF and GBP which then show up in the attributes of my template sensors

You specified neither a value_template nor json_attributes, here. The default is to put the whole response as the value, but values are limited to 255 characters, so that doesn’t fit and you likely have your HA log full of messages about this.

What are you trying to retrieve?

i started with the inclusion of attributes but then backed off as i wasn’t getting data.
nothing of note in the error log.
if anyone wants the proper structure, just copy the url into a browser.

what i want as a result is lon,lat and display name.
this is part of an automation to get my next calendar entry, if its an address, get driving time and notify.
all of this works, i just need the lon lat from this.

even if i specifcy json_attributes (vt is not required) as here…
image

i still just get an empty array

Normally, if i run the rest first and it can overflow (255+) but still populates the state, showing that i have good data and a good root.

resolved!

my above method used to work when, which is how i build my home assistant.
but not today, things must have changed since then
populating vt and attributes is now working

Please show how you resolved the issue for other users coming to this thread.

1 Like

hahah hold those horses, i just wanted to finish the dynamic nature fully before posting for others

image

For this particular service you can use either GET or POST
Using resource_template so that i can refer it to a text input entity
I can then set the destination address… for example

service: input_text.set_value
data:
value: Ikea, Malmo
target:
entity_id: input_text.destaddress

now, i was going to say that you can then call the update_entity service but i see that when i update the input text, the rest automatically queries

btw…there are other API which are more accurate…they do come with a subscription and free calls up to 20k or so then you have to pay. The above one does not recognize my home address, just the street.
I will however raise another question as to the data-security part in this, me providing my name and address and thus, when they map to IP …they can deduct where I (my device) is.

oh absolutely, data is the world money maker.
my use here was initially because i wanted to be alert if traffic was poor to a destination that i have scheduled in my calendar.
ive now since moved to use waze_travel_time and that is happy to use textual address information.
you could say this is even worse as ive now provided my travel plans and route but there will always be something. data is sold, if they say theyre not, they are, simples, thats just how the world works

but going back to the topic of restful resolvement into an entity. it was good to get it resolved and working in a dynamic way.