Simple enhancement for PressureSensor example (Weatherstation)


  • Hero Member

    The pressure sensor example of the mysensors library contains a simple forecast algorithm. When integrating this into FHEM I noticed that the forecast is "stable" most of the time. What I wanted to have was an additional indicator which displays the current weather situation based on the sealevel pressure of 1013hPa. Well, actually this is what a simple analog weatherstation does. So I modified the PressureSensor example so that it transfers a second sensor value: weather situation

    enum WEATHER_SITUATION
    {
    	VERY_LOW_PRESSURE = 0, // p>-7.5hPa
    	LOW_PRESSURE = 1,      // p>-2.5hPa
    	NORMAL_PRESSURE = 2,   // p <+/-2.5hPa	
    	HIGH_PRESSURE = 3,     // p>2.5hPa
    	VERY_HIGH_PRESSURE = 4,// p>7.5hPa
    };
    

    WeatherStationSensor.ino

    The FHEM plot looks like
    FHEM-Plots.png

    Sorry for the german labels:
    Vorhersage = forecast
    Wetterlage = current weather situation

    HH = very high pressure
    H = high pressure
    T = low pressure
    TT = very low pressure

    In the picture you can see that the forecast is sunny though the current weather situation is rainy: indeed it's raining cats and dogs and cows at the moment.

    BTW:
    To make it a real weatherstation i merged the dht-22 code into it to get the humidity value, too.


  • Admin

    Adding a humidity sensor and making a full fledged Weather-station example really makes sense together with the current situation data.

    Would it be possible for you to create a pull request of this to the dev-branch?

    Converting it to 1.6 is quite simple (you can look at the other examples if you need additional help):
    https://docs.google.com/document/d/1NKq5uuNdnxF5jWnum7VT32mbKLjuvqlx2A5D1qQ-H3Q/edit#


  • Hero Member

    Ok, no problem, I will create a pull request this weekend.
    rgrds Heinz


  • Hero Member

    Pull request done.


  • Mod

    Link to the PR in case someone wants to find it later: https://github.com/mysensors/Arduino/pull/261


Log in to reply
 

Suggested Topics

  • 5
  • 8
  • 1
  • 1
  • 7
  • 1

56
Online

11.4k
Users

11.1k
Topics

112.6k
Posts