Category Archives: Hardware Gadgets

Home Automation with Python…

I gave a talk at Grazer Linuxtage 2017. It’s about Home Automation and how you can use Python to realize it.

The talk covers a simple example of a DIY sensor that runs MicroPython. Finally I give a short introduction to Home Assistant, a Python Home Automation Hub, that allows you to integrate with hundreds of devices. Home Assistant offers integrations to light switches, smart lights (Hue, Trådfri, Lightify,…), door sensors, heat control units, and many others.

There is a video of my talk on my Youtube channel:

Flattr this!

DIY MQTT smart plug with MicroPython…

I’ve been playing around with MicroPython and Home Assistant. MicroPython is a ‘bare-metal’-Python flavor that you can use to program ICs. Home Assistant is a home automation and home control software written in Python 3. It can be hosted on a Raspberry Pi. It enables you to connect a vast amount of different devices: lights, switches, sensors, locks etc.

This is a raw guide on how to make your own smart plug and connecting it to MQTT which is then connected to Home Assistant.

You will need a relay board (single relay), a NodeMCU board, a power adapter for 5V, a case, a button, some wire and a 1k resistor.

Connect the devices according to this schema (WARNING: Don’t do this if you’re not comfortable handling mains power!). Don’t forget earthing (it’s not on the diagram):
circuit diagram

Flash the MicroPython firmware to the NodeMCU board. Put the ‘‘ file on it as That way it will be run when the device boots up. Adjust the code to connect to your network and MQTT server first.

You can download the code here.

My device looks like this:

See the Home Assistant documentation for how to integrate the MQTT part with Home Assistant.

The nice thing is: you can press the button to switch the device. The status of the device will update via MQTT and Home Assistant gets a correct status update. You can of course switch the device from within Home Assistant as well.

Happy hacking!

Flattr this!

Lego Lamp

More than a year ago I came across a designer lego lamp. I really liked the idea but the price tag was a little hefty. Back then the lamp cost $800 and now it is at $995. But to be honest there is no designer product like this lego lamp that really says “do it yourself” like that!

So I built one myself. I designed the basic form with Lego Digital Designer. The plan can be found here [1]. The base of the lamp uses about 800 pieces. The final build varies from the my first plan, especially in the base where I first planned to hide the foot of the old Ikea lamp. I finally just used the lamps main rod and electrical wire. The arrangement of the bricks varies to give the lamp more structural integrity and was improvised.

The parts were ordered from three different shops on BrickLink. They offered the green I wanted for the lamp at a fraction of the price of the original Lego™ store. The total price for all parts was about 60€. The lamp I had laying around was ‘free’ and the new lamp shade was about 30€. Total of about 100€ – well below the price point of the original.

[1] 2014-11-22, 18:30:

I was asked by the designer Sean Kenney, to remove the LDD plans for the lamp. He argued that the plans would hinder his ability to sell these lamps online.

Although I do not agree with Sean’s argument, that his sales might be influenced by a simple Lego™ scetch for a similar lamp, I’ve respect for the work that went into the lamps Sean designed and did take the plans down for now.

Flattr this!

Bitcoin Paper Wallet Treasure Chest…

The Bitcoin Paper Wallet Treasure Chest
The Bitcoin Paper Wallet Treasure Chest
One of the challenges with bitcoin is to store them securely. There have been several well known incidents where Bitcoins have been stolen. It is no mystery. Bitcoin IS money! It’s the same with Euros or Dollars, when you have it lying around it will eventually be missing.

There is a twist with bitcoin to regular money. With Bitcoin one single piece of information is enough for the thief to steal your Bitcoins: Your private key. With Bitcoin it’s about keeping this piece of information secret.

Continue reading Bitcoin Paper Wallet Treasure Chest…

Flattr this!

Maischebottich Severin EA 3653…

wer zuhause bier braut benötigt neben viel zeit und geduld auch die nötige ausrüstung. etwas mehr der letzteren wenn man direkt mit malz arbeitet.
hier fällt der arbeitsschritt des maischens an.

fürs maischen und würze kochen habe ich mir einen severin einkochautomat (3653) besorgt. das gerät kostet 70 euro und hat die richtige grösse. mit 29 litern fassungsvermögen geht sich ein 20 liter sud gut aus.

es gibt nur ein kleines problem, den überhitzungsschutz. dieser verhindert dass dickflüssige flüssigkeiten im einkochautomat erhitzt werden. er löst aus und das heizelement lässt sich für ein paar stunden nicht zum arbeiten überreden. um maische gut verarbeiten zu können muss man den überhitzungsschutz deaktivieren.

die gebrauchsanweisung zitiert:

Das Gerät ist durch einen speziellen Übertemperaturbegrenzer vor Überhitzung geschützt. Sollte der Überhitzungsschutz das Gerät abschalten, ziehen Sie den Netzstecker und lassen Sie das Gerät abkühlen. Anschließend ist das Gerät wieder funktionsbereit.
Achtung: Der Einkochautomat ist nur zur Erwärmung von Flüssigkeiten ausgelegt. Dickflüssige Speisen dürfen nicht erhitzt werden, da durch die ungleichmäßige Wärmeabnahme der Überhitzungsschutz das Gerät abschalten kann. Reklamationen aus diesem Grund können daher verständlicherweise nicht anerkannt werden.

das habe ich gelesen, nachdem mir der erste einkochautomat beim maischen den dienst quittiert hat und ich diesen beim händler gegen einen neuen ausgetauscht hatte.
nachdem ich wieder dasselbe gerät hatte, musste ich einen weg um den überhitzungsschutz finden. der stand im weg zwischen mir und meinem bier – das geht nicht. ergo überhitzungsschutz deaktivieren…

hier wird beschrieben wie man das macht. Continue reading Maischebottich Severin EA 3653…

Flattr this!

cryptsetup and the yubikey…

i recently set up my laptop with a new install of gentoo linux. i’ve been using gentoo for years, but not on my laptop recently.

since encryption was no issue back then i had to get myself up to speed with cryptsetup and initramfs, which you can build yourself in gentoo. there is an option via genkernel to do this automatically, but where is the fun in that?

my basic setup includes two partitions. sda1 is boot, sda2 contains a crypt device, which contains the root partition and the user’s home partition in a lvm container.

this post is about cryptsetup and the method i use to swap the password for the container on every bootup with a cycling challenge response provided by the yubikey. let’s get to it! Continue reading cryptsetup and the yubikey…

Flattr this!