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


Recommended Posts

Posted

Hi,

I have just bought a Fibaro HC3 and I would like to get the wind speed from my WeeWx weather-station.

Can anyone help me how I can get the the windspeed from the feed from the station.

Every 5 minutes this url is updated: 

Please login or register to see this link.

The wind is in the first item and in description Wind:

 

Your help would be appreciated!!

 

Peter

Posted

i would probably install json output formater ( 

Please login or register to see this link.

) and read the the nicely formated data on HC3, instead of formating the xml / rss on HC3 (which can work as well, but extra  point of failure).

 

 

Posted (edited)

... and then try attached simple QuickApp. It will show (i think, i don't have WeeWx so tested with offline data) wind speed and rain rate, and the rain detector (if rain rate > 0) can be used as kind of alarm thing.

 

Please login or register to see this image.

/monthly_2021_07/image.png.774d587ce76be8d0ba43dcaecd2f06da.png" />

 

updated version v0.2 with support for user:password basic auth (leave QA variables default if you don't need authentication)

 

Please login or register to see this attachment.

 

Please login or register to see this attachment.

 

Edited by tinman
  • Thanks 1
  • Topic Author
  • Posted

    Thank you tinman! I will see if I can do something. I do not have any LUA experience but I will have to do it the hard way.. Start from scratch.

    I see you have developed a QuickApp for Davis WeatherLink Live. I have a Davis so easiest might be to buy a weatherlink Live and your QuickApp.

     

    Peter

  • Topic Author
  • Posted

    Thanks again tinman!!

    I will try to use the LUA code you wrote and also to install the JSON on my WeeWx server.

     

    Peter

    Posted (edited)
    41 minutes ago, JPS said:

    Thank you tinman! I will see if I can do something. I do not have any LUA experience but I will have to do it the hard way.. Start from scratch.

     

    you don't have to know LUA, you might ask here in forum

     

    The QuickApp is ready to use, once you installed the weewx json formater, the output data should be then like:

     

    Please login or register to see this code.

     

    and the Quick App will format it once you enter the IP or URL ( www.pcsundin.se/weather ).

    The QuickApp will look for "weewx.json" on the webserver (which will be generated once you installed that weewx json formater), however you can change that if necessary, the line in QuickApp code is 120

     

    Please login or register to see this image.

    /monthly_2021_07/image.png.f89c2b09dec8a9b085bb681273ac60bd.png" />

     

    That's all actually.

     

    41 minutes ago, JPS said:

    I see you have developed a QuickApp for Davis WeatherLink Live. I have a Davis so easiest might be to buy a weatherlink Live and your QuickApp.

     

    oh well, it is up to you

     

    Edited by tinman
    • Thanks 1
    Posted (edited)

    i just updated the Quick App above, added header option "["Accept"] = "application/json"," which might be necessary, so download it again, click on create sensors and then change the IP/URL

    Edited by tinman
    • Thanks 1
    Posted (edited)
    5 hours ago, JPS said:

    I am not really getting it to work and I am sure it is because of myself.

     

    I changed the code line 122 and enter the url to where the whew.json is stored.

    Please login or register to see this link.

     

    Is there anywhere else I have to change?

    I found under variables

    Please login or register to see this link.

    Should I change anything there?

     

     

    i respond in here:

     

    - QuickApp variables -> yes, you should change the IP from changeme to www.pcsundin.se/weather

    - change back the code in the QuickApp itself (or just delete the QuickApp and import again), to what it was before. This is because the code is checking if the "IP" variable value is "changeme" or something else, and if something else, then the http Query will get executed.

     

    - the interval variable can be changed as well, it is time in seconds, on which the http query will be executed

    - the other variables are autogenerated, they reflect the child devices created once you clicked on "create sensors" button, don't chage them.

     

     

    EDIT:

     

    i see you applied already the weewx json formater, the QuickApp on my HC3 is showing data :)

     

     

    image.png.2fa1c2cbab772a0a86dc3eafd756fb5d.png

    Edited by tinman
    • Thanks 1
    Posted (edited)

    Btw, with a bit copy&paste one can easily change the Quick App to report everything what WeeWx reports, good starting point for LUA / QuickApp leason.

     

    Please login or register to see this link.


    Please login or register to see this link.

     

     

    As you asked: the code was taken from my other Weather Station Quick Apps, while BleBox is easy one, the Davis is more complex (to cover the UDP alarm from Davis, etc.). Generally WeeWx does support Davis, and could support BleBox as well (as the BleBox API is open). I was thinking to write anyway QuickApp for WeeWx, however, due to lot of supported hardware (and potential differences in data output) i decided to not. WeeWx is much more than just data collector anyway. On the other hand, when i can read directly from Davis into QuickApp, why to bother and get trough WeeWx. 

     

    Edited by tinman
  • Topic Author
  • Posted

    I am sorry tinman,

    I probably did wrong by deleting the quick app and the child sensors. After reloading you code, it does not create the child sensors and the app crashes without the sensors.

     

    [30.07.2021] [18:53:00] [DEBUG] [QUICKAPP169]: QuickApp:onInit

    [30.07.2021] [18:53:00] [DEBUG] [QUICKAPP169]: Child devices:

    [30.07.2021] [18:53:00] [ERROR] [QUICKAPP169]: QuickApp crashed

    [30.07.2021] [18:53:00] [ERROR] [QUICKAPP169]: Unknown error occurred: std::runtime_error: 'Invalid argument'

     

    I have tried to restart the HC3 but I can still not create the sensors with the button to create them.

    Posted (edited)

    hmm strange, try in that order:

     

    - import Quick App

    - click on create sensors

    - after they created go to variables

    - change the IP value

    - click on save

     

    When you delete child devices, the code my behave strange, because it is trying to update them. The best is, when one deleted child, to delete the complete QuickApp (by deleting the parent). Normally one can as well change the IP back to "changeme", which will stop the code from updating, then edit the child id values in variables back to 0 and save .. but to delete whole QuickApp is faster and safe (HC3 tnds sometimes to act strange when child devices id/structure are updated, so only reboot helps).

    Edited by tinman
    • Thanks 1
  • Topic Author
  • Posted

    Tinman,

    You are 100% correct. I had to create the sensors before changing the ID. Now the sensors are created.

    Now I get the problem with authorisation on the webserver.

    [30.07.2021] [20:03:49] [DEBUG] [QUICKAPP169]: Error: Host not found (authoritative)

     

    Can you add to have username and password?

     

     

    Posted (edited)
    15 hours ago, JPS said:

    Now I get the problem with authorisation on the webserver.

    [30.07.2021] [20:03:49] [DEBUG] [QUICKAPP169]: Error: Host not found (authoritative)

     

    you probably entered wrong URL, look here, i can access your server:

     

    Please login or register to see this image.

    /monthly_2021_07/image.png.0ed4a2eacb50533b684f4e5efaff9dee.png" />

     

     

    15 hours ago, JPS said:

    Can you add to have username and password?

     

     

    sure, added to v02, see attached QuickApp on top of this thread.

     

    user and passwort in clear text in QA variables (yes, one could hide pwd, i leave it visible)

    they will be base64 encoded and send as http basic auth

     

     

     

    Edited by tinman
  • Topic Author
  • Posted

    Tinman,

    Finally it works!

    You are a star!

     

    It was because I had a slash after the address and used http://

    Before: 

    Please login or register to see this link.

    When it works 

    Please login or register to see this link.

     

    Now Wien the Windows is n 6,25 m/s it shows à bit 6 and small 25. It looks a bit weird.

     

    Thanks again for your brilliant support!

     

    Peter

    Posted (edited)
    On 7/30/2021 at 9:30 PM, JPS said:

    Finally it works! Thanks again

    you're welcome

     

    On 7/30/2021 at 9:30 PM, JPS said:

    Now Wien the Windows is n 6,25 m/s it shows à bit 6 and small 25. It looks a bit weird.

     

    that depends on the HC3 firmware version, on 5.80.9 it looks like (rounded to 6)

     

    Please login or register to see this image.

    /monthly_2021_07/image.png.3f2c70c09229caf211eb129c64717c2e.png" />

     

    and on 5.70.42

     

    image.png.e14c9192b0fb5a501b2e41b51b6a5f8b.png

     

     

     

     

    Edited by tinman

    Join the conversation

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

    Guest
    Reply to this topic...

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