more home automation

I have this Raspberry Pi that I’ve written briefly about on my other site: It controls the lights in my living room based on a few inputs:

  1. the position of the sun
  2. the weather
  3. if the room is occupied

#3 is new and I just added it over the past weekend.  Here’s how it all works, since I know you’re curious.

First, every day after midnight, a script runs that uses a program called “sunwait” which calculates the sunrise and sunset times for your latitude and longitude. The author of the program wrote it to also be able to calculate when the various “twilight” times start and end, such as astronomical, civil, etc. These are all defined by how many degrees below the horizon the sun is. Well, instead of knowing how far below the horizon the sun is, I wanted to know how far above it was – since it is of course, darker in the house when the sun is low and behind trees and stuff. So I went into the code and changed a few things and I now calculate +5 and +10 degrees after sunrise and before sunset. The script records all these values into a database first thing each day.

Another very simple script (really just one line in my crontab) pulls down current weather data for a weather station near me from using their API. The weather data conveniently includes a text description of the current weather, something friendly like “Partly Cloudy” or “Heavy Fog” or “Tornado” and these are all defined on their site. I went through and categorized each of these conditions into where I thought they fit in 3 categories: “bright”, “dim”, and “dark.” I’d really like to get more accurate data – such as percent cloud cover but I haven’t found a source for that. Apparently airport METARs have that info but they only update hourly. I’m not sure if the wunderground data actually pulls from that but the rest of the data updates much more frequently. Another solution I might implement is just using a light-sensor that the pi can read. The point is, the current weather string is parsed and either “bright”, “dim”, or “dark” is recorded into a database with the current time.

The occupancy data is gathered from my ecobee 3 thermostat, which includes these nifty remote wireless sensors. Each sensor transmits the temperature and motion detection back to the thermostat, which it uses to determine which rooms are occupied and should be averaged into the current house temperature. With their most recent API update, you can now poll the “occupancy” status of each sensor. The occupancy is based on if there was any movement in the previous 30 minutes, so there’s always going to be a bit of a lag when the room is empty before it is deemed “unoccupied.” I record the data into a database as well, every 5 minutes.

With all this data being recorded, the final part is a script that reads the various pieces of information and determines what to do. The script is generally run every 2 minutes during parts of the day where I want light. For example, if it is “morning” (which I mean before sunrise) then all lights should be on if the room is occupied, but only 1 light if it is not. So if I run the script at 6:30a, the sun is not up, so it will turn one light on for when I wake up and then when it detects someone is there, the rest will also come on. If it is the middle of the day and it is “dim” then I would like 1 light on in the living room if it is occupied. However, if it is not occupied during the day, then no lights should be on, no matter how dark. As the sun sets, more lights are on for each of the 3 light levels, and finally after the sun sets, all lights are on.  When the sun is around 5 degrees from setting, or later, if nobody is home, 1 light will be on.

I uploaded my python scripts to github. They’re not entirely useful to anyone else because you don’t exactly have all the other pieces that fit into it, such as the weather and sun position scripts, but if you know how to input these things, the same automation can be done. My repo is here:

Oh – I forgot one crucial bit of info – the lights are controlled by these “ancient” home automation modules called SmartHome X10. They work by transmitting signals over the powerline and feature radio-signal remote controls. Luckily, they made a computer interface called a “firecracker” which plugged into a serial port and also could send these radio signals to the wall plugin module, which then transmitted the codes over the powerlines. With a USB-serial adapter, I hooked this up to my pi, and use a program called “heyu” to actually change the lights on and off. I wrote a wrapper for this called “” which records the last “known” status of each light in a database and then changes the status when requested. Unfortunately the firecracker is a one-way communication, so the pi never really knows the state of the lights, they might have been overridden by the hand-remote. Best it can do is just assume and remember what it tried to do, but it’s really in the dark.

BTW, I also hooked up one module to an electric cat food dispenser, so the cats are fed on a schedule by the pi.


straw bale planting day

