Skip to content
Client for communicating with the MeteoStick and Fine Offset Weather Station
Elixir
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets update readme Sep 7, 2016
config change default serial port Nov 1, 2016
lib potential fix for junk stations Jun 30, 2017
test adds test for event bus Sep 7, 2016
.gitignore initial commit Sep 7, 2016
LICENSE.txt update license Sep 19, 2016
README.md update readme Sep 7, 2016
mix.exs bump version Jul 5, 2017
mix.lock

README.md

MeteoStick

A Client for the MeteoStick USB Stick

This library works specifically with the Fine Offset HP-100x available in the U.S at Ambient Weather

Use

1. git clone https://github.com/NationalAssociationOfRealtors/raven.git
2. mix do deps.get, deps.compile
3. iex -S mix

Explanation

As a new sensor array starts broadcasting, a process is started to parse and store the state of the sensor array. Each update triggers an event notification over Meteostick.Events event bus. You can add a handler to the event bus by calling MeteoStick.EventManager.add_handler. To see an example implementation of a handler look at MeteoStick.Handler and also be sure to look at the tests.

An event is the state of a sensor array which looks like this.

%MeteoStick.WeatherStation.State{
    humidity: {55.0, ""},
    id: "73",
    indoor_temperature: 0,
    outdoor_temperature: {24.1, ""},
    pressure: 0,
    rain: {11.0, ""}, #measured in ticks...
    solar: %{
        intensity: {77.5, ""},
        radiation: {0.6, ""}
    },
    uv: {0.0, ""},
    wind: %{
        direction: {180.0, ""},
        gust: {0.0, ""},
        speed: {0.0, ""}
    }
}

Architecture

Architecture Image

MeteoStick.Client is a small Serial client. It is the main interface for sending and receiving messages. As a new weather station is discovered a process is spawned through MeteoStick.StationSupervisor and the station processes state represents the station's attributes.

Every 16 seconds the station sends updated attribute information, the station process (MeteoStick.WeatherStation) parses the data and updates it's state, the state is then broadcast (using notify) over MeteoStick.Events event bus. Anyone can add a handler to the event bus to handle updated station state by calling MeteoStick.EventManager.add_handler. See MeteoStick.Handler for an example implementation of an event handler.

You can’t perform that action at this time.