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

Pogoda w centralce


wojtas810

Question

Witam 

mam wersje 4.080 i dziwny problem 

Centralka od 5 dni pokazuje tą samą temperaturę 

1 stopień 

87% wilgotność 

0 km/h wiatr 

 

I nic się nie przestawia ani także nic się nie dzieje  z tym zmieniam lokalizację i także nic nie zasysa.

Robiłem restart i też nic. 

 

Ktoś miał podobny problem ?

co mogę zmienić ?

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

Please login or register to see this link.

 

Aby używać skrypt, który jutro tutaj wstawię, musisz uzyskać na portalu openweathermap indywidualny klucz tzw API KEY.

Bez tego skrypt nie będzie działał. Na jeden klucz można uzyskać ograniczoną liczbę "zwrotów" odczytanych parametrów pogody na dobę. Jeżeli dałbym swój klucz to skrypt szybko przestałby działać.

Link to comment
Share on other sites

  • 0

Umieść kod pod klawiszem VD:

 

( Należy uzupełnić dla każdego stanu pogody zmienną "kod" wykorzystując dane ConditionCode podane przeze mnie wyżej.)

 

Zamień API_KEY swoim kluczem uzyskanym z portalu openWeatherMap

Please login or register to see this code.

Link to comment
Share on other sites

  • 0

co tylko jest nieciekawe, ze openweathermap aktualizuje co niecale 2 godziny (czesto skanczylo juz dawo padac niczym doszla akzualizacja u mnie) w dostepie darmowym.

Link to comment
Share on other sites

  • 0

t

Please login or register to see this link.

Ja co 5 min otrzymuję inne wartości temperatury, wilgotności i prędkości wiatru. 

 

Ale te parametry nie muszą być brane z  OpenWeatherMap to może być również brane z Yahoo tylko też należy uzyskać indywidualny klucz API.

 

rejestr zmian logu:

 

[DEBUG] 11:47:02: "Temperature": 10, "Humidity": 61, "ConditionCode": 28, "Wind": 5
[DEBUG] 11:52:02: "Temperature": 11, "Humidity": 62, "ConditionCode": 44, "Wind": 4
[DEBUG] 11:57:02: "Temperature": 10, "Humidity": 61, "ConditionCode": 28, "Wind": 5

Link to comment
Share on other sites

  • 0

Jacek,

 

Super robota. Bardzo dziękuję. Pogoda aktualizuje mi się dla mojego miasta.

 

Mam jednak kilka pytań :

 

1. Jak odczytać zmiany logu Fibaro ?

 

2.  W Twoim kodzie masz :

 

if pogo == "Pochmurno z przejaśnieniami" then
kod = 44
elseif pogo == "Rozproszone chmury" then
kod = 28
elseif pogo == "Krótka ulewa" then
kod = 25
elseif pogo == "Bezchmurnie" then
kod = 36
else
kod = 0
end

 

Rozumiem, że wartość zmiennej pogo jest pobierana z openweathermap. Jakie są inne możliwe zwracane wartości pogo, tak żeby dopasowaćdo ikonek fibaro (jak w liście kodów kilka postów wyżej).

 

Na razie wstawiłem Twój kod bez uzupełnienia i inne wartości kodów i mam w Fibaro ikonkę trąby powietrznej - czyli VD nie otrzymał wartości zmiennej pogo z zakresu ("Pochmurno z przejaśnieniami", "Rozproszone chmury", "Krótka ulewa" , "Bezchmurnie")   i ustawił kod 0, i mamy obrazek trąby powietrznej.

 

3. Openweathermap podał prędkośćwiatru 8 m/s  a w Fibaro wyświetla 8 km/h  .  Jak to poprawić ?

Link to comment
Share on other sites

  • 0

Please login or register to see this link.

To jest właśnie to co pisałem, że będą się pojawiać nowe opisy warunków pogody jak np "Burza z wyładowaniami" i wtedy należy ten opis przyporządkować do obrazka z Fibaro o odpowiednim numerze ( w tym wypadku nr 47 ) i uzupełniamy kod w skrypcie tj.:

Please login or register to see this code.

Chyba , że ktoś wejdzie na api.openweathermap.org i poszuka wszystkich opisów pogody w języku polskim to ja uzupełnię je w skrypcie.

Aby poprawić m/s na km/h należy po prostu przeliczyć w skrypcie:

8 m/s to 0.008 km * 3600 s  = ~ 29 km/h

 

popraw w  skrypcie:

wiatr=math.floor(ajson.wind.speed * 3.6);

 

PS Ja tego nie zauważyłem !

Link to comment
Share on other sites

  • 0

Probowałem ściągnąć parametry z openweathermap dla kilku miast :

 

Please login or register to see this link.

 

I dostałem jeszcze kilka możliwych definicji zwracanej pogody :

 

"Umiarkowany descz"

 

"Lekki deszcz"

 

"Lekkie opady śniegu"

 

"Pochmurno"

 

"Lekkie zachmurzenie"

Link to comment
Share on other sites

  • 0

Wysłałem maila do wsparcia openweathermap.

 

Poprosiłem, żeby przysłali wszystkie możliwe opisy pogody po polsku.

 

Podzielę się jak coś od nich dostanę.

Link to comment
Share on other sites

  • 0

Please login or register to see this link.

Bardzo dobry pomysł. Myślę, że support pomoże.

Ja uzupełnię dane o w/w opisy:

 

  if pogo == "Pochmurno z przejaśnieniami" then

    kod = 44
  elseif pogo == "Rozproszone chmury" then
    kod = 28
  elseif pogo == "Krótka ulewa" then
    kod = 25
  elseif pogo == "Bezchmurnie" then
    kod = 36
  elseif pogo =="Umiarkowany deszcz" then
    kod = 8
  elseif pogo =="Lekki deszcz" then
    kod = 8
  elseif pogo =="Lekkie opady śniegu" then
    kod = 14
  elseif pogo =="Pochmurno" then
    kod = 26
  elseif pogo =="Lekkie zachmurzenie" then
    kod = 44
  else
    kod = 0
  end  
Link to comment
Share on other sites

  • 0

Wprowadzając kody od 0 do 50 pod parametr ConditionCode i wysyłając do HC2

 

r,s,e = VD:PUT("/api/devices", '{ "id": 3, "properties": { "ConditionCode": ' .. kod ..  '}}');

 

W HC2 ikony są w katalogu:

Please login or register to see this link.

 

ale brak uprawnień do czytania katalogu.

Link to comment
Share on other sites

  • 0

Pod jakiś klawisz VD podstaw:

kod = 0;

VD = Net.FHttp("127.0.0.1", 11111);

r,s,= VD:PUT("/api/devices", '{ "id": 3, "properties": { "ConditionCode": ' .. kod ..  '}}');

 

i tak kolejno zmieniaj tylko:

kod = 1;

kod = 2,

.

.

.

kod = 50;

 

po każdym wciśnięciu klawisza trzeba odświeżyć stronę.

Link to comment
Share on other sites

  • 0

YaHoo ConditionCode:

 

  • CONDITION CODES

    Condition codes are used in the yweather:forecast element to describe the current conditions.
    Code Description
    0 tornado
    1 tropical storm
    2 hurricane
    3 severe thunderstorms
    4 thunderstorms
    5 mixed rain and snow
    6 mixed rain and sleet
    7 mixed snow and sleet
    8 freezing drizzle
    9 drizzle
    10 freezing rain
    11 showers
    12 showers
    13 snow flurries
    14 light snow showers
    15 blowing snow
    16 snow
    17 hail
    18 sleet
    19 dust
    20 foggy
    21 haze
    22 smoky
    23 blustery
    24 windy
    25 cold
    26 cloudy
    27 mostly cloudy (night)
    28 mostly cloudy (day)
    29 partly cloudy (night)
    30 partly cloudy (day)
    31 clear (night)
    32 sunny
    33 fair (night)
    34 fair (day)
    35 mixed rain and hail
    36 hot
    37 isolated thunderstorms
    38 scattered thunderstorms
    39 scattered thunderstorms
    40 scattered showers
    41 heavy snow
    42 scattered snow showers
    43 heavy snow
    44 partly cloudy
    45 thundershowers
    46 snow showers
    47 isolated thundershowers

Link to comment
Share on other sites

  • 0

Na szybko porównałem kilka opisów z Twojej listy po polsku i z angielskiej listy Yahoo i wygląda, że numerki i opisy się zgadazają.

 

Może wystarczy tylko zmienić język w wywołaniu API z PL na ENG i wstawić do skryptu angielskie definicje i będzie hulać.

 

 

 

KOREKTA:  Trzeba będzie rozkminić, czy opeweathermap daje takie same komunikaty jak Yahoo.

Link to comment
Share on other sites

  • 0

Tak , kody zgadzają się bo Fibaro wzięło te kody pogody właśnie od Yahoo tylko ikony dorobili swoje.

Link to comment
Share on other sites

  • 0

Pojawiły mi się jeszcze opisy pogody od Yahoo :

 

"Bardzo silny deszcz"

 

"Intensywny deszcz"

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Jacku - super skryto mi działa - ale mma pytanie nie zmienia mi sie to na górze zamiast pogody fibaro 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • A nie przepraszam jedna pomyłka była

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> - Już wszystko ok 

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