The fertilizing period is done, and since I was out of town last week, we waited one extra week and got our plants and planted them on Saturday (4/18). Sometime over a week ago, I got a couple soaker hoses and then re-arranged the bales so there wouldn’t be any gaps – it turned into a big “S” shape. There were actually 2 bales that I had forgotten about on the side of the house that I included in the layout, but they were not part of the fertilization plan. I may start fertilizing them and plant something late in them.



So far the plants consist of: 3 varieties of tomato, 2 varieties of green bell pepper, red and white onions, strawberries, and parsley. I have potatoes that will be added into the middle of all the bales and I want to get more herbs to plant in the sides. I am also planning on getting one more tomato variety and there is one bale still unused – maybe garlic or something, I’ll have to make a trip to the greenhouse and see what they have. I might see about planting a vine plant or two in the ends – pumpkins and cucumbers?

Maybe I can insert a table to illustrate the layout:

white onions unused unfertilized unfertilized
red onions
red onions green peppers green peppers strawberries
white onions
tomatoes tomatoes unused (tomatoes) roma tomatoes

We also moved our compost – it was in a circular bin near our deck, but I thought it would work well to just pile it in the gaps between the S pattern of the bales, so we did. If we still live at this house next year, we should have a pretty good amount of compost and could even make a regular raised-bed garden. The bales will have decomposed by the fall and can get stirred into the compost, along with old vegetable matter.

That’s it for now – hopefully potatoes (russet, red, and yellow) will be planted by EOD and maybe more herbs.

nature and morels


Went outside today to fertilize the bales and took a few pictures of some flowers (looked like bluebonnets but I don’t think they are, they appear to be on onion/garlic stalk-type-things) and a snail under a tree.  By the way, I measured the temperature of the straw bales Tuesday and it averaged 87 degrees.  It rained yesterday so I didn’t bother watering them.  I didn’t water them today since it’s supposed to rain as well.


Then I saw a morel mushroom.  I have never had one and haven’t been a huge fan of any mushrooms in general, but I picked it and Holly and Valentine helped me search around and we found one more.  Apparently there’s fake ones that are poisonous but according to the internet, these are genuine.


Yes, they look like tiny brains.  I have heard these are good and people hunt them so, I googled how to cook them, coated them in a little flour and fried them in some butter in a skillet.


I thought they were actually quite tasty, kind of like chicken or something.  Holly tried one and wasn’t a huge fan, but I will definitely search for more after a rain or if I’m ever wandering in a forest or something and have them again.



straw bale garden – beginning

Holly and I are going to try a straw bale garden this year.  Neither of us have done this before, but we’ve been wanting a garden for a few years.  Since we’re currently renting, we don’t want to put time and money into the ground.  We’ve tried container gardens in the past, but unfortunately we have moved during the summer the last two times, trying to take the containers with us and resulting in many failed crops.

The idea is to create fertilized straw bales that you plant your garden directly into, so the ground underneath does not matter at all – in fact, you can put your bales on pavement if you really want to.  So, we bought about a dozen bales last fall around Hallowe’en when they were easy to come by afford-ably, and  left them in our backyard.  They also came in handy to help insulate the house during the winter.

Since it is finally warm out and looks like it will stay that way, I started preparing the bales.  I suppose I should have really done that a few weeks ago so we could start planting now, but I think it will be ok.  You’re supposed to fertilize them every-other-day for about 10 days, and water them every day.  I bought some “cheap” lawn fertilizer with about 30% Nitrogen and put 2c on each bale, then watered it until all the little pellets went down into the bales.  I’m planning on taking the temperature inside the bales every day at the same time and graphing it – should see a spike and then level off, then it should be ready for planting.

We are planning on planting potatoes, tomatoes, cucumbers, pumpkins, onions, garlic, dill, oregano, peppers, and a few other herbs (it’s all written down on a paper I don’t have in front of me.) I read that you can actually plant potatoes deep down in the bales and then plant other things on top, so that should work out well.  Then you can either harvest new potatoes or wait until the other plants are done, kick the bales apart, and just pick up the full-sized potatoes in the fall.


Pizza Version of White Bread #1 with Sourdough Starter

