How do you extract data from a json array?

Which element of the list "U_AC" do you want to return ? (There are three...)

the first, but to understand how it works I would like to be able to choose 0-1-2

image

To get the others just replace the value in "index" (AI2 list indexing starts at 1, not 0)

You could also do it like this:


I did not try with empty list yet

great,
it was simple but I couldn't do it, I don't have much experience with dictionaries and lists, I'll make the most of it
A thousand thanks

@ABG, I will also test your solution

Don't feed extracts back upstream.
It pollutes your data.
Use new global data variables for each extract, to preserve pristine input.

is this okay?

c78d6ba6f98369ba2906af91cd9ce429d1f422ea_2_690x190
Don't poison the next step with a non-dictionary

What does that converti procedure do?

the value "fl_43793333 is a Float - Big Endian (ABCD)
which corresponds to 249.2 representing the volts taken from a photovoltaic system.

Is this better?

What happens when you run it?

I changed again
when I run it it works fine.
Thank you

Your blocks might work, but your understanding of the lack of AI2 automatic text to structure conversion fails.

Will others be reading your code and be in a position to grade you for it?

I declared up front that I am a beginner despite my 70 years, I try to learn as I can and I accept all advice.
However, for the moment it works and with time I will try to improve it.
Thanks again :wink:

I'm back;
I have a new problem on the same project,
Since yesterday the inverter manufacturer decided to change the url from http to https, it no longer works, not even after I changed the url.
I tried with postman and it correctly returns the requested data in json format
Why?

I attach some simple test blocks that previously worked perfectly

I correct myself, the working version is with HTTP://....

but no one answers me?

after doing a search in the community I found this thread for you...

Taifun

Thanks @Taifun for the reply.
I solved it by using an esp8266 board whose libraries support the https:// connection and I retransmit the acquired data to the AI2 APP via MQTT, the result is that the AI2 APP is simpler and the POST REQUESTs are halved.
a curiosity:
but wouldn't it be more intuitive to insert a jsondecode into the dictionary instead of having to use the WEB component?

a greeting
Amedeo

Great
Please provide a screenshot of the working solution
Taifun

on the left the master device (esp8266)
on the right the tablet application.

saluti Amedeo

1 Like