Need some help with a LUA script
Im running this query :
https://xxxx.com/json.htm?type=graph&se ... ange=month
Getting below output, this is great so far.
I want to get out the "tm" temp for the last 7 days, add them and divide by 7.
Where do i start ?
Code: Select all
{
"result" : [
...
...
...
{
"d" : "2019-02-11",
"hu" : "90",
"ta" : -0.19,
"te" : 1.3,
"tm" : -2.7999999999999998
},
{
"d" : "2019-02-12",
"hu" : "81",
"ta" : -2.6800000000000002,
"te" : -0.90000000000000002,
"tm" : -4.0
},
{
"d" : "2019-02-13",
"hu" : "89",
"ta" : 1.2,
"te" : 3.2000000000000002,
"tm" : -2.1000000000000001
},
{
"d" : "2019-02-14",
"hu" : "89",
"ta" : 1.4399999999999999,
"te" : 3.7999999999999998,
"tm" : -1.2
},
{
"d" : "2019-02-15",
"hu" : "92",
"ta" : 2.52,
"te" : 4.7000000000000002,
"tm" : 1.5
},
{
"d" : "2019-02-16",
"hu" : "82",
"ta" : 2.96,
"te" : 5.7999999999999998,
"tm" : 1.2
},
{
"d" : "2019-02-17",
"hu" : "85.8515625",
"ta" : -0.63671875,
"te" : 1.2,
"tm" : -1.7
}
],
"status" : "OK",
"title" : "Graph temp month"
}