Logic Machine Forum
Weather service not working anymore? - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Weather service not working anymore? (/showthread.php?tid=253)

Pages: 1 2 3 4 5


Weather service not working anymore? - jetsetter - 25.03.2016

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?


RE: Weather service not working anymore? - admin - 28.03.2016

It seems that Yahoo has made some changes in forecast delivery, we will fix it this week.


RE: Weather service not working anymore? - admin - 29.03.2016

Should be working fine now.


RE: Weather service not working anymore? - admin - 30.03.2016

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



RE: Weather service not working anymore? - andeug - 26.10.2016

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


RE: Weather service not working anymore? - admin - 26.10.2016

No, but yr.no provides more fine-grained data (not just today/tomorrow) if you need that.


RE: Weather service not working anymore? - andeug - 26.10.2016

Thank you for the feedback. I need just for today and tomorrow the weather information, so I guess that Yahoo Weather is enough...


RE: Weather service not working anymore? - PassivPluss - 26.10.2016

Fordelen med yr er at du får tekster på norskWink


RE: Weather service not working anymore? - andeug - 26.10.2016

... 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


RE: Weather service not working anymore? - Domoticatorino - 27.10.2016

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/volpiano/volpiano-726326

Thanks.


RE: Weather service not working anymore? - admin - 28.10.2016

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.


RE: Weather service not working anymore? - Domoticatorino - 29.10.2016

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.


RE: Weather service not working anymore? - andeug - 29.10.2016

@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.


RE: Weather service not working anymore? - Erwin van der Zwart - 29.10.2016

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


RE: Weather service not working anymore? - admin - 31.10.2016

I've made some changes to Yahoo weather report, now you should get proper pressure, wind speed and visibility values.


RE: Weather service not working anymore? - Domoticatorino - 07.11.2016

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.


RE: Weather service not working anymore? - edgars - 08.11.2016

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.


RE: Weather service not working anymore? - Domoticatorino - 07.12.2016

Thank you Edgars.
Sort it out!
Br


RE: Weather service not working anymore? - Trond Hoyem - 01.10.2017

(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


RE: Weather service not working anymore? - Erwin van der Zwart - 01.10.2017

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