This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

openweather ONE call API
#18
Hi @all,

I want to get the snow fall forecast for the next 24h unfortunately I struggling to address the table position right.

What would be the right address for the snow value?

Code:
table:
[1]
  * table:
   ["feels_like"]
    * number: -4.82
   ["dew_point"]
    * number: 0.53
   ["snow"]
    * table:
     ["1h"]
      * number: 0.1
   ["pop"]
    * number: 0.34
   ["humidity"]
    * number: 95
   ["weather"]
    * table:
     [1]
      * table:
       ["main"]
        * string: Snow
       ["description"]
        * string: Mäßiger Schnee
       ["icon"]
        * string: 13d
       ["id"]
        * number: 600
   ["uvi"]
    * number: 0
   ["wind_gust"]
    * number: 13.94
   ["wind_deg"]
    * number: 266
   ["pressure"]
    * number: 993
   ["wind_speed"]
    * number: 8.29
   ["temp"]
    * number: 1.24
   ["visibility"]
    * number: 10000
   ["clouds"]
    * number: 98
   ["dt"]
    * number: 1705305600
[2]
  * table:
   ["feels_like"]
    * number: -4.51
   ["dew_point"]
    * number: 0.5
   ["snow"]
    * table:
     ["1h"]
      * number: 0.13
   ["pop"]
    * number: 0.49
   ["humidity"]
    * number: 94
   ["weather"]
    * table:
     [1]
      * table:
       ["main"]
        * string: Snow
       ["description"]
        * string: Mäßiger Schnee
       ["icon"]
        * string: 13d
       ["id"]
        * number: 600
   ["uvi"]
    * number: 0.2
   ["wind_gust"]
    * number: 13.92
   ["wind_deg"]
    * number: 264
   ["pressure"]
    * number: 992
   ["wind_speed"]
    * number: 7.88
   ["temp"]
    * number: 1.36
   ["visibility"]
    * number: 277
   ["clouds"]
    * number: 100
   ["dt"]
    * number: 1705309200


I‘ve tried the following:

Code:
data.hourly[i].snow.1h

But getting the failure: 

Code:
Lua syntax error at line 79: malformed number near '.1h'

Many thanks for your help!

Best Regards 
Steffen
Reply


Messages In This Thread
openweather ONE call API - by pioneersteffen - 17.10.2021, 11:35
RE: openweather ONE call API - by admin - 18.10.2021, 06:07
RE: openweather ONE call API - by JRP - 19.10.2021, 10:16
RE: openweather ONE call API - by admin - 21.10.2021, 06:22
RE: openweather ONE call API - by admin - 22.10.2021, 06:43
RE: openweather ONE call API - by admin - 25.10.2021, 06:50
RE: openweather ONE call API - by AlexLV - 30.10.2021, 20:03
RE: openweather ONE call API - by AlexLV - 31.10.2021, 14:30
RE: openweather ONE call API - by pioneersteffen - 15.01.2024, 09:12
RE: openweather ONE call API - by admin - 15.01.2024, 09:14
RE: openweather ONE call API - by admin - 15.01.2024, 10:26
RE: openweather ONE call API - by admin - 15.01.2024, 10:32

Forum Jump: