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?
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
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.
... 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...
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:
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 I suggest you look into yr.no forecast instead.
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.
@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.
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.
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.
(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
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
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 ..