Home Automation with Logstash

April 7th, 2014 robin Posted in Home, Just for Fun, Security | 3 Comments »

Home automation is a big dream of mine – I’d like to live in a house which makes living just that bit easier… which thinks ahead for me.  First step before automation is data acquisition – the house can’t make any reasonable decisions if it is not self-aware, so I’ve started kitting out our house with sensors.

The hub (home automation system)

As a hub, and home automation software I’ve taken a Raspberry Pi mini computer (about 50EUR) and installed FHEM (a perl home automation software).  I got the COC from Busware (CC1101-OneWire-Clock extension for Raspberry Pi which can send/receive on 868MHz –  65EUR), and the JeeLink (also 868MHz, but for communicating with PCA301 devices 32.50EUR).  I got some radio controlled power switches (FS20 ST-4 and PCA-301 (which also measures power usage at the socket))

Thoughts

Security

There are a lot of products available, but very few which offer real security.  By security I mean “the device I’m controlling can only be controlled by the system” – if anyone were to sit outside our house with the same equipment I have, they could read all the values, and switch any switches without a problem… so I won’t be attaching anything important devices to it any time soon…

Fail-safe

Even without any malicious intent, a thermometer failing could cause the heating to go on full, or allow a house to freeze up (unattended) in the winter… there’s a lot of safety implications which need to be thought out before blindly automating your house.

Efficiency

The sensors and RPi etc. all consume electricity and batteries, but their consumption is so minimal in comparison to the savings possible.  In our household alone (two families in one house) we consume about 5000EUR/year of electricity, water and heating oil… a 10% reduction could pay for a lot of hardware and electricity for an intelligent household.

Big Brother

As with all the NSA scandals, meta data is king.  Even if you don’t have personal tracking (RFID chip implanted into every resident…) within the house, or motion sensors, you can infer a lot from a little data: most devices have unique power signatures making it easy to identify if a washing machine or dish washer was turned on, a meal was cooked, or just a cup of tea, or tea for two… a rise in humidity in a room can mean human presence… and the combination of these keys can pretty accurately paint a picture of who is home and what they are doing.  The danger is that once this information is available, and accessible (which it has to be to perform any useful optimisation…) it could also be used for evil…

What do the results look like?

Here’s some screenshots from the Kibana web frontend

 

Power usage for my desk for a week

Power usage for my desk for a week

Household power consumption over a week

Household power consumption over a week

Temperature in two rooms for a day

Temperature in two rooms for a day

Here’s some slides from a presentation I did at Munich Perl Mongers recently


Improved stand for inductive charger

February 20th, 2014 robin Posted in Home, Reviews | Comments Off on Improved stand for inductive charger

 

A while ago I got an inductive charger (Qi) for my phone (Nexus 4).  It’s a great idea: never fiddling with that little USB plug, just grab it from the table when you go… accept for two things:

  • You have to be pretty precise when placing it, and interacting with the phone (“Oh – I just got a message!”) while it’s on the charger will often stop the charging process..
  • It’s lying flat on your table – not much good to look at

Here’s my solution:

Inductive Charger

 

It’s just three pieces of wood glued together, a hole through the base for the cable, and the inductive charger stuck to the wedge.  The block on the right keeps the phone at just the right position to charge every time you plonk it on there.

So if any of you manufacturers want to go copy this fantastic design, go ahead, and if you want to keep your karma good, just send me on a copy of the finished product and I’ll be happy to review it for you! 🙂

 


Tips for photos at a wedding

July 4th, 2013 robin Posted in Just for Fun | Comments Off on Tips for photos at a wedding

If you’re planning a wedding, or some similar big event, here’s some tips…

A Photographer

A dedicated photographer is a great thing, and while many people say “don’t expect professional photos from a friend”, you may just have the right friend.  Have a look at photos he/she has taken (at a similar kind of event – don’t look at landscapes!) before and see if you like their style.  Also consider that if you’re asking a friend to do the photography, be clear what you want them to do before the event so that they know what they’re getting into and you’re not going to make the day a torture of work for them.  A dedicated photographer is fantastic for getting a lot of high quality pictures spread over the day, and in a homogeneous quality and style, but… if you let enough monkeys hit on a keyboard you’ll get a masterpiece.

Of course if you have the resources, hiring a professional photographer will get you much more reliable results, and you can be more demanding than you would of a friend.

Encourage everyone to take lots of photos

If everyone takes photos there will be a lot of boring and fuzzy crap, but you will get a lot of different perspectives, and there will be a few great photos among them.

Don’t use disposable cameras!

Most people don’t know how to take a picture with these, having been pampered by fully automatic digital cameras the last decade.  You’ll be lucky if you get 2-3 photos per film which are in focus and reasonably lit, and even less which are actually good.  Added to that the cost of development…  You’re probably better off getting a hand full of second hand / older digital cameras and leaving them around for people to use. (idea – tie helium balloons with “here’s a camera, take a photo!” onto each camera so they get noticed and are easy to find).

Photo booth

Get / make a photo booth.  That is a camera, flashes, remote trigger, computer and screen with a method whereby the photos taken are displayed on the screen.  You can set up the lighting, perspective and background in advance, so you can guarantee technically good photos every time.  It’s amazing how much fun people have doing self and group photos, and you get a whole other view of the guests than you do by passive / room photography

Photo download laptop

Set up a laptop with a multi-card reader to download photos to.  This one didn’t work out so well for us.  A combination of some cards not being recognised, and also that most people party till they drop, and when they drop, the last thing they’re going to do is go and download the photos from their SD card for you…  It’s worth a try though, and I’d be interested to hear if anybody has different experiences.

Get everyone’s photos

So… the party is over, and every one has gone home with their cameras and the photos.  Send an email around asking people to upload their photos to you, and make it easy for them to do so (e.g. recommend Dropbox, and send a link).  You don’t want to be getting gigabytes of photos by email, and hardly anybody wants to work out how to connect to an FTP server.  More effective than a mass-email is looking through the photos you have already (when you’re tagging and rating them) and keep an eye out for a camera dangling from some ones wrist, or them looking through a viewfinder – write a personal message to these people and remind them “I saw you took photos at the wedding, and we’d love to have them!”.  Then it’s much more likely that they’ll send you their pictures, and if they reply “Oh… I only took a few and they’re not so good”, remind them that if you get the few photos from everyone you’ll have a lot, and you’ll be sure to put together a really nice compilation really soon (the carrot encouraging them to take part and send you their photos).

Use a good photo manager

As the photos come in, don’t just store them in folders and folders of mixed photos… if you do, you will never look at and enjoy them in the future.  If you don’t already use one, get a good photo management program with which you can

  • quickly browse the photos
  • do some basic improvements like cropping and colour adjustment
  • Tagging!  If you put the effort in as you look at the photos the first time to tag them, it’s really fun afterwards being able to sort out interesting groups at the snap of your fingers later.  I tag:
    • The people in a photo
    • The photographer (or camera owner – who knows who actually pressed the trigger…)
    • Other interesting groupings like “has an animal”, “someone is naked”,
  • Rating – some way to differentiate the good photos from the not-so-good ones.  I like a 5-star gradient.  This makes all the difference when you want to give someone a photo show.  There’s hardly anybody who wants to browse through 1500 photos, but if you show them the best 300 in an hour (that’s still only an average of 12 seconds per picture!) they’ll love it.  Rating allows you to quickly show the best, without having to sort-out/delete the rest.

Shotwell is a great photo manager on Linux, and I’ve heard Picasa is pretty good on Windows.

Synchronise the timestamps

Every camera has a clock, and every photo has the time when the photo was taken stored in it.  I’m a bit obsessive-compulsive on this one, but I really like browsing through the photos chronologically, regardless of who took the pictures, and the sad fact is that very few people regularly set the time on their camera against an accurate source…  here again, it’s easiest to correct the time stamp in a photo management program (select all the photos from a given photographer, and find the menu point “adjust date and time…”).  It’s good if you have at least one camera (especially if they took lots of photos) where you know that the time was set correctly.  At an event like a wedding, or sports event you will often have points in time when many people took a photo (the bride and groom walking down the isle), and that’s a good point of reference.  Just shift the photos which are off by the number of minutes/seconds by which they are off.  The nice thing is that you don’t have to do it for each individual photos because for a given camera all photos will be off by the same amount.  Another idea would be to have a dedicated “Time Master” at the event whose job it is to always have a “reference clock” (for example a small bedside radio controlled one which should be accurate to within a second), and get everybody they see with a camera to take a photo of the clock.  This photo can later be used as a very precise reference of how far off the clock on this individual camera is.

Publish the best

Once you’ve put all that effort into getting, sorting, rating and tagging the photos… publish them for all to see (who should see).  Put them on a web album and/or make a hard-copy paper book of the event for family and special friends.