Giter VIP home page Giter VIP logo

ambientweather's Introduction

AmbientWeather WS-1550-IP (version 4.5.8 firmware) HTML Scraping of Live Data HowTo Documentation

This repository holds code I've written to scrape the "Live Data" page data, put them in variables and allow you to uses these variables in your own code without using the API and/or ambientweater.net. The idea is that it's nice to use IoT but I do not like to be held to these systems for a number of reasons. JSON is a very standard data format. Parsing JSON is easy, especially in Python.

The program gets the HTML data via a standard network call, puts this data in a JSON format that can be easily parsed using Python tools. The "interesting fields" data are plucked and put into a JSON sentence. That sentence is pushed to Splunk in my case where I can build my own panels and parse the data using any criteria I choose.

The output to this program looks like this:

{ "ambient1.ham.co" : {"outHumi": "52", "RelPress": "30.09", "uvi": "6", "avgwind": "0.4", "rainofyearly": "0.04", "windir": "37", "eventrain": "0.02", "solarrad": "711.38", "inTemp": "75.7", "inHumi": "57", "rainofmonthly": "0.04", "rainofdaily": "0.00", "dailygust": "2.2", "rainofweekly": "0.00", "AbsPress": "29.59", "rainofhourly": "0.00", "uv": "2694", "outTemp": "75.2", "outBattSta1": "Normal", "CurrTime": "10:11 8/11/2019", "inBattSta": "Normal", "gustspeed": "1.1"} }

When you pretty up the JSON it'll look like this:

{
	"ambient1.ham.co": {
		"outHumi": "52",
		"RelPress": "30.09",
		"uvi": "6",
		"avgwind": "0.4",
		"rainofyearly": "0.04",
		"windir": "37",
		"eventrain": "0.02",
		"solarrad": "711.38",
		"inTemp": "75.7",
		"inHumi": "57",
		"rainofmonthly": "0.04",
		"rainofdaily": "0.00",
		"dailygust": "2.2",
		"rainofweekly": "0.00",
		"AbsPress": "29.59",
		"rainofhourly": "0.00",
		"uv": "2694",
		"outTemp": "75.2",
		"outBattSta1": "Normal",
		"CurrTime": "10:11 8/11/2019",
		"inBattSta": "Normal",
		"gustspeed": "1.1"
	}
}

You can then use JSON syntax to parse out the various fields you may want to interpret. I'm not interested in all the available fields so I parse out only what I want with the Python code. Once in Splunk these data fields can be easily used to create all kinds of reports. Another use of this data is to trigger other things. Like when the wind goes above a threshold send out an alert.

I do all of this because one of my weather apps does not use the Internet so going to ambientweater.net is not an option for that application. This tool allows me to get updated weather data as often as I need without restriction. I like to be in total control of all my data.

Splunk is not required for this data to be effective. If you want to push to MySQL and render with your own tools you can. The key is the JSON data in a format that can be manipulated easily.

I currently do not have any internet facing data to demo this. I do have some screen shots I can share. This is the kind of thing I do with Splunk once I've collected the data:

Wind Information

This is a look at how I use Splunk to display the data. Keep in mind that my Ambient Weather station is just one input into this. Splunk will keep the data for as long as I have storage to store the JSON data (years) and I can pivot the data any way I want. None of this depends on access to the Internet.

Splunk Panel

Splunk is the tool I've chosen to store and present the weather data. There are any other number of tools that can do this including writing something on your own. Splunk can do this on a grand scale with ease.

I did not use any API or other tools from AmbientWeather to do this. There may be better ways to scrape the data. You can do very similar things on their IoT web site and the API tool to get that data. They have transaction restrictions and minimim record granularity that is above my threshold of 15 seconds to 1 minute.

For the AmbientWeather API documentation go here:

https://github.com/ambient-weather/api-docs

ambientweather's People

Contributors

johnwesterman avatar

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.