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.

Weather service not working anymore?
#1
Hi, for quite some time, I am using the http://openrb.com/weather/?w=citycode to get weather data for my city code in a script every minute, but since this morning, the service returns error status:
{"error":true,"cause":"load failed"}

I have used also different city codes, but I get the same error. Is there a temporary problem or we cannot use this service anymore?
Reply
#2
It seems that Yahoo has made some changes in forecast delivery, we will fix it this week.
Reply
#3
Should be working fine now.
Reply
#4
Another option is to use forecast from http://yr.no
You have to replace URL with the one that corresponds to your location.

Code:
require('socket.http')

forecast = {}

function parsetag(parser, tag, attributes)
  if tag == 'time' then
    table.insert(forecast, {})
  elseif tag == 'symbol' then
    forecast[ #forecast ].symbol = attributes.name
  elseif tag == 'precipitation' then
    forecast[ #forecast ].precipitation = attributes.value
  elseif tag == 'windDirection' then
    forecast[ #forecast ].wind_direction = attributes.code
  elseif tag == 'windSpeed' then
    forecast[ #forecast ].wind_speed = attributes.mps
  elseif tag == 'temperature' then
    forecast[ #forecast ].temperature = attributes.value
  elseif tag == 'pressure' then
    forecast[ #forecast ].pressure = attributes.value
  end
end

url = 'http://www.yr.no/place/United_Kingdom/England/London/varsel.xml'
data, err = socket.http.request(url)

if data then
  require('lxp').new({
    StartElement = parsetag
  }):parse(data)

  log(forecast)
else
  alert('Fetch failed: ' .. tostring(err))
end
Reply
#5
Hi,

I've made today the LM4 script to get the weather data, which I will print it on Schneider's 7" Touch Panel.
Is there a major difference between Yahoo and Yr.no weather API? Mine is working with Yahoo and I find it quite accurate for Stockholm, in Sweden.

Andreas

Attached Files Thumbnail(s)
   
Reply
#6
No, but yr.no provides more fine-grained data (not just today/tomorrow) if you need that.
Reply
#7
Thank you for the feedback. I need just for today and tomorrow the weather information, so I guess that Yahoo Weather is enough...
Reply
#8
Fordelen med yr er at du får tekster på norskWink
Reply
#9
... and my only problem with the Schneider Touch 7" display is that I am limited to the type of data which I can display. Only numbers with floating points, no ASCII or other characters...

So, my Weather section is quite limited...  Sad

Attached Files Thumbnail(s)
   
Reply
#10
Hi,
I have implemented on my HomeLynk Yahoo weather forecast but some datas extract by http://openrb.com/weather/?w=726326 and data shown in Yahoo are different.
Some of them are simply to manipulate and there is not problem but some other, such us wind and pressure are completely different. I tried to convert measure unit in other but there's some difference.
What do you think about that? Here below the link:

http://openrb.com/weather/?w=726326
https://www.yahoo.com/news/weather/italy...ano-726326

Thanks.
Reply
#11
We are just proxying the request, no data conversion is applied. It looks like is an issue on Yahoo API side which no-one bothered to fix Sad I suggest you look into yr.no forecast instead.
Reply
#12
Hi Erwin,
further to the code you wrote above to link with yr.com could you suggest a way to link information to knx address?
Futhermore I.would.like avoid to send on bus every 60 seconds all information about weather. Therr is a way to show without write data.
Thanks.
Reply
#13
@admin: I have the same problem with Yahoo weather, which I am using it on my project. I will give a try later to Yr.com...
Please let us know when the Yahoo weather conversion script will be fixed. If I cannot make Yr weather to work, I will have to rollback to Yahoo.
Reply
#14
Hi Domoticatorino,

You can write to KNX by using this as example:

grp.write('1/1/17',forecast[1].temperature)

Or just update the controller by using this as example

grp.update('1/1/17',forecast[1].temperature)

Log forcast to see the fields you can use ..

BR,

Erwin
Reply
#15
I've made some changes to Yahoo weather report, now you should get proper pressure, wind speed and visibility values.
Reply
#16
Dear Erwin,
as per your suggestion I replace grp.write with grp.update in order to avoid send useless telegram on bus. Unfortunately telegrams are sent in any case.

Please consider that I have a HomeLynk Schneider firmware 1.5.1. Is there a modify I have to do?
Thanks.
Reply
#17
Probably you are receiving telegrams over KNXnet/IP (telegrams are sent even you are doing grp.update). To disable this, you need to adjust filtering table in System Config --> Network --> KNX connection.
Reply
#18
Thank you Edgars.
Sort it out!
Br
Reply
#19
(30.03.2016, 10:45)admin Wrote: Another option is to use forecast from http://yr.no
You have to replace URL with the one that corresponds to your location.

Code:
require('socket.http')

forecast = {}

function parsetag(parser, tag, attributes)
 if tag == 'time' then
   table.insert(forecast, {})
 elseif tag == 'symbol' then
   forecast[ #forecast ].symbol = attributes.name
 elseif tag == 'precipitation' then
   forecast[ #forecast ].precipitation = attributes.value
 elseif tag == 'windDirection' then
   forecast[ #forecast ].wind_direction = attributes.code
 elseif tag == 'windSpeed' then
   forecast[ #forecast ].wind_speed = attributes.mps
 elseif tag == 'temperature' then
   forecast[ #forecast ].temperature = attributes.value
 elseif tag == 'pressure' then
   forecast[ #forecast ].pressure = attributes.value
 end
end

url = 'http://www.yr.no/place/United_Kingdom/England/London/varsel.xml'
data, err = socket.http.request(url)

if data then
 require('lxp').new({
   StartElement = parsetag
 }):parse(data)

 log(forecast)
else
 alert('Fetch failed: ' .. tostring(err))
end

Just made a test of this to get the temperature sent on the bus. It works OK as far as I can see.

But is there a way to ask for the weather for a certain time in the future? I guess there is, but can't really see it... I would like to know what the temperature will be in one hour's time to be able to lower the blinds before the sun starts heating the room.

Trond
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply
#20
Hi,


Yes you could do it but this option is depending on your received dataset, i checked yours but in this dataset you got back it's givving you timeframes of 6 hours, so you cant use that, i would search for a more detailed weather API ..

BR,

Erwin
Reply


Forum Jump: