Skip to content

A program for our TJBot so it can tell us weather forecasts at a glance

Notifications You must be signed in to change notification settings

dalelane/weatherbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weatherbot

Image of TJBot

weatherbot is a simple app that lets us use our TJBot as an ambient weather device.

It gives us an at-a-glance weather forecast using it's head LED and the position of it's arm. We're using DarkSky's API to get a weather forecast.

Will it rain?

Image of TJBot with his LED turned on

If the chance of rain is 50% or higher, the LED on weatherbot's head will light up.

So a glance at weatherbot means we know to take an umbrella with us if we're going out.

How warm will it be?

Image of TJBot with his LED turned on

The arm will rotate to show a predicted temperature.

Rotating to the left means cold, with the arm horizontal and all the way to the front meaning 0 degrees C or colder.

Rotating to the right means hot, with the arm horizontal and all the way to the back meaning 30 degrees C or hotter.

And the arm pointing straight up is half-way between the two: 15 degrees C.

So a glance at weatherbot means we know if we should take a coat.

Running weatherbot

The script sets the arm and LED once.

We're using cron to run the script every 5 minutes, so the weatherbot keeps up to date with the latest forecast.

Can I use this?

Sure.

But the config is scattered through the code, sorry. You'll need to sort yourself out with a DarkSky API key and put it in an environment variable. You'll also need to modify the script to specify the location you want forecasts for.

Erm... isn't this a bit simple?

Yes. The TJBot was built by my kids and this is their first project.

Faith came up with the idea and Grace wrote bot.js with a few suggestions and additional commenting from me. The idea was to let them use the bot to build something they could understand and make themselves, without me interfering too much.

For our next project, we might try something a little more advanced! :-)

-- Dale ( @dalelane )

About

A program for our TJBot so it can tell us weather forecasts at a glance

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published