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

YR Weather wisi , zamrozilo , nie dziala !!


JacekP

Question

Recommended Posts

  • 0

Faktycznie, mam ten sam problem.

Chyba coś musieli zmienić i nie działa moduł.

Coś się odblokowało i działa. ;)

Edited by XTeK
Link to comment
Share on other sites

  • 0

U mnie też to się wydarzyło, zgłosiliśmy problem, mam nadzieje ze uda sie dopchnąć do najblizszej wersji

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 3 minutes ago, A.Socha said:

    U mnie też to się wydarzyło, zgłosiliśmy problem, mam nadzieje ze uda sie dopchnąć do najblizszej wersji

    Dzieki !

    Link to comment
    Share on other sites

    • 0
    W dniu 3.03.2021 o 19:21, A.Socha napisał:

    U mnie też to się wydarzyło, zgłosiliśmy problem, mam nadzieje ze uda sie dopchnąć do najblizszej wersji

    Jak zawsze profesjonalista. Również dziękuję. :)

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 3/3/2021 at 7:21 PM, A.Socha said:

    U mnie też to się wydarzyło, zgłosiliśmy problem, mam nadzieje ze uda sie dopchnąć do najblizszej wersji

    jakies wiesci w temacie ? klienci zglaszaja problemy z temperatura w domu , za goraca !, moze jakis inny plugin ktory dziala. 

    Link to comment
    Share on other sites

    • 0

    Hello,

    I've restarted it several times, it doesn't work either.
    Is there a solution for sg?
    Thanks!

    Link to comment
    Share on other sites

    • 0

    @A.Socha

     

    yrWeather.lua

     

    line 92

     

    replace 1.9 with 2.0

     

    thats all, the 1.9 is EOL

     

    • Thanks 1
    Link to comment
    Share on other sites

    • 0

    alternative

     

    Please login or register to see this image.

    /monthly_2021_03/image.png.fd80d404e111683f5da41fbc9f8b0a91.png" />

    Please login or register to see this attachment.

    • Like 1
    • Thanks 1
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 37 minutes ago, kopek said:

    Thanks,

    do i just install it or import it and it works?

    I think its  for hc3 

     

    Link to comment
    Share on other sites

    • 0
    5 godzin temu, tinman napisał:

    @A.Socha

     

    yrWeather.lua

     

    line 92

     

    replace 1.9 with 2.0

     

    thats all, the 1.9 is EOL

     

    Yes They changed API, there is more change then URL. We will fix it to 5.070 for HC3/HC3L and in incoming update for HC2 and HCL

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @kopek If you are tired of waiting, find in the download section  virtual device  : Weather_VD.vfib , there is also a  step by step description how  to do that . It works for me since yesterday. 

    its not perfect but its better then nothing.

    only one  modyfication in orginal script, you have to do that  in lua code : fibaro:call(thisdevice, "setProperty", "ui.Label3.value", wiatr.." km/h ") ;
    because of some of the reason this line make a error 

     

    Edited by JacekP
    • Like 1
    Link to comment
    Share on other sites

    • 0

    hi JacekP,

     

     local city="Siklós"
      local country="hun" -- en, se, ....
      local api_key="6e7b48953dfed5f55c19bf8744d97daa" -- you can get your own API_KEY on this website:

    Please login or register to see this link.


      local lang = "en" -- en

     

    I registered for openweather, although not my town but 13 km from me.
    what needs to be improved "on this" line? unfortunately i am not at home in luaba ...

    Thanks

     

      fibaro:call(thisdevice, "setProperty", "ui.Label3.value", wiatr.."km/h");..kier_wiatru_tab[kier_wiatru_num]);

    I'm sorry, I'm in a hurry ...
    it will take a few hours for the API key to activate ... this may be the problem

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @kopek

     

    sorry for delay im abort so i have made few changes in this VirtualDevice

     

    direct ip address 
    another location method based on city codes 

     

    1 hour ago, kopek said:

    hi JacekP,

     

     local city="Siklós"
      local country="hun" -- en, se, ....
      local api_key="6e7b48953dfed5f55c19bf8744d97daa" -- you can get your own API_KEY on this website:

    Please login or register to see this link.


      local lang = "en" -- en

     

    I registered for openweather, although not my town but 13 km from me.
    what needs to be improved "on this" line? unfortunately i am not at home in luaba ...

    Thanks

     

      fibaro:call(thisdevice, "setProperty", "ui.Label3.value", wiatr.."km/h");..kier_wiatru_tab[kier_wiatru_num]);

    I'm sorry, I'm in a hurry ...
    it will take a few hours for the API key to activate ... this may be the problem

     

     

     

     

     

    -- Dane które MUSISZ zedytować!!!
    -- You must give your own data:

      local city="Szydłowiec"
      local country="Pl" -- en, se, ....
      local api_key= -- you can get your own API_KEY on this website:

    Please login or register to see this link.


      local lang = "Pl" -- en, se, ...
     
    -- Zmienne, które MOŻESZ zedytować (ale po co, skoro działa?)
    -- You can edit this:

      local delay_sekund = 600 

    -- Dalej już nie grzeb 
    -- You do not edit this:

    -- Authors: Jakub & Damian from polish part of forum.fibaro.com
    -- Thanks to Sztywniak 

      local thisdevice = fibaro:getSelfId() 
      local cHM = os.date("%H:%M"); 
      local sunRise = fibaro:getValue(1, "sunriseHour"); 
      local sunSet = fibaro:getValue(1, "sunsetHour"); 
      local noc = (cHM > sunSet or cHM < sunRise); 
      local weather_array = {[200] = 47, [201] = 45, [202] = 45, [210] = 38, [211] = 4, [212] = 3, [221] = 4, [230] = 9, [231] = 9, [232] = 9, [300] = 9, [301] = 9, [302] = 9, [310] = 11, [311] = 10, [312] = 6, [321] = 9, [500] = 40, [501] = 40, [502] = 12, [503] = 12, [504] = 12, [511] = 10, [520] = 12, [521] = 12, [522] = 12, [600] = 14, [601] = 16, [602] = 13, [611] = 5, [621] = 19, [701] = 21, [711] = 22, [721] = 20, [731] = 19, [741] = 21, [804] = 26, [900] = 0, [901] = 1, [902] = 2, [903] = 25, [904] = 36, [905] = 24, [906] = 17, [950] = 3200, [952] = 12, [953] = 12, [954] = 12, [955] = 12, [956] = 12, [957] = 24, [958] = 24, [959] = 2, [960] = 4, [961] = 4, [962] = 2, [800] = 32, [801] = 30, [802] = 30, [803] = 28, [951] = 34} 
      if noc then weather_array = {[800] = 31, [801]= 29, [802] = 29, [803] = 27, [951] = 33} end 
      local city = string.gsub(city," ","+"); 
    fibaro:debug (city);
    -- Łączymy się z OWM! 
    -- connect to OpenWeatherMap:

      OWM = Net.FHttp("188.166.16.132")  ---- ITS NEW !!! 

    danem, statusm = OWM:GET ("/data/2.5/weather?id=3045364&units=metric&appid=xxxxxxxxxxxx")---- ITS NEW 3045364 your CITY CODE is there alredy , xxxxxxxxx replace with your key!!! 
    --danem, statusm = OWM:GET("/data/2.5/weather?q="..city..","..country.."&units=metric&lang="..lang.."&APPID="..api_key) 
    fibaro:debug ( danem, statusm );
    if tonumber(statusm) < 300 then 
        ajson=json.decode(danem) 
        tempmin=math.floor(ajson.main.temp_min); 
        wilg=ajson.main.humidity 
        cisnienie=math.floor(ajson.main.pressure); 
        --wiatr=math.floor(ajson.wind.speed); -- w m/s 
        wiatr=math.floor(ajson.wind.speed * 3.6); -- w km/h 
        kier_wiatru=math.floor(ajson.wind.deg); 
        pogo=ajson.weather[1].description 
        miasto=ajson.name..", "..ajson.sys.country 
        pogoId=tonumber(ajson.weather[1].id); 
        tempmin = tonumber(tempmin .. ".00"); 
        wilg = tonumber(wilg .. ".00"); 
        wiatr = tonumber(wiatr .. ".00"); 
        kier_wiatru_num = math.floor(kier_wiatru / 45); 
        kier_wiatru_tab = {"N", "NE", "E", "SE", "S", "SW", "W", "NW"} 
        kod = weather_array[pogoId];
      --fibaro:debug (tempmin);
      --fibaro:debug (wilg);
      --fibaro:debug (cisnienie);
      --fibaro:debug (wiatr);
      --fibaro:debug (kier_wiatru);
       --fibaro:debug (pogo);
      --fibaro:debug ( pogoId) ;
      fibaro:debug ("kod" ..kod );
      
        if kod == nil then kod = 3200 end;
      

    -- Wyświetlanie na ekranie... Showtime! 
    -- Show data in VD:
    -- Najpierw w oknie Debug: 
    -- Show parameters in debug pool:
      fibaro:debug("Temperature :"  .. tempmin.. "Humidity :"  .. wilg ) --"ConditionCode :"  .. weather_array[pogoId])-- "Wind :"  .. wiatr ); 
    --Później w wirtualce, w określonych etykietach: 
    -- Write data to label of VD:
        fibaro:call(thisdevice, "setProperty", "ui.Label1.value", tempmin.." °C"); 
        fibaro:call(thisdevice, "setProperty", "ui.Label2.value", wilg.." %"); 
        fibaro:call(thisdevice, "setProperty", "ui.Label3.value", wiatr.." km/h ") --..kier_wiatru_tab[kier_wiatru_tab]); 
        fibaro:call(thisdevice, "setProperty", "ui.Label4.value", cisnienie.." hPa"); 
        fibaro:call(thisdevice, "setProperty", "ui.Label5.value", miasto); 
    -- A na koniec wpisanie do centrali, coby ładnie w smartfonie i w panelu www wyświetlało 
    -- Show in UI HC2 (browser)
        VD = Net.FHttp("127.0.0.1", 11111); 
        r,s,e = VD:PUT("/api/devices", '{ "id": 3, "properties": {"Temperature": ' .. tempmin .. ', "Humidity": ' .. wilg .. ', "ConditionCode": ' .. kod .. ', "Wind": ' .. wiatr .. '}}'); 
        if tonumber(e) == 0 then 
          fibaro:debug("Zmiana parametrów pogody Ok."); 
        else 
          fibaro:debug("Zmiana parametrów nie powiodła się !!!"); 
        end 
      else 
        fibaro:debug("Błąd odczytu strony OpenWeatherMap: #"..statusm); 
      end 
    fibaro:sleep( delay_sekund * 1000 )

     

     

     

    Please login or register to see this attachment.

    • Like 1
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @kopek

    Virtual device for your city looks like : 
    If you still have a problem just let mi know and send me your API key i will prepare VD for you.

     

    Edit : i found your API key . your virual device its ready for import

     

     

    Please login or register to see this attachment.

     

    Please login or register to see this attachment.

    Edited by JacekP
    • Like 1
    Link to comment
    Share on other sites

    • 0

    hi JacekP

    thank you very much for your help!
    by morning it already works with its own city.

     

    although it doesn't quite belong here, but could you give me some idea of what might be the reason I can't display a single icon.
    I've tried a lot already, also with the help of a forum and simply the small square appears in the corner with an invisible image

    a little bad feeling will take away that the simplest thing doesn't work (

    thank you kopek

     

    Please login or register to see this attachment.

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • its looks like problem with browser settings ( cache ) , try with other ( different ) browser. 

     

    Edited by JacekP
    Link to comment
    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...