Home Automation Series: Weather Data


This is probably over kill, but I’ve always had a fascination with the weather, and so one of the things I wanted to do was hold an enormous about of weather data, so I could write logic to analyze it and provide me with data about unusual trends, or possible up coming weather.

I read through several different Weather API providers and settled on DarkSky, who had two important factors: History all the way back to 1937 (for the most part) and cheap rates for excessive API calls.

Example output from my RestAPI

Using DarkSky, which has their own engine to “predict future weather”, I’ve populated weather data all the way through 2024. Every day though, my code will reach out and pull down accurate weather for each day. Ensuring valid data.
Right now, this process is dependent entirely on the internet, in the future though all weather data will be collected from a locally hosted weather station.

Why all the data though?

A major part of this will be a digital assistant, which I will probably call Jarvis. With that, I want to be able to rather quickly calculate weather records and have Jarvis be able to provide me with weather from a specific day or factoids about weather. Ideally, I think it would be pretty neat to write some code that could try to predict what the weather will be, then use actual weather recordings to prove or disprove (validating the learning process). This way, Jarvis could inform me of possible weather pattern changes or be able to tell when upcoming days will be sunny or not.

The real reason for the data hoarding though, is primarily because DarkSky was bought by Apple and it’s rumored the API will go away at some point. Which means, my ability to write code that will be dependent on that API is in question. So, instead, I’ve captured all the data I need prior to the API going away.


I’ll eventually look at plotting out all of the data in a scientific format using Matplotlib, this goes back to me being fascinated by weather data. It would be pretty neat to see how often trends repeat in terms of temperature spikes and dips, how often we actually get snow accumulation, or monthly average rain fall. I’ve always kind of been a bit of a data scientist, I’ve just never had the ability to act on the desire.

All of this data will feed into the logic that will be used to adjust the house temperature using the HVAC controls I’ve been building.

Thanks for hanging around!

-Dan

The Hardware Of Jarvis: Sensors


With the development of Jarvis seeming to ramp up, I’m going to start getting into the development of hardware additions. After reading a series of blog posts by Rob Tennyson on building wireless sensor networks (http://www.robtennyson.us/post/building-wireless-sensor-networks), I decided that is the way I would go.

Then it dawned of me, instead of actually telling Jarvis that I am going to bed, like my prototype is setup right now, I would build something very similar to this wireless sensor setup, but have it be a single button arduino setup, that when pressed, sends a signal to Jarvis that I’ve gone to bed, then keeps track of the fact I’ve pressed it, so in the morning when the alarm goes off to wake me up, I can press it again it sends a signal that I’m awake, stopping the alarm and starting the “wakeupHandler” script that I’ve built.

Anyway, back to the original post idea. Wireless Sensor Building. The whole idea is to have a temperature sensor in each room of the apartment, and possibly one out front of the apartment. The end result I’m hoping for is to have Jarvis monitor the temperatures in each room and ensure the temperature stays above a threshold (i.e. 70 degrees), or a relative temperature to outside.

My hope is to get a hold of x10 hardware that controls a heater module, so Jarvis can communicate with the module in a room and only turn on the heater when it decides, rather than the heater kicking on by itself.

I’m also hoping to figure out how to use an IR (infrared) blaster to send commands to my Air Conditioner in the summer, but that’s down the road a bit.

Another neat feature I think would be fun to have is a series of sensors that monitor movement, if I’ve “logged out” of the apartment (for example, I leave for work) and the apartment is in “away” mode, if movement is detected, Jarvis can send me a tweet, instant message and email telling me which zone (or room of the apartment) that movement has been detected. At some point, I’d like to get cameras that will snap a picture when movement is detected and send it to me, along with an audible alarm, letting the person know the apartment is in “away” mode and that all of their activity will be noted and monitored.

Of course, the first step in this project is to really get hands on with the hardware that I will need, so it may be awhile before I can actually build my first sensor and once I get  it built, I will just duplicate the process a few times to create my network of sensors.

More to come on this

Thanks for reading!

Dan

Jarvis


If you have seen Iron Man, Iron Man 2 or The Avengers then you have heard/know of Tony Stark’s digital butler Jarvis. He has control of everything in Tony’s home and Iron Man suit. The technology doesn’t exist to have such a butler, but the technology is available to build something very close to it.

As of October 2012, I haven’t made any additional changes to Jarvis because right now he resides on my laptop, which isn’t sufficient for me to run Jarvis on 24/7 without issue. I am in the process of getting Money put together for me to buy a new Mac Mini to continue the development of Jarvis.

As of December 2012, Development of Jarvis has started up again, I have been working on getting a more in depth weather forecast from Jarvis, which is working out pretty good, and because of recent changes to Twitter you can no longer use apps like Twitterrific or TweetDeck to post to Twitter, so I’ve decided that communicating with Jarvis through Twitter will remain a one way street, for now. I’ve setup Jarvis to use tweetymail to post to twitter and it appears to work great so far.

A few things I’m going to be working on and that I’m pretty excited about is the hardware side of Jarvis, so far I have been investigating the use of an Arduino to develop a couple of things. First, a RFID scanner to basically log in and log out of the apartment, turning off lights and such, and a wireless weather station so Jarvis doesn’t need internet to get the current weather.

I will be updating this page with videos and examples of what I have come up with for my own Jarvis.

So far some of the features include:

  • Wake up message that includes the current date and time, and weather for the day.
  • Checking my Agenda and then checking each part of the agenda, for example if I have 2 meetings in a day, I can have it read off each meeting title and time it will occur.
  • Communicate via Instant message, right now only AIM, TXT Message and sends me tweets with weather information.

https://www.facebook.com/video/embed?video_id=10151430292786718 https://www.facebook.com/video/embed?video_id=10151430593831718 https://www.facebook.com/video/embed?video_id=10151413233511718 https://www.facebook.com/video/embed?video_id=10151414675886718 https://www.facebook.com/video/embed?video_id=10151233952811718 https://www.facebook.com/video/embed?video_id=10151225025516718 https://www.facebook.com/video/embed?video_id=10151224895411718

I will include more videos as I get the time to make them.

More to come!