Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0
knuth

Yr weather plugin documentation

Question

The Yr weather plugin is listed in the HC2 interface as having the following properties, which may be used in scenes and VDs:

Please login or register to see this image.

Is there any documentation on how each of these properties is to be understood? My particular interest is in the variable "WeatherCondition", where I so far have picked up two values, "Clear" and "Cloudy". I would like to know the complete list of possible values for this variable. ConditionCode and ConditionCodeConverted seem to be related. What do they signify, and what are the codes?

 

More generally: Is documentation for the Yr weather plug-in available anywhere? 

 

PS: I contacted the Norwegian meteorological service, owners of the Yr service and yr.no, thinking that the weather condition terms used in the plug-in were their design. They answered promptly that the plug-in was Fibaro's responsibility, adding that Fibaro's use of the Yr brand name was "illegal". There has been a conflict on the use of the Yr service by Fibaro before. It seems this is not fully resolved yet. Please fix, before the service is denied once again!

 

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Thanks, @10der , that's a start. I assume that these are the values of the variable ConditionCode, not "WeatherCondition (ref the list I posted above). The funny thing is that when I use yrTxt = fibaro:getValue(<yr-id>, "WeatherCondition") the texts that are returned are not part of the same set. For instance, it will give yrTxt = "clear", not "Sun", and yrTxt="cloudy", not "Cloud". 

     

    I can of course switch to using ConditionCode, like you have, and generate my own texts or icons from there. But I am still curious: Does documentation for the Yr plug-in exist? The documentation link in api.met.no does not use the same list of variables as the plug-in. 

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • Another test shows that the plug-in gives ConditionCode = ConditionCodeConverted = 26 for WeatherCondition = "cloudy". This indicates that, surprisingly, ConditionCode returned by the Yr plugin is the Yahoo symbol code and should be looked up in the Yahoo table:   

    Please login or register to see this link.

     

    The texts returned (WeatherCondition) also seem to match the ones used by Yahoo. 

    This gives me what I need for now, but if anyone can provide a fuller documentation, please do.

     

    I am puzzled by a few of the matches done in the self.SymbolsMap shown by @10der . For instance: Yr #9 and #41 (LightRain and RainSun) are both linked to Yahoo #10 (freezing rain). Should it be Yahoo #9? And Yr #25 (RainThunderSun) is linked to Yahoo #46 (snow showers). Should it be Yahoo #45? There are a few more like this.To make such proof-reading easier, I have gathered all the texts and code numbers in an Excel sheet (

    Please login or register to see this attachment.

    ). Here, the match between the Yr numbers and texts are taken from the Yr API documentation, while the match between the Yahoo numbers and and texts are taken from the Yahoo documentation. The Yr - >Yahoo transition is based on the table self.SymbolsMap shown above, including possible inaccuracies. The table may be sorted by any column. If matches are changed (e.g. Yr 9 -> Yahoo 9, not 10), the corresponding text need to be updated as well. 

    Share this post


    Link to post
    Share on other sites
    • 0

    @knuth  Sir. can you do analyse \opt\fibaro\plugins\com.fibaro.yrWeather\yrWeather.lua this file from latest FIBARO FW by itself :)

     

    thnak you, I am not a FIBARO dev, .thankfully (or not)

     

    Share this post


    Link to post
    Share on other sites
    • 0

    here is my code for grabbing Yr weeather

    Please login or register to see this code.

     

    you can use it instead of using FIBARO.

     

    Please login or register to see this code.

    Please login or register to see this code.

     

    Please login or register to see this image.

    /monthly_2019_09/image.png.9d20b77705a9f6981339e2f959968da9.png" />

     

    image.png.d93838d4d0b7417ab0f8637e532080a9.png

     

    Please login or register to see this attachment.

    • Like 1
    • Thanks 1

    Share this post


    Link to post
    Share on other sites
    • 0

    btw

    Please login or register to see this link.

    Please login or register to see this link.

    !!!!!

    Please login or register to see this link.

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • Thanks, @10der. This is a little beyond what I was looking for. You seem to be grabbing Yr.no info directly from their web site. I was merely looking to decipher the variables and values available through the HC2 Yr plugin. I will look through the links you provided, though, to check that I have gotten it right. 

     

    • Like 1

    Share this post


    Link to post
    Share on other sites
    • 0

    I'm trying to program my fibaro so it sets the ventilation and cooling in the house as a function on the weather outside (and not just the local temperature). i was trying to use the fibaro api to get this data, but i'm in the funny situation that i get code 28, which is supposed to be partially cloudy but the weather condition text says cloudy. and the weather condition converted doesn't return anything. 

     

    either of you have any idea if things have changed since you last looked into this? i know the yr forecast was offline for a while. and i've read other posts that yahoo is and weatherunderground is no longer available... 

     

    any help you can offer would be wildly appreciated!!!

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • I can only add that I have implemented the decoding in a virtual device, where this is part of the code:

     

    local engTxt = fibaro:getValue (3"WeatherCondition")
    -- translate English "Yahoo texts" to Norwegian
    local weatherTxt={rain="regn",drizzle="yr",showers="regnbyger",snow="snø",sleet="sludd",foggy="tåke",cloudy="skyet",clear="klart",sunny="klart"}
    local norskTxt=weatherTxt[engTxt]
    if norskTxt==nil then norskTxt=engTxt end -- can't find the translation in weatherTxt

     

    Here, the first line gets the weather condition as a string from the Yr plugin, while lines 3 - 4 convert the result to Norwegian terms. The last line retains the English term if it is not found in my weatherTxt table (i.e. if it has returned a nil value), but so far this has not happened. 

    In conclusion, I am able to pick up relevant weather conditions from the Yr plug in. I do not use the code numbers, only the text. Good luck!

     

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • I will stick with "WeatherCondition" (text) rather than "ConditionCode" (numerical), but that is a matter of preference. Thanks for sharing documentation and giving us several options, @10der . I hope this resolves @sahan.jenny 's problem as well.

    Share this post


    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


    ×
    ×
    • Create New...