Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Simple enhancement for PressureSensor example (Weatherstation)

Simple enhancement for PressureSensor example (Weatherstation)

Scheduled Pinned Locked Moved My Project
weatherstation
5 Posts 3 Posters 2.8k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • HeinzH Offline
    HeinzH Offline
    Heinz
    Hero Member
    wrote on last edited by Heinz
    #1

    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.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hek
      Admin
      wrote on last edited by
      #2

      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#

      1 Reply Last reply
      0
      • HeinzH Offline
        HeinzH Offline
        Heinz
        Hero Member
        wrote on last edited by
        #3

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

        1 Reply Last reply
        1
        • HeinzH Offline
          HeinzH Offline
          Heinz
          Hero Member
          wrote on last edited by
          #4

          Pull request done.

          1 Reply Last reply
          1
          • mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            14

            Online

            12.0k

            Users

            11.2k

            Topics

            113.4k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular