weather forecast

Post Reply
Posts: 19
Joined: Wednesday 10 December 2014 17:42
Target OS: Raspberry Pi
Domoticz version:

weather forecast

Post by DeepB » Monday 30 May 2016 22:29


I would like to use the weather forecast for the current day in a Lua script.
Anyone doing this? Can anyone point me in the right direction how to do this, or even better is there a tutorial?

I found the wiki page on, unfortunately it seems I only get the current values.

Thank you

Posts: 256
Joined: Wednesday 17 December 2014 18:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland

Re: weather forecast

Post by pj-r » Tuesday 31 May 2016 9:19

I'm using WU to get what the weather is after 4 hours.. this way I can adjust underfloor heating setpoint.
Only problem is that it freezes domoticz while its doing http call on lua script. So its not the best way.
I think best way would be to run separate script that collects needed data to file and read from that in lua script.

for this you need to install io, socket.http and json lua libraries.

Code: Select all

function getWUForecast(hoursToSeek)
  io = require('io')
  http = require('socket.http')
  json = require('json')
  b, c, h = http.request("")
  -- print("Response status: "..c) -- status.. should be 200
  local lua_value = json:decode(b) -- decode json response to lua table format
--   print_r(lua_value)
  resultTable = lua_value["hourly_forecast"] -- contains datetime and temp values
  result = resultTable[hoursToSeek]["temp"]["metric"]
  hour = resultTable[hoursToSeek]["FCTTIME"]["hour"]
--   print("Hour: "..hour.." Index: "..hoursToSeek.." Value: "..result)

  return result
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors

Posts: 243
Joined: Wednesday 11 March 2015 20:13
Target OS: Raspberry Pi
Domoticz version: Beta

Re: weather forecast

Post by Thomasdc » Thursday 03 August 2017 14:26


I would like to get the weather forecast for the day..
is there an way to get this?

i would like to see the temperature that it's going to be that day
that way i can create a rgb-light that shows me in the morning how hot it will be that day.

but i dont know how to get this temperature...

Posts: 1
Joined: Thursday 16 November 2017 15:39
Target OS: -
Domoticz version:

Re: weather forecast

Post by civil1415 » Thursday 16 November 2017 15:52

Does it work for you guys?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest