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


Weather State & Forecast suite standalone 2.8.1

   (7 reviews)

1 Screenshot

About This File

Weather State & Forecast suite standalone

 

UPDATED USER MANUAL (09/10/2021)

I have updated user manual and added chapter 6.4 Weather Forecast global variable and how to read it

In this chapter users can find how to get forecast data and use this data in their code.

Please click on this link to download user manual:  SA WS VD and WF VD User manual v2.3EN.pdf

 

UPGRADE PROBLEM?

Please check upgrade instructions in User manual or below in version history.

 

INTRODUCTION

Weather state & forecast module enhance HC2 weather capabilities. Weather State & Forecast module in its latest version works with five most popular weather services:

  • OpenWeatherMap
  • Accu Weather NEW
  • WeatherBit
  • Weather HERE
  • Weather API NEW
  • Weather Underground NEW
  • Weather Underground PWS

 

bringing completely new level of weather experience to Fibaro Home Center 2 users.

 

PREREQUISITES

  • Fibaro Home Center 2 with firmware 4.160 or greater with installed Weather provider plugin set as main weather provider.

  • Sankotronic Lab Emoji VD standalone

  • User account for at least one of the available weather services

 

FEATURES

  • With Netatmo Weather station suite or Netatmo Public Weather station suite gives best support for Irrigation Control watering adjustment
  • Works with 7 most popular weather services on the planet
  • Regularly refreshes weather state and forecast
  • User can setup when forecast push and popup notifications will be sent same as e-mail with complete forecast
  • User can install more than one set of VD’s and follow weather for more than one place
  • It is now separated from Netatmo weather station but can still display Netatmo measurements (will be available only with UHAS version)
  • User can add additional sensor for lux and UV
  • Automatically finds weather provider plugin if installed and can then update weather on the HC2 web GUI and mobile applications
  • VD has built in multi-language support with 27 languages included (see APPENDIX 1 for the list). VD can use HC selected language or user can select any other available language. VD will automatically translate current weather and forecast data to selected language
  • Easy setup for VD icons. User can download HC2 Icon Preview VD to easily find icon ID numbers
  • Global variables are automatically added, monitored, repaired and cleaned and does not require user intervention
  • Supported are metric and imperial units for measured data. Wind speed can be set to show in meter per second (m/s) instead of km/h or mph

 

INSTALLATION AND UPGRADE

Please check provided User Manual

 

PACKAGE CONTENT

  • Weather State VD v2.8.1
  • Weather Forecast VD v2.8.1
  • Weather Module scene v2.8.1 (only one scene needed for multiple VD installed) 
  • Icon pack 1 - standard HC weather icons
  • Icon pack 2 - flat weather icons provided by Wunderground
  • User manual EN v2.2

 

TERMS AND CONDITIONS

Permission to use, copy, modify and distribute this software and its documentation for educational, research, personal use and non-profit purposes, without fee and without a signed licensing agreement is hereby granted, provided that the copyright notice, with "Terms and conditions" and "Disclaimer" appear in all copies, modifications and distributions. It is strictly forbidden to sell, rent, lease and/or lend this software for profit without prior consent from the Author.

 

DISCLAIMER

This software is provided by copyright owner "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author and distributor be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Fibar Group S.A. and their employees are not responsible for support of the ABC VD. Please contact the author Sankotronic, on the Fibaro Forum, for any questions or support required.

 

VERSION HISTORY

  • 2.8.1 - Weather Unlocked forecast extended for better support for Irrigation Control VD. Also corrected Weather API rain precipitation display
  • 2.8 - Added new weather services and resolved some bugs, see bellow or User Manual for more details.
  • 2.7.1 - Corrected bug that prevented using Wunderground, corrected day/night weather icons and other bugs.
  • 2.7 - Added scene for safe communication with weather servers. Added e-mail notifications. Added 3 more weather services and updated WU service... For more detailed list check bellow
  • 2.4 – VD completely redesigned and added openweathermap 5 day / 3 hour forecast. VD's update is synced to always have up to date weather info. Solved some more bugs
  • 2.3.1 – Solved bug with Weather State VD update button
  • 2.3 – First release on Fibaro marketplace

 

 

Edited by Sankotronic
Uploaded new User Manual v2.3


