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


Netatmo Weather Station suite standalone 3.4

   (4 reviews)

1 Screenshot

About This File

Netatmo Weather Station suite standalone v3.4

 

INTRODUCTION

Netatmo Weather station suite brings complete integration of Netatmo weather station to HC2 users including rain and wind gauges and support for more than one station.

 

PREREQUISITES

  • Fibaro Home Center 2 with firmware 4.160 or greater

  • Sankotronic Lab. Emoji VD standalone (not required since v3.4)

  • Netatmo Weather station

 

FEATURES

  • Complete integration of Netatmo weather station with HC2 including rain gauge and anemometer

  • Support for multiple Netatmo weather stations

  • Support for maximum 3 additional indoor modules

  • Smart update system that follows Netatmo weather station cloud updates

  • Completely independent installation does not require any more Weather State VD or Main scene FTBE

  • Netatmo weather station measurements can be shown on Weather State VD and HC2 web GUI and mobile applications by means of Weather State VD and Weather

    provider plugin

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

  • Easy setup for VD icons (on UHASTM compatible version is this even easier)

  • Global variables are automatically added, monitored and repaired and does not require user intervention

 

INSTALLATION

Please check provided User Manual and video from @MarcoTorino71:

 

PACKAGE CONTENT

  • Netatmo Main module VD
  • Netatmo Outdoor module VD
  • Netatmo Additional indoor module VD
  • Netatmo Wind sensor VD
  • Netatmo Rain sensor VD
  • Netatmo Weather station scene
  • Set of icons for all VD's and scene

 

UPRADE PACKAGE CONTENT

  • Netatmo Main module VD main loop and update button new code
  • Netatmo Outdoor module VD main loop and update button new code
  • Netatmo Additional indoor module VD main loop and update button new code
  • Netatmo Wind sensor VD main loop and update button new code
  • Netatmo Rain sensor VD main loop and update button new code
  • Netatmo Weather station scene

 

NOTE - User manual is now provided as separate download.

 

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

  • 3.4 - Scene code changed to use new Netatmo API grant access by replacing username and password with tokens. All VD's since v3.4 do not need Emoji VD to be installed to work properly.
  • 3.3.1 - Scene code changed to get rain amount for past 3 adn 6 hours to better support Irrigation Control VD. All VD's corrected some translations. Rain gauge VD changed labels content to display last 3 hours rain amount
  • 3.3 - Check below version description or consult User manual for more details
  • 3.2 - Corrected rain sensor code and cleaned some bugs in scene. Indoor modules corrected handling of CO2 measurement, improved updating code.
  • 3.0 – This new version is completely redesigned and made independent. Does not require Main scene FTBE and Weather State VD anymore. Updating is now synced with Netatmo cloud so readings are always up to date.
  • 2.0.2 – Code optimized and resolved some bugs
 

Here is look of the Netatmo Weather set:

2133744657_NetatmoWeatherstationsuite.thumb.png.5ff41148a5091a5a3b2b657b3f7371ad.png

 

Enjoy coding and your new Netatmo weather station suite! :-)

Sankotronic

 

Edited by Sankotronic
Uploaded new version 3.4


What's New in Version 3.4   See changelog

Released

Changes in version 3.4

  • Scene code changed to use new Netatmo API grant access credentials with access and refresh tokens instead of username and password

  • All VD update buttons removed usage of Emoji database to work without needing to install Emoji VD

  • All VD main loops updated to reflect new version with minor corrections.

 

Upgrade instructions from any previous version to v3.4

  • Please download upgrade package: Netatmo Weather Station suite v3.4 standalone upgrade.zip
  • Paste new scene code over the old one. Reenter credentials and station MAC ID and save. Manually runs scene at least once to save settings. Instructions how to get tokens you can find in user manual.
  • Paste new main loop code on all VD's. Reenter settings and save
  • Paste new Update button code on all VD's and save.
  • Like 22
  • Thanks 10


User Feedback

Recommended Comments



@Sankotronic thanks for this

Working great with my HC2 and Netatmo Weather Station+Wind&Rain

I have a few questions:

1.Did i add Netatmo temp&hum to the main room temp&hum.

2.Did you explain me how to make a scenes with VD,like : if rain is ... then sprinklers off

                                                                                                    : it temp is .... then AC is On/Off

 

Thanks a lot 

And thank you with your work here !

Edited by Petar Mladenov
Link to comment
Share on other sites

[DEBUG] 00:11:10: 2019-08-24 00:11:10.808135 [ fatal] Unknown exception: /opt/fibaro/scenes/8.lua:101: attempt to concatenate local 'room' (a nil value)

 

I tried to resolve but failed devices are not updating :(

Zrzut ekranu 2019-08-26 o 00.40.50.jpg

Edited by loopez
Link to comment
Share on other sites

Guest Sankotronic

Posted

On 8/24/2019 at 12:27 AM, loopez said:

[DEBUG] 00:11:10: 2019-08-24 00:11:10.808135 [ fatal] Unknown exception: /opt/fibaro/scenes/8.lua:101: attempt to concatenate local 'room' (a nil value)

 

I tried to resolve but failed devices are not updating :(

 

 

Hi @@loopez ,

 

Please move all virtual devices from Unassigned room to room where you like them to be. I have made special room that I call Weather Station and I keep all weather related stuff there on one place.

 

Above screenshot from scene is result when Home Center is not connected to internet.

 

Link to comment
Share on other sites

Hello,

 

Thanks for your VD's, there great.

My question is: "How can I get the data 'windgust max' into a variable?" (Lua)

Because I want to use the 'windgust max' for my awning. If the wind gust max is greater than 30 km / h, I want my awning to take effect.

Hopefully you can help me.

 

Greetz John 

Link to comment
Share on other sites

Hi @Sankotronic, I think I found a bug, that came up because of another issue :) I have 1xWS + 1xOutdoor module + 2xIndoor modules; I installed the VDs and the scene as per the manual and it was working for some time. Then, at one moment, without any changes made, I got the following message and all updates stopped:

[DEBUG] 19:35:58: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic
[DEBUG] 19:35:58: Scene run by [140] Climate Livingroom in room Livingroom
[DEBUG] 19:35:58: netatmo-oAuth connected...
[DEBUG] 19:35:58: Found Netatmo weather base station No. 1 Name 'Yavorov'
[DEBUG] 19:35:59: Outdoor module found. Battery level: 72
[DEBUG] 19:35:59: 2019-09-22 19:35:59.077676 [ fatal] LUA error: /opt/fibaro/scenes/17.lua:220: attempt to index field 'dashboard_data' (a nil value)

I decided it was because of an issue with my configuration and started troubleshooting it. Then I logged on to the Netatmo web interface and saw that my Outdoor module got missing for whatever reason. And then I saw this line here:

Last data measured per device (NB: this field is not returned when the device is unreachable)

So, obviously, when the sensor is missing, there is no data returned, which stops the execution of your WS scene. If we can bypass this error, it would be great, otherwise all updates are omitted. 

 

Thanks and regards!

Link to comment
Share on other sites

Guest Sankotronic

Posted

On 9/22/2019 at 11:16 AM, Johnnyboy said:

Hello,

 

Thanks for your VD's, there great.

My question is: "How can I get the data 'windgust max' into a variable?" (Lua)

Because I want to use the 'windgust max' for my awning. If the wind gust max is greater than 30 km / h, I want my awning to take effect.

Hopefully you can help me.

 

Greetz John 

 

Hello @Johnnyboy ,

 

There is explanation how to read Netatmo station data in user manual page 22 to 23

 

In your code first you need to get data from global variable with this line of code to temporarily store it in local variable from which then you read any data you need:

wT=json.decode(fibaro:getGlobalValue("NetatmoWeather"))

Netatmo station module is storing data in global variable with name "NetatmoWeather". Next step is to define for which station you will read data. This is available because my Netatmo weather station module supports more than one Netatmo station. In most cases users have only one station so next line of code is:

local stationNo = 1

 

Now when you have read global variable and defined station you can get all data that is avaliable. For example to read gust wind speed from wind sensor compare it to some value and do some action you use this line of code:

if wT.netatmo[stationNo].wind.gust > 30 then 
  -- close windows, lower blinds etc.
end

 

To check if it is raining to close window or postpone watering of garden:

-- if amount of rain in last hour is more than zero
if wT.netatmo[stationNo].rain.hour > 0 then
  -- close windows, postpone watering etc.
end

-- if amount of rain is more than 20 mm in last 24 hours
if wT.netatmo[stationNo].rain.day > 20 then
  -- postpone watering for 24 h
end

 

To check if CO2 level is too high to start ventilation:

-- if CO2 level measured by MAIN BASE indoor module is greater than 1800 ppm then start ventilation
if wT.netatmo[stationNo].co2 > 1800 then
  -- code to start ventilation
end

 

Each Netatmo station can have 3 additional indoor modules attached. To read from add. indoor module 1 use this code:

local stationNo = 1
local moduleNo = 1
-- ifCO2 level measured by ADDITIONAL indoor module no 1 is greater than 1800 ppm open the windows
if wT.netatmo[stationNo].intm[moduleNo].co2 > 1800 then
  -- code to open windows
end

 

Hope this will help you to make some really cool code! 

 

Enjoy coding :-) 

 