wpid-IMG_20140104_214600.jpgwpid-IMG_20140104_215112.jpgi did an experiment today with the white bread recipe i usually make.  i wanted to make a tomatoey dough with pizza flavors, so i substituted spicy V8 for the milk, olive oil for vegetable oil, and garlic salt for the salt, and added some pizza seasoning to the flour.

the recipe works out like this:
  • 1 c active sourdough starter
  • 6.5 c bread flour
  • 1 c spicy V8
  • 1.25 c water
  • 2 Tbsp olive oil
  • 1 Tbsp garlic salt
  • 3 Tbsp sugar
  • 1 tsp pizza seasoning
  • pepperoni and mozzarella cheese (optional)

wpid-IMG_20140105_105041.jpgmake the bread in the exact same way as the white bread recipe referenced above.  when it comes time to roll up the dough into a loaf, first add pepperoni and cheese, then roll it.  i made one with the filling, one without.

during the first rise which should be 10-30 mins, i think i let it sit for about an hour.  i probably should have shortened it as something weird happened later.  after a proof of about 1.25 hours, which is shorter than usual for this bread, the un-filled loaf got all lumpy and holey.  i didn’t notice when this happened, but my guess is that it somehow got over-proofed and started to deflate.

when it came time to bake, the un-filled one took the regular 25-30 mins, but the filled one took much longer to get up to 190-195 degrees.  i probably baked it an additional 15-20 minutes – measuring the internal temperature about every 5 mins.

wpid-IMG_20140105_130707.jpgwpid-IMG_20140105_141016.jpgthe finished product is more orange colored in the middle with a hint of pizza flavor, but not too much.  i think next time i’ll basically add more of the flavorings: pizza seasoning, tomato juice, filling.  i was thinking about trying pizza sauce instead of juice, but would probably need to add more water as well.

haven’t tried yet, but i’m guessing this would make a nice grilled cheese with mozzarella and pepperoni…


Rustic Sourdough Bread

i like the sourdough conversion of white bread that i’ve made a few times, but since it takes 12 hours, i looked for another version which might be faster.  i ended up trying King Arthur Flour’s Rustic Sourdough Bread recipe.


i got a fancy new digital scale for christmas, so you’ll see that featured in posts from now on.  it also means that my weight measurements will switch to grams, and since it has a tare function, the weight will be the ingredients alone, not including the container.

the recipe calls for instant yeast but i wanted to try it without, and it did work fine, just took a little longer… which kind of defeated the purpose of looking for a faster recipe.  total it took about 8 hours from mixing to baked bread, which is better than the 16 or more the other takes.

  • 1 cup “fed” sourdough starter (227g)
  • 1 1/2 cups lukewarm water
  • 1 tablespoon sugar
  • 2 1/2 teaspoons salt
  • 600g bread flour

combine all the ingredients.  i started with the starter and added everything except the flour – adding that last so i could only add as much as necessary.  i added about 530g of flour before it came together, then used more during kneading to keep it from sticking.


wpid-IMG_20140102_124930.jpgafter kneading, let the dough rise until ripe – the recipe says 90 mins, but that’s with instant yeast – mine took about 4.5 hours.

wpid-IMG_20140102_171950.jpgwpid-IMG_20140102_201545.jpgform the dough into two loaves.  the original recipe was for a “rustic” loaf but i decided to make one in a pan.  i used the same flatten-then-roll-up method i’ve used before for the pan loaf, and just made a generally loaf-shaped loaf for the other one and put it on some parchment paper to rise and make it easier to transfer to the oven.  i let it rise for at least 3 hours, til it was very fluffy, then sprayed the top of each loaf with water, cut some slashes into the top of each loaf, then baked each loaf for about 25-30 mins at 425.  for the rustic loaf, i placed the parchment paper on my pizza stone.

both loaves baked nicely and tasted very similar to the other bread i’ve made.  as you can see below, the rustic one didn’t last long as we ate about 4 slices while it was hot!


more sourdough starter instructions

i typed this up in an email to some friends i gave some starter to.