What's New in Version 2.8.1   See changelog

Released

Changes in version 2.8.1

  • Weather Unlocked daily and hourly forecast extended to 3 days to better serve Irrigation control watering adjustment. Changes are implemented in the scene

  • Weather API forecast corrected to show properly rain precipitation on Forecast VD and in notifications.

 

Upgrade from v2.8 to v2.8.1

  • Please download update package: Weather State and Forecast v2.8.1 standalone update.zip
  • Paste new scene and Weather Forecast code over the existing one
  • NOTE - this upgrade is necessary to be done before installing Irrigation Control VD

 

Upgrade from versions v2.7.1 and older to v2.8.1

  • Please download full package: Weather State and Forecast v2.8.1 standalone.zip
  • First delete both VD and then global variables: WeatherMain, WeatherMain_XX, WeatherState and WeatherFore   - NOTE - it is important to first delete VD and then global variables because if first global variables are deleted then will be recreated with running VD.
  • First paste new scene code over the old one
  • Import Weather State VD and setup
  • Run scene manually to find imported Weather State VD
  • Import Weather Forecast VD and setup

 

  • Like 12
  • Thanks 7


User Feedback

Recommended Comments

Works perfectly on the homescreen of the HC2. Can't seem to find examples on how to use the variables in LUA  for HC2? Can someone help me here?

Edited by Theo-Fibaro
Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi all,

 

In user manual page 35 to 39 is explained how to get readings from current weather state depending on weather service used.

 

First you need to read global variable and put it in some local storage like this in your code:

local wT=json.decode(fibaro:getGlobalValue("WeatherState"))

wT is a local storage to which we put all data from global variable "WeatherState" where VD's are storing data. Instead of using big number of global variables to store single value like for example temperature, I use one global to which I store all necessary data nicely sorted.

 

Next important setting is for station number which is setup in Weather State VD main loop. If you installed only one VD then you will have only station 1 available so next line of your code is this:

local stationNo = 1

Last important thing is to know what weather service you use and want to get information from. VD store all data in one global variable from all weather services and for all stations nicely sorted. For example, if you want to get outside temperature provided from OpenWeather service for station 1, that is achieved with this line of code:

local outside_temperature = wT.opn[stationNo].temp
if wT.opn[stationNo].temp<15 then -- close windows end

Tables in LUA are great way to store data and after easy fetch when needed. As you can see first two letters represent local variable in which you get data from global variable and dot represents next layer in the table:

 

wT.

 

Next 3 letters represent from which weather service you want data:

Weather serivce    3 letters
---------------------------
OpenWeather          opn
DarkSky              dks
WeatherBit           wbt
WeatherHere          whr
Wunderground         wdg
---------------------------

After 3 letters we define from which weather station we will read data eg. for DarkSky station 1:

 

wT.dks[1].  or   wT.dks[stationNo].

 

I recommend using local variable stationNo instead of numbers because it is much easier to change code to read from another station if needed by just changing line

 

local stationNo = 2

 

You can notice again one dot after square bracket and that dot represents next layer in the table and actually the final one. I believe I used quite logical names for this last step as for example to read temperature form DarkSky station 1:

 

local stationNo = 1

wT.dks[stationNo].temp

 

or humidity

 

wT.dks[stationNo].humid

 

or gust wind speed

 

wT.dks[stationNo].wind_gust

 

Hope this explains it. All available data is listed in user manual so please consult it to find what you need. Thank you for using Weather State & Forecast module

 

Enjoy coding :-) 

Link to comment
Share on other sites

Hi again

 

I tried to configure these sentences

 

local wT=json.decode(fibaro:getGlobalValue("WeatherState"))
local stationNo = 1
local outside_description = wT.opn[stationNo].desc
if wT.opn[stationNo].desc = 'Clear' then -- close windows end
fibaro:call(175, "setValue", "60");
end

 

But doesn't work.

 

Can you help me?

 

Thanks a lot

Link to comment
Share on other sites

I'm sorry

 

I configured this

 

local wT=json.decode(fibaro:getGlobalValue("WeatherState"))
local stationNo = 1
local outside_description = wT.opn[stationNo].w_desc
if wT.opn[stationNo].w_desc = "Cloud" then -- close windows end -- close windows end
fibaro:call(175, "setValue", "100");
end

 

But, the same result

 

 

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @cgarciamer ,

 

OpenWeather is using weather codes which you can find here: https://openweathermap.org/weather-conditions

 

and that condition is stored in wT.opn[stationNo].w_id. I don't recommend using weather description since it is different for different languages and is possible they change it over time.

 

if wT.opn[stationNo].w_id >= 500 and wT.opn[stationNo].w_id <= 622 then closeWindows() end

 

Above example of code will close windows on any rain and snow weather code.

 

 

Link to comment
Share on other sites

Hello @Sankotronic,

 

Yesterday I updated from version 2.4 to version 2.7.1.

No problems there ?

 

But after running the debug, in the scene, I get the this error message:

 

Knipsel.PNG.0a706fb2bf05453b22da3247a17ead17.PNG

 

How can I solve this?

May this error also be the reason why I don't see weather State mentioned in the Weather provider app?

 

Many thanks in advance for your help.

Edited by Erik050572
Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @Erik050572 ,

 

Second debug line tells you that scene found some remaining data from the old Weather State VD but the old VD does not have WeatherMain_21 global variable because this is feature of the new version. If it appears again just delete WeatherMain global and Weather State VD should rebuild it.

 

Fourth debug line is expected and normal when scene is run manually. This is because scene is expecting to get ID of the VD that started scene so scene can find out which weather service to use and where to store data.

 

 

Link to comment
Share on other sites

Hi Sankotronic

 

I want tell you ery good job. I want show you my scene

 

--[[
%% properties
%% weather
WeatherState
%% events
%% globals
--]]

local wT=json.decode(fibaro:getGlobalValue("WeatherState"))
local stationNo = 1
local outside_temperature = wT.opn[stationNo].w_id
if tonumber (wT.opn[stationNo].w_id) >= 800 and wT.opn[stationNo].w_id <= 804
then
    fibaro:call(175,"setValue","open");
end

 

 

Bu does'nt work. I tried this

 

--[[
%% properties
%% weather
%% events
%% globals
--]]

local wT=json.decode(fibaro:getGlobalValue("WeatherState"))
local stationNo = 1
local outside_temperature = wT.opn[stationNo].w_id
wT.opn[stationNo].w_id >= 800 and wT.opn[stationNo].w_id <= 804
then
    fibaro:call(175,"setValue","open");
end

 

But does'nt work too.

 

Thanks a lot for your help

 

 

 

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @Erik050572 ,

 

Thank you for using Weather State & Forecast VD. Thank you also for suggestion to add more weather providers. Unfortunately none of the above weather providers you mention offer JSON API which is necessary to integrate with HC2 and FREE of charge for personal use.

 

I will continue to search for weather providers that offer JSON API and FREE account for personal use and if found any will add them in next release.

 

Link to comment
Share on other sites

Did I understand correctly from the description that you can’t use this plugin only for Netatmo? How can I then transfer weather data to Weather State?

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @Arnold ,

 

Unfortunately due to bug in code connection between Netatmo Weather station VD and Weather State VD does not work properly. I'm preparing new version which will work properly and it will be possible to setup both VD's to interact so that Weather State VD can show Netatmo Weather station measurements and also then Netatmo Main base module VD which is taking care that all data is regularly updated will also take care to update linked Weather State and Forecast VD's so that everything is properly synchronized.

 

I do have such solution done for UHAS just need some time to convert it to standalone version. Since I'm very busy with UHAS I can't now say when standalone new version will be available.

 

Link to comment
Share on other sites

Hi @Sankotronic,

 

please help me. I have tried use your VD for sync my HC2 with my WeatherUnderground account, but it didn't work.

 

I tried it so:

- (I have HC2 with SW4.580)

- I have installed Weather Provider plug-in and adden as VD and set it as default weather provider

- I have imported Weather State VD and I made the settings in main loop as in the user manual

- I have overwitten the Update button with WS Update button v2.7.2 SA.txt

- I have intalled and run WEATHER MODULE SCENE

- I choose WU as weather service and I confirm it and I became the green checkmark:

image.png.8117236ea0138e9c18b2a0a2cc8173df.png

 

-then I click the Update button and it didn't sync with WU:

image.png.62a7df664dd835d5f9ffac498cb9f2cb.png

 

