Hi, everyone!
I’m trying to configure some restful sensors. I’ve been looking here and there, but not found something like I’m confronting…
I’m trying to have info about 6 items I have published in a web service. Right now I do it one by one, in six calls, with an answer like this:
{
"value_I_care_about": 98
}
The point now is that I can do just one call (and maybe after template N sensors) with all information for the 6 items. The response I get doing this call is a JSON array like this:
[
{
"Id": 1,
"value_I_care_about": 34,
*some other values...*
},
{
"Id": 2,
"value_I_care_about": 34,
*some other values...*
},
*and so on...*
]
And I’m completely stuck and without ideas about how to configure the sensor for having those internal values available
Please, help!
(thank you very much!)
Give us an example of an array you’re trying to iterate and what you want to get from it. There are lots of solutions depending on the data structure, starting from something as simple as getting the first item:
What do you mean exactly, though — what output do you want to generate? Accessing the data from that structure is easy, but we can’t give any guidance on how to do it until we know what “it” is.
For example, play with this in the Developer Tools / Template editor: