Giter VIP home page Giter VIP logo

observerip's Introduction

Observer IP Module

Ambient Weather's Observer IP module connects to an ethernet network and receives information from temperature and other weather modules. It's primary purpose is to push this information to Ambient Weather and/or weather underground. Previous versions of the firmware would allow you to set an endpoint of your choosing, but the have since removed that functionality. Therefore, the only way to gather this information is to intercept, and redirect the pushes that it sends out to somewhere else and collect them.

There are a couple documents on the internet that explain how to do this with various routers/firewalls. Explaining how to do this is outside the scope of this project, however the basics are, for any traffic on port 80 or 443 coming from the local IP address associated with your observer IP module, use NAT and send those requests to the box where you're hosting this application.

The application supports passthrough (although this hasn't been tested) to weather undergound as well. If SetPassthrough(true) is set, the app will take whatever is sent from the ObserverIP module, disceminate that information so you can poll the app via REST for your sensor data, and also spawn a goroutine to send that data to the weather underground site.

NOTE: use this for what it's worth, I haven't had much time to put into this, so it's very minimal.

REST Endpoints

  • /endpoints : returns the last endpoint response
  • /info : returns the last station response

Data Output Excamples

Info / Station Response

{"Passkey":"blah..blah","StationType":"WS-1501-IP","DateUTC":"2022-08-22 16:47:09","Endpoints":[{"Id":1,"Name":"","TempF":78.08,"Humidity":61,"Battery":1},{"Id":2,"Name":"","TempF":83.3,"Humidity":56,"Battery":1},{"Id":3,"Name":"","TempF":70.88,"Humidity":61,"Battery":1},{"Id":4,"Name":"","TempF":74.48,"Humidity":53,"Battery":1},{"Id":5,"Name":"","TempF":-1,"Humidity":-1,"Battery":1},{"Id":6,"Name":"","TempF":-1,"Humidity":-1,"Battery":1},{"Id":7,"Name":"","TempF":-1,"Humidity":-1,"Battery":1},{"Id":8,"Name":"","TempF":-1,"Humidity":-1,"Battery":1}]}

Endpoint Response

{"Id":"STATIONID","Password":"","TempF":-9999,"Humidity":-9999,"DewPointF":-9999,"WindChillF":-9999,"WindDirection":-9999,"WindSpeedMph":-9999,"WindGustMph":-9999,"RainInch":0,"DailyRainInch":0,"WeeklyRainInch":0,"MonthlyRainInch":0,"YearlyRainInch":0,"SolarRadiation":-9999,"UV":-9999,"IndoorTempF":-9999,"IndoorHumidity":-9999,"BarometricInch":-9999,"LowBattery":0,"DateUTC":"now","SoftwareType":"WH2602 V4.6.2","Action":"updateraw","RealTime":1,"RealTimeFrequency":5}

USES

This application / module can be used in a couple different ways:

  • By importing it and using it in your own application
  • By compiling it and using it as a REST endpoint for the observer data.

Using as a module

import "github.com/mglaske/observerip"

def main() {
  x := observerip.New(5080)  # This is the address it listens on
  go x.ListenAndServe()
  defer x.Close()

  // The last station response received
  sr := x.GetStationResponse()

  // The last endpoint response received
  er := x.GetEndpointResponse()

}

Compiling and using as a stand-alone app

See the example directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.