What did I do wrong?

 

I did not find in the User Manual how to set up weather provider VD. Default is by me --- and I can't find in the drop-down menu "weather State"

image.png.2042e6a8fdd650adc3eb16457eb02ffa.png

Is it OK? Is it the proble? How can I fix it?

 

-Main loop Debug didn't show any errors

image.png.3c15f74d5eca4b9c51f3639c2176bd98.png

- Update Button Debug shows:

image.png.ebd5dcf24f559fc8b6830e9abdde0a51.png

 

-Scene debug shows:

image.png.3ba5feaaccca14e51df5111905f892ca.png

and

image.png.537ed6c414dcd011ba00cf3f0e37e4d3.png

 

WU Station ID and API key is correct.

 

What do I wrong? Please help.

Thanks!

 

Rozsó

 

 

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @Rozso2 ,

 

On 3/23/2020 at 6:12 PM, Rozso2 said:

-Scene debug shows:

image.png.3ba5feaaccca14e51df5111905f892ca.png

 

If scene is run manually then that ERROR is show because scene does not get which weather service to connect to and get data. Error message is a bit misleading and I will correct it in next release, but it is expected. Only if scene is called by Weather State VD that error should not be seen expect if weather service api key or other necessary data is missing. I can see now that wunderground settings is not properly checked as from your next screenshot:

 

On 3/23/2020 at 6:12 PM, Rozso2 said:

and

image.png.537ed6c414dcd011ba00cf3f0e37e4d3.png

 

I have checked and found that I get same error if wdg_stationID is not setup properly in Weather State VD main loop code. Wunderground service can be used only by users that have their own PWS (Personal Weather Station) registered with wunderground.com and station ID must be setup even if user enter wrong name, but should not leave it empty. This is of course case if you do have correct API key from wunderground. If you do not have proper API key then first you need to register your PWS with wunderground and get proper API key for this to function properly.

 

On 3/23/2020 at 6:12 PM, Rozso2 said:

-Main loop Debug didn't show any errors

image.png.3c15f74d5eca4b9c51f3639c2176bd98.png

 

This is normal debug window for Weather State VD between two updates.

 

On 3/23/2020 at 6:12 PM, Rozso2 said:

- Update Button Debug shows:

image.png.ebd5dcf24f559fc8b6830e9abdde0a51.png

 

As i can see from this part of debug window you have properly setup Weather provider plugin and it is found by Weather State VD. Error that you can see is also expected since scene didn't manage to get data from wunderground servers.

 

You can always find more information in provided User manual for Weather State VD.

 

Enjoy coding ?

Link to comment
Share on other sites

Hi ,@Sankotronic

 

thank for your answer.

In your answer I can read, that the only problem is, that the API key from wunderground is not correct in the Main loop.

But it is correct. 

image.png.58f33a1f5801599f6fc8b55656f76a7a.png

 

The same StationID use I in my phone app and in the phone app works.

Has you another idea, why it didn't work?

 

Thanks.

 

Rozsó

 

21 minutes ago, Sankotronic said:

Hi @Rozso2 ,

 

 

If scene is run manually then that ERROR is show because scene does not get which weather service to connect to and get data. Error message is a bit misleading and I will correct it in next release, but it is expected. Only if scene is called by Weather State VD that error should not be seen expect if weather service api key or other necessary data is missing. I can see now that wunderground settings is not properly checked as from your next screenshot:

 

 

I have checked and found that I get same error if wdg_stationID is not setup properly in Weather State VD main loop code. Wunderground service can be used only by users that have their own PWS (Personal Weather Station) registered with wunderground.com and station ID must be setup even if user enter wrong name, but should not leave it empty. This is of course case if you do have correct API key from wunderground. If you do not have proper API key then first you need to register your PWS with wunderground and get proper API key for this to function properly.

 

 

This is normal debug window for Weather State VD between two updates.

 

 

As i can see from this part of debug window you have properly setup Weather provider plugin and it is found by Weather State VD. Error that you can see is also expected since scene didn't manage to get data from wunderground servers.

 

You can always find more information in provided User manual for Weather State VD.

 

Enjoy coding ?

 

Link to comment
Share on other sites

Guest Sankotronic

Posted

2 minutes ago, Rozso2 said:

thank for your answer.

In your answer I can read, that the only problem is, that the API key from wunderground is not correct in the Main loop.

But it is correct. 

image.png.58f33a1f5801599f6fc8b55656f76a7a.png

 

The same StationID use I in my phone app and in the phone app works.

Has you another idea, why it didn't work?

 

Hi @Rozso2 ,

 

Seeing that short wdg_key I believe you are using station Key or password on place where you should use wunderground API key. These two keys are not same. Station password is used to connect your PWS to wunderground while API key is used to enable other devices to connect to wundeground API and get weather data.

 

I just checked User manual that I provided and I can see that I didn't explain more than just how to connect Netatmo station using Meteoware Plus site, but no details how to get wundeground API key. Sorry for that.

 

So you need to login to wunderground and to go to your profile. There is tab called API KEY just next to the tab called MY DEVICES. So on tab API KEY you will find it and copy it to the Weather State VD main loop settings. See picture below:

Spoiler

86491116_WundergAPIsettings.thumb.png.0a3318e0c217e56f22ed3fc3ad2ec634.png

 

 

 

Link to comment
Share on other sites

Guest Sankotronic

Posted

I'm always happy to help! If there is anything else just let me know.

 

Be safe and enjoy! :-)

Link to comment
Share on other sites

Hi.
I think there is a small bug in the Standalone Weather State & Forecast scene version 1.1.1
The log file shows this:

Quote

[DEBUG] 20:42:42: Standalone Weather State & Forecast scene version 1.1.1 - (c) 2019 Sankotronic
[DEBUG] 20:42:42: Scene run by VD [1145] Weather State v2.7.1 in room Unassigned
[DEBUG] 20:42:42: Weather service "OpenWeatherMap.org" station No [1] Units metric
[DEBUG] 20:42:44: OpenWeather current weather retrieved
[DEBUG] 20:42:44: 2020-06-14 20:42:44.541982 [ fatal] LUA error: /opt/fibaro/scenes/81.lua:427: attempt to perform arithmetic on field 'visibility' (a nil value)

the line in lua looks like this:
Line 427:

Quote

  wT.opn[sNo].visibility=string.format('%.0f',jW.visibility/1000)

I changed it to:

Quote

  if jW.visibility ~=nil then wT.opn[sNo].visibility=string.format('%.0f',jW.visibility/1000) else wT.opn[sNo].visibility = "NIL" end

which seems to work.
Could you please verify this?

... and thanks for this forecast scene ;-)
best regards
Jürgen

Edited by pflugj
Link to comment
Share on other sites

Thanks for great module. Is it possible to use my own wind speed data from my own wind speed sensor which I already have installed on my HC2? It is not Netatmo, I have analog wind speed sensor which is connected to Fibaro Smart Implant and then Smart Implant show me actual and real time wind speed.

Thanks!

Link to comment
Share on other sites

Hi!

 

For the last couple of days, I'm getting an error message from the irrigation module, that the weather data is too old:

 

⚠️Current weather data is too old Was last updated at 09.08.2021

I'm using Weather unlocked - daily. On the VD update button, the debug shows, that weather ID is 0:

[DEBUG] 10:25:12: [10.08.21]: Weather ID: 0, Temperature: 27.4, Humidity: 52, ConditionCode: 32

 

If I switch to another weather service, I get normal weather ID and there's no issue with the irrigation module.

 

[DEBUG] 10:27:05: [10.08.21]: Weather ID: 800, Temperature: 27.6, Humidity: 49, ConditionCode: 32

 

Is there a problem with Weather unlocked, or the problem is within the VD?

 

Link to comment
Share on other sites

Hi 

I don't know why this happens to me. Must do something  stupid.

 I have installed version 2.8.1 and had no problems doing so. However if i run the debug (main) I get an error"  ERROR server returned no key" I have done the setup for wunderground with a propper ID and key. and selected in the user interface also wunderground.

Has anybody else had this problem or does anybody know what I did wrong?

 

thanks

Debugs.doc

Link to comment
Share on other sites

Hello @Voordeh,

 

Sorry for late answer. This ERROR is nothing to worry about. When Weather State VD is restarted it tries to get location for AccuWeather which you do not use.

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
Add a comment...

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