there’s 2 ways to feed sourdough – by weight and by volume, and there’s also a few possible situations – counter-top or fridge.
first rule is to always double it when you feed it.  this could be after you have used some or if you just need more for your recipe.
second rule is to always feed it every 12 hours if it’s on the counter.  i’m not sure how often in the fridge, but i’d say every 2 to 4 weeks.  you might find some clear liquid on the top if it’s been in the fridge for over 4 weeks – it’s alcohol (hooch?) that you can either dump off or stir back in.  you should be able to tell by smell if it’s gone bad.
third rule is to feed it equal amounts of flour and water by weight.  or by volume, 1/2 as much water as flour.
so on to the details.  when i keep mine on the counter, here’s what i do.  (i use a scale to weigh mine, but i’ll describe how using volume too.)
  1. weigh another identical jar, or otherwise know empty jar weight, so you know how much to subtract (the jar i use is about 280g or 10oz)
  2. weigh the jar with sourdough.  let’s say it’s 380g so there’s 100g of sourdough starter.
  3. if you’re just feeding it to maintain it, dump out half
  4. add back flour/water equal to the weight of the sourdough you have in the jar currently.  so if you dumped out half, you have 50g left.  you would need to add 50g of “food” back which would be 25g flour, 25g water.  if you didn’t dump out half, you have 100g of starter so you would add 100g more “food” – 50g flour and 50g water.
  5. stir it up
now if you don’t weigh it, you can use volume.  the jar probably has markings on it for cups or fl oz
  1. stir up the starter to remove all the bubbles otherwise you won’t get a good volume measurement
  2. read how much you have – say 1 cup
  3. if you’re feeding it to maintain it, dump out half
  4. add back “food” so the amount of flour is the same as the starter, and the water is half as much.  so if you dumped out half, you have 1/2c left.  you would need to add 1/2c flour and 1/4c water.  make sure the flour is very loose or you’ll have too much.  if you didn’t dump out half and you’re just doubling your starter to get more, you’d start with 1c of starter, and add 1c of flour and 1/2c of water.
  5. stir it up
another thing to know is the different stages:
  1. just fed – obviously this is just after you added flour/water and stirred it up.  it isn’t very usable at this point, but if you’re going to refridgerate it, this is the best time to put it in the fridge.
  2. active – this is a few hours after you feed it – it should get very bubbly and double in volume.  this is a good time to use it to bake something.
  3. mature – this is hours after it’s active, the bubbles won’t be strong enough to keep it inflated, and it will fall back down in volume.  it can still be used in some recipes but won’t rise much.  it will have small bubbles on the top and eventually will have a layer of clear liquid on the top (alcohol) but you can stir that back in before feeding it again.
to use it from the counter top, just feed it ahead of time and get the volume up to what the recipe calls for, then use it when it’s active.
to use it from the fridge – take it out, let it warm up to room temp, feed it probably two cycles to make sure it’s very active again before baking with it.  so if you want to use it out of the fridge, take it out the day before and feed it.
if you just used it and want to store it, just feed whatever is left according to the instructions above, then put it back in the fridge.

Homemade Pizza Dough (Sourdough Starter)

i got a nice new pizza stone for christmas this year (i somehow cracked my previous two) so i decided to make homemade pizza and try using sourdough starter.  i followed this recipe i found on

the first dough turned out a little dry so i made another in a slightly different way which was much stretchier, but i baked both and they were very good in different ways.

the ingredients are very simple:

  • 1.5 c mature sourdough starter
  • 1 T olive oil
  • 1 t Salt
  • 1.5 c Flour

this recipe is for one pizza.

wpid-IMG_20131223_171811.jpgi started by just mixing all these things together – flour, then sourdough starter (i had some that had been fed awhile ago so it was “mature”) and the rest.  this turned out quite dry, so i added a little more sourdough starter to try to help, and then after it had formed a ball i tried to save it by adding a little water.  this just made it sticky.  you can see by the series of photos below that it was a kind of lumpy ball – it felt kind of dense and rubbery, not soft and stretchy like it should.  i let it rest anyway and started on another one.


