How to extract OpenSky data
Posted: Thursday 24 December 2020 0:58
Hi,
We live in the vicinity of Schiphol Airport. I want to use domoticz to register the planes that fly over our house. At opensky-network.org you can obtain flight info of commercial airlines with JSON. The response from the server looks like this:
As you can see the fields have no names, only values. How can I make a textstring with - for example - only the second field of each record (i.e. 'SWR1059 SWR979 SWR78J')?
I tried this without success:
Thanks in advance,
Peter
We live in the vicinity of Schiphol Airport. I want to use domoticz to register the planes that fly over our house. At opensky-network.org you can obtain flight info of commercial airlines with JSON. The response from the server looks like this:
Code: Select all
{"time":1608762620,"states":
[["4b1809","SWR1059 ","Switzerland",1608762607,1608762607,8.5565,47.4536,null,true,0,5.62,null,null,null,null,false,0],
["4b1802","SWR979 ","Switzerland",1608762616,1608762616,8.56,47.4541,null,true,0,185.62,null,null,null,"1000",false,0],
["4b180b","SWR78J ","Switzerland",1608762611,1608762616,8.5557,47.4544,null,true,0,185.62,null,null,null,null,false,0]]}I tried this without success:
Code: Select all
rt = triggerObject.json
-- some checks left away
local textLines = ""
for j = 1,#rt.states do
textLines = textLines .."\n" .. rt.states[j]
endPeter