Link to comment
Share on other sites

Thank yoo! Just what I needed.

 

I made a code, but i don't know if it works:  

--------------------------------------------------

--[[
%% autostart
%% properties
331 value
%% events
%% globals
--]]

local startSource = fibaro:getSourceTrigger();

wT=json.decode(fibaro:getGlobalValue("NetatmoWeather"))
local stationNo = 1
Fibaro:debug("De snelheid van de windvlagen is " ..wt.netatmo[stationNo].wind.gust..  " km/h")

if wT.netatmo[stationNo].wind.gust > 22 and tonumber(fibaro:getValue(331, "value")) ~= 0 or startSource["type"] == "other" 
then fibaro:call(331, "setValue", "0");
        fibaro:call(425, "sendDefinedPushNotification", "94");
        fibaro:call(479, "sendDefinedPushNotification", "94");
        --Bij wind harder dan 22 km/h zonnescherm dicht doen.
  elseif wT.netatmo[stationNo].wind.gust > 20 and tonumber(fibaro:getValue(331, "value")) > 50 or startSource["type"] == "other"
  then fibaro:call(331, "setValue", "50");
    elseif wT.netatmo[stationNo].wind.gust > 18 and tonumber(fibaro:getValue(331, "value")) > 60 or startSource["type"] == "other"
    then fibaro:call(331, "setValue", "60");
        elseif wT.netatmo[stationNo].wind.gust > 16 and tonumber(fibaro:getValue(331, "value")) > 70 or startSource["type"] == "other"
        then fibaro:call(331, "setValue", "70");
            elseif wT.netatmo[stationNo].wind.gust > 14 and tonumber(fibaro:getValue(331, "value")) > 80 or startSource["type"] == "other"
            then fibaro:call(331, "setValue", "80");
                elseif wT.netatmo[stationNo].wind.gust < 12 and tonumber(fibaro:getValue(331, "value")) > 90 or startSource["type"] == "other"
                then fibaro:call(331, "setValue", "90");
                    elseif wT.netatmo[stationNo].wind.gust <= 10 and tonumber(fibaro:getValue(331, "value")) >= 99 or startSource["type"] == "other"
                    then fibaro:call(331, "setValue", "99");
end

 ---------------------------------------------------------------

Can you help me to make it working?

 

Greetz John 

 


Link to comment
Share on other sites

hi I have managed to add the latest netatmo standalone vd and scene and all work fine except the fibaro weather gui not getting the data.

Debug and test of VD and scene all work as expected.

Do i miss something to allow Fibaro web gui show netatmo readings?

 

thanks

Link to comment
Share on other sites

Guest Sankotronic

Posted

On 10/17/2019 at 10:56 PM, fadunis said:

hi I have managed to add the latest netatmo standalone vd and scene and all work fine except the fibaro weather gui not getting the data.

Debug and test of VD and scene all work as expected.

Do i miss something to allow Fibaro web gui show netatmo readings?

 

thanks

 

Hi @fadunis ,

 

You need to install Weather provider plugin and make it as default weather provider in HC2 Configuration panel and don't make it hidden. Only after that Netatmo Weather station Main VD will find it and use it to update weather on HC2 home web page and mobile apps.

 

Link to comment
Share on other sites

Hi,

 

any ideas what could be the problem if vd icons didnt't change. I only get main icon. It should be green with 866 ppm.  If i set main_icon to 1174 (green) i get a green one, so the icon is ok.

 

I only have the main icon with all vd's (indoor and outdoor). I didn't get it. ?

 

image.thumb.png.658a61946ad29f98e17eee85117bf482.png

Link to comment
Share on other sites

Hi Sanko,

 

Thanks for the nice and very useful VD.

I got it working.

However the return of the name of the base station = NIL

Q1 What can be the reason and how do I fix this?

[DEBUG] 10:52:32: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic
[DEBUG] 10:52:33: Scene run by [1752] Basis Netatmo in room s-----er
[DEBUG] 10:52:40: netatmo-oAuth connected...
[DEBUG] 10:52:41: Found Netatmo weather base station No. 1 Name 'nil'
[DEBUG] 10:52:41: C---------- additional indoor module found. Battery level: 100
[DEBUG] 10:52:43: L----sen module found. Battery level: 100
[DEBUG] 10:52:43: G---nkamer additional indoor module found. Battery level: 100

 

 

Link to comment
Share on other sites

Hi,

 

Did everything like in the manual but it just wont connect.

it gets stuck in:

 

[DEBUG] 15:55:47: Scene run by [503] SA Base station v3.1 in room Elutuba
[DEBUG] 15:56:48: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic
[DEBUG] 15:56:48: Scene run by [503] SA Base station v3.1 in room Elutuba
[DEBUG] 15:57:49: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic
[DEBUG] 15:57:49: Scene run by [503] SA Base station v3.1 in room Elutuba
 

I have internet connection and original Netatmo plugin works fine. Any ideas?

 

Link to comment
Share on other sites

Hi Sanko,

Thanks for the nice and very useful VD.

Having problems to get a reading of the Outdoor Temp, “Temp_Min” and “Temp_Max” is showing correct values.

[DEBUG] 16:56:10: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic

[DEBUG] 16:56:11: Get response data decoded

[DEBUG] 16:56:11: netatmo-oAuth connected...

[DEBUG] 16:56:11: Get response data decoded

[DEBUG] 16:56:11: Found Netatmo weather base station No. 1 Name 'Bratsbergflata 21 (Hovedenhet)'

[DEBUG] 16:56:11: Searching for Wind, Rain, Outdoor and Indoor modules data...

[DEBUG] 16:56:11: Outdoor module found. Battery level: 42

[DEBUG] 16:56:12: 2021-02-18 16:56:12.015543 [ fatal] LUA error: /opt/fibaro/scenes/93.lua:233: attempt to perform arithmetic on field 'last_message' (a nil value)_message' (a nil value)

 

Any ideas?

 

Capture.PNG

Link to comment
Share on other sites

On 2/18/2021 at 5:06 PM, ReidarMathisen said:

[DEBUG] 16:56:12: 2021-02-18 16:56:12.015543 [ fatal] LUA error: /opt/fibaro/scenes/93.lua:233: attempt to perform arithmetic on field 'last_message' (a nil value)_message' (a nil value)

 

Hi @ReidarMathisen,

 

Error that you reported is caused by Wind sensor. Wind sensor does not report when was last connected to main module and sent its data. I have never encountered such error or at least noticed it. Usually when device like wind sensor was not connected for more than 30 minutes this can be read from 'last_message' value. Can you please check status of your wind sensor with Netatmo app next time when this happen again? If wind sensor really didn't contact main module for longer time then that will be also reported in Netatmo app.

 

 

Link to comment
Share on other sites

On 12/16/2020 at 3:03 PM, kerttll said:

Did everything like in the manual but it just wont connect.

it gets stuck in:

 

[DEBUG] 15:55:47: Scene run by [503] SA Base station v3.1 in room Elutuba
[DEBUG] 15:56:48: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic
[DEBUG] 15:56:48: Scene run by [503] SA Base station v3.1 in room Elutuba
[DEBUG] 15:57:49: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic
[DEBUG] 15:57:49: Scene run by [503] SA Base station v3.1 in room Elutuba
I have internet connection and original Netatmo plugin works fine. Any ideas?

 

Hi @kerttll,

 

sorry for late replay. You need to check your credentials settings. Scene does check if client_id, client_secret, username and password are populated by user, but can't check if they are populated correctly. Focus on client_id, client_secret, username and password that are all correctly entered. If there is only one character wrong it will give you debug as the one you provided.

 

Link to comment
Share on other sites

Hi

 

I have just started to use Netatmo and your great VD.

But I canot get it to work, it keeps locking my account on the Netatmo side.

 

I have entered some extra debug lines and I get this as a response message in the function getResponseData

 

[DEBUG] 08:31:43: Standalone Netatmo weather scene version 3.2 - (c) 2018-19 Sankotronic
[DEBUG] 08:31:43: Message: /usr/share/lua/5.2/json/decode/util.lua:35: unexpected character @ character: 1 0:1 [H] line:

 

Any ideas what can cause this?

 

//Lasse

Link to comment
Share on other sites

Hi,

 

great jobs! Everything works perfectly, but there is a bug on the translation. It works fine for the main module, but for the outdoor module and the additional indoor module is always in english.

 

  • Thanks 1
Link to comment
Share on other sites

Hello,

lua runs up to me, but unfortunately doesn't show me the others.

 

image.thumb.png.1ffcc3cce0f30105b04c4bb11a5fa4a3.png

 

[ERROR] 15:54:21: line 21: bad argument # 1 to "decode" (expected string, zero)

Link to comment
Share on other sites

Nothing is displayed for me. Does the Fibaro plug-in have to be uninstalled, or is it possibly because I am using another VD for the wind meter?

 

Screenshot 2021-12-05 160830.jpg

Screenshot 2021-12-05 161043.jpg

Screenshot 2021-12-05 160953.jpg

Screenshot 2021-12-05 160904.jpg

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