Hello everyone, I have been using Home Assistant for a couple of years now, but I haven’t been very successful with the Restful integration and I can’t get the data I need.
I’m trying to get traffic incident descriptions from the website.
I had this code where I want to obtain all the descriptions from the link as I mentioned and have them delivered in a Home Assistant sensor:
An entity’s state value cannot store more than 255 characters (the first descripcion value is 410 characters) so the only place you can store the data is in the entity’s attributes (which can hold about 16K).
Hello, I modified the code to see if I could get something, but there’s no way I understand how to do it. Could you please share how the code should be? I would really appreciate it.
If it teaches me, for example, how to get all the “descripcion” and “causa” out, for example, it would be a good start, and from that base I think I could move forward if it’s a lot of work for you.
It’s my understanding that the combination of json_attributes_path and json_attributes lets you get one or more keys from value_json but there are limitations if value_json contains a list. It can get keys from any one list item but not all keys from all list items.
I may be wrong but that’s been my understanding.
For example, try this which only gets the keys from the first list item.
It works! And that is much more than I had before I thank you very much for your help, for now I leave it unresolved in case anyone could clarify the doubts you said. But thank you again.