for the next attempt, i didn’t take pictures of the process, but it came out much better, so i’ll explain the steps.  this is the process i’d recommend if you want a dough that is very stretchy and you can make very thin and crispy.  the ingredients are the same, except i had used all the “mature” starter with the first dough so i used some active bubbly starter – i’m not sure if this made a difference, but it might have been the key.  i also added a little water.  i didn’t measure the dough quite as exactly this time either, just going by feel to determine if there was enough.

make the dough:

  1. add a little flour to a large bowl – like 1/4 cup
  2. add about 1 to 1.5 cups of sourdough starter
  3. since my measuring cup had starter stuck in it, i added a little water and swished it around – less than 1/4 cup.  i then added the oil and salt to this and stirred it up before pouring it over the sourdough starter
  4. stir this mixture up to form a batter
  5. start adding flour, 1/2 cup at a time, until a dough forms
  6. dump the dough onto a floured surface and knead for 10 mins, adding flour as necessary to prevent sticking, but making sure it’s slightly sticky

this one turned out smooth and stretchy like pizza dough should be.  or as my mom always said, it should feel “like a baby’s bottom.”  form it into a smooth ball, and let the dough rest, covered, for about 30 mins.

shape the crust: flatten the ball with your hands, and stretch it while rotating, or if you want to get fancy, toss it into the air with a spinning motion so the centripetal force stretches it out (catch it on the back of your hands, not your fingers.)  depending on how stretchy your dough turned out, you can make a very large, very thin dough.  my first one was not stretchy, so i rolled it out with a rolling pin and it was not thin, more of a “hand-tossed” thickness.  my second attempt was so stretchy that i accidentally made the middle paper-thin while there was still quite a thick crust around the circumference.

put some cornmeal on a peel, then move the crust by folding it half twice, then unfold it on the peel.  my first attempt did this easily.  my second one kind of stuck to itself and unfolded strangely…

baking: using a pizza stone is the best way to bake pizza, and i’ve used both techniques mentioned in the recipe on before – bake crust first, then add toppings and bake again, or bake everything at once.  since i wasn’t quite sure how the first, tougher, dough would turn out, i used the two-bake method so toppings wouldn’t be wasted if the crust didn’t perform.

pizza ovens used by restaurants are very very hot, so preheat your oven with pizza stone to 500°.

wpid-IMG_20131223_185106.jpgwpid-IMG_20131223_190016.jpgto the crust, i add a thin layer of olive oil, a thin layer of sauce, and garlic salt and pizza seasoning, then slide it carefully onto the stone and bake it for about 4-5 mins.

on to the toppings: i’ve made homemade pizza sauce before, but haven’t settled on a recipe yet – the last time it was so watery that i think it caused my pizza stone to crack when the sauce leaked off/through the crust.  so i used canned Contadina sauce (i add more sauce after the first baking, but we love sauce.)  i also usually use regular Hormel pepperoni, but this time opted for the sausage-like pepperoni and cut it myself, i think it was better.  for cheese i like a mozzarella/provolone blend.  top your pizza however you like, then put it back in the oven for 5-7 mins until the cheese is golden brown.

wpid-IMG_20131223_191803.jpgwpid-IMG_20131223_192448.jpgthe first pizza turned out with a thicker, chewier, yet crispy crust and had more of the sourdough flavor to it.  the second pizza had a thinner, crispier crust, with almost cracker-like edges but less sourdough taste.  i preferred the second one, but the first was very good too.

appetizer: i had a tiny bit of dough that i experimented with when i was trying to see if adding less flour would be better.   it was probably 1/3 the size of the pizza dough.  so i flattened it into a rectangle, buttered it, sprinkled it with garlic salt and cheese, and baked it for 7-8 mins and had some very tasty cheese sticks.  i didn’t get a chance to take a picture because it was eaten up so quickly, so here’s the last little bite that was left by the time i remembered:


storing: since we can’t eat two whole pizzas, we just put the leftovers on a pizza pan, wrapped in tin foil, and put it in the freezer, it reheats very well on the pizza stone.  you can also stop after the first baking and freeze the crust so it’s ready to be topped and baked instantly.


White Bread #1 (Sourdough version)

as promised, here is the recipe for the bread i posted a picture of previously.  the recipe is based on the Red Star White Bread #1 Recipe but altered according to Sourdough Jack’s instructions on this page.

  • 1 c active sourdough starter
  • 6.5 c bread flour
  • 1 c milk
  • 1.25 c water
  • 2 Tbsp vegetable oil
  • 1 Tbsp salt
  • 3 Tbsp sugar

to help get an idea of the time the steps take, i’ll include the time i did the various steps, based on the timestamps of the photos.

wpid-IMG_20131219_211111.jpgwpid-IMG_20131219_121353.jpg first you need enough active starter.  the pictures to the right show the starter after i fed it at 12:13pm on Dec 19, and then at 9:11pm that night when it had become very bubbly and doubled in volume.

so according to “Sourdough Jack” you start by adding 1 cup of sourdough starter to 2/3 of the flour and the liquids, so i put 4 cups of bread flour into a big bowl, along with 1 cup of sourdough starter and the milk and water.  since measuring flour by volume can result in varying amounts, i weighed each cup i put in and they appeared to be about 4.5 oz each, so that’s 18 oz of flour.  stir it all up and you should get a sort of thick batter, but definitely not something that’s a dough.


next, cover the dough and wait.  the instructions say to wait 14-16 hours, but i had this mixed up by about 9:30pm and started the next phase at 7:30am the next morning.  i suppose the longer you wait, the more intense the sour flavor is.  i also learned that if you want more sourness, use less starter.  i think this is directly related to the amount of time it takes the dough to rise.  i actually added about 1/2 cup more starter to this after that last picture.

the next morning the dough (they call this the sponge i think?) looked like this:

wpid-IMG_20131220_072559.jpgnow you want to add the other ingredients, except the rest of the flour.  so add the vegetable oil, salt, and sugar and mix it all up.  finally, add the flour, about 1 cup at a time and get it all incorporated, then dump it onto a floured surface for some kneading.  at this point it will be very sticky and if you poke it with your finger it will leave an indentation.


some photos showing the dough before kneading… the actual kneading… and after kneading.  according to the photo timestamps, i kneaded by hand for about 10 mins.  (thanks to my lovely girlfriend for taking the action shots.)  after kneading the dough should be very springy so when you poke it, it springs right back and doesn’t leave a finger hole like in the first picture.  form it into a round smooth ball and let it rest for 10 mins.  i let mine rest for almost 30 because i was distracted.

now you can form 2 loaves and let the dough rise in the loaf pans.  there are probably many good ways to form bread loaves – i only know this one so far so i use it for all the bread i make:


divide the dough in half, then spread the dough out into a rectangle.  i use my hands to flatten it first, then use a rolling pin.  i’m not sure exactly how big this is, like 12×6?  you don’t want it wider than the length of your bread pan or you’ll have to squish it in there.


start rolling up the dough tightly from the short side, and kind of press it into itself as you roll it.  when you get to the end, tuck the ends down under and then pinch all along the bottom to seal it, then put each loaf into a greased pan.  i use this wilton meatloaf pan that has a removable grease drip insert thing so i always end up with one normal loaf and one with a corrugated bottom from that insert.


now cover the loaves with some plastic wrap (spray some non-stick stuff or a little flour on it so it doesn’t stick to the dough), and wait for them to rise.  this time we’re waiting for them to get puffy so when you poke them with a finger, it does leave a small indentation.  for me, this took from 8:23am to 11:49am, so about 3.5 hours.

wpid-IMG_20131220_115101.jpgwpid-IMG_20131220_114934.jpgthe loaves rose and filled the pans and now stick up over the top.  i sliced the top of the loaves in 3 places diagonally with a razor blade to allow them to expand more in the oven, then put them in at 400 degrees for about 30 mins.  they should be done when they’re a nice brown and sound hollow, but you can also take one out, turn the loaf out onto a counter and stick an instant-read thermometer in it to see how hot it got in the middle.  depending on your altitude, you want this to be around 195-200 degrees.  you can poke it in the top but then you have a hole in your bread and that’s not cool.  if it’s not done, put it back in the oven a little longer – you don’t really need the pan anymore at this point.  if they are done, let them cool on a cooling rack, and enjoy!