

Home automation using Node.js, raspberry pi and tinkerforge - qknight
http://blog.lastlog.de/posts/tinkerforge_relais_rapspberry_pi/

======
dmritard96
Nice writeup! Aand tinkerforge is pretty interesting, never heard of it. Wrote
something for my own home that I use everyday. It mostly controls my
IR/X10/XBMC/etc. but it has scheduling and a UI to build custom remotes. I
host it on a tower connected to my tv and/or one of my raspi's and use
arduino's to farm out the work. I have found that reliability is not too too
hard to get down, but understanding state is where things get messy.
Especially with IR beacuse it's one way. Contemplated a camera or stick on
light sensors. Still haven't come up with a satisfactory idea. It was my first
django app with jquery mobile on the frontend. I find that serving it up via a
raspi is a bit heavy though. Maybe some simple profiling would fix.
[https://github.com/dandroid88/webmote](https://github.com/dandroid88/webmote)

~~~
qknight
interesting. this one-way problem was the main reason not to use 433mhz
controllers.

thanks for your posting.

------
ar7hur
Very interesting writeup, that's a cool project.

Now to make it still cooler and Jarvis-like, you can add voice commands with
the Raspberry Pi. Somebody did it here [1] using the Wit Speech API [2]

[1] [http://blog.fmpwizard.com/blog/go-cortex-using-wit-ai-
using-...](http://blog.fmpwizard.com/blog/go-cortex-using-wit-ai-using-
raspberrypi-using-arduino)

[2] [https://wit.ai/blog/2014/02/12/speech-
api](https://wit.ai/blog/2014/02/12/speech-api)

~~~
qknight
thanks for your feedback! it is very cool stuff but i do not want to rely on
external SaaS stuff.

anyway, it seems to be really cool - especially the part where the server
replies with JSON ;-)

------
Tepix
Using the super cheap 433mhz wirelessly switchable power plugs using the
raspberry pi is also super low cost, it's just not secure against tampering.
[https://blog.codecentric.de/en/2013/03/home-automation-
with-...](https://blog.codecentric.de/en/2013/03/home-automation-with-
angularjs-and-node-js-on-a-raspberry-pi/) has some details.

~~~
bafjohnson
I have a good number of 433mhz switchable & dimmable outlets controlled by an
Arduino with a 433mhz transmitter. It was a good weekend project that I am
extending at the moment - including real world controls of my Sonos components
(the Arduino talking to them via SOAP).

I've just ordered 10m of RGB LED strip, which is the next component I plan to
control with an Arduino which will communicate with the first via an Ethernet
shield and a protocol I am yet to devise!

Yes, all of this is fairly pointless but it's keeping my brain active whilst I
recover from some fairly extensive surgery!

------
jsumrall
I've been thinking of my own way to do something similar, but this setup seems
(after reading the first part and looking over the rest) too easy to screw up
and do something dangerous with a lot of electricity for me. Proceed with
caution.

~~~
bradyd
For a safer method of interfacing with AC voltage you can use something like
the PowerSwitch Tail[1]. It is a little pricy (~$26 at Adafruit.com) and only
works with one plug, but it means that you don't have to mess with AC voltage
directly.

@cscru There is a 240V kit version of the PowerSwitch tail available.

[1] [http://www.powerswitchtail.com](http://www.powerswitchtail.com)

~~~
qknight
good point. but i do think that my setup works stable and safe for me.

however, i had added the disclaimer because others might be facing a different
situation and therefore they are warned.

------
davidw
If you want to try out another technology, Erlang would be a pretty good fit
for this.

~~~
lostcolony
I think better for him to use Node (or really, any language that will simply
fall over in the case of failure), unless extremely familiar with a supervisor
paradigm. Given the warnings he prefaces everything with, including not to
toggle a relais(?) more than 10/min, it seems all too easy to accidentally
have a supervisor strategy that in the face of failure could surpass that.

~~~
klibertp
"including not to toggle a relais(?) more than 10/min"

That's actually exactly what the latter two configuration parameters for OTP
supervisors are for - to tell the supervisor how many failures in what unit of
time it should consider "normal".

~~~
lostcolony
I know. Does -he- know, though? That was my point. Per the original comment,
Erlang -would- be perfect for it. It would not, however, be perfect for
someone who is not knowledgeable about OTP to use it as a learning project,
because any oversight that leads to unexpected behaviors could burn his house
down (or whatever toggling a relais too much does).

------
frik
Nice article. Never heard of tinkerforge before, interesting tech. And using
Node.js for home automation is interesting. I wrote my home automation in C
and use various Arduino's and I plan to add some Pi's.

------
eik3_de
I installed Loxone[1] when we built a house and can recommend it. Works right
out of the box with web and mobile apps and has multiple APIs to hack with.
Only (minor) downside is that you need a VirtualBox for the (otherwise good)
configuration software if you're not on Windows.

[1] [http://www.loxone.com/enus/](http://www.loxone.com/enus/)

~~~
nacs
At $550 just for the controller, $109 for a light sensor and $160 for a
temperature sensor, it seems quite pricy.

~~~
qknight
i guess my setup is about 200-300 euros summing all the single devices and
casings together.

this does not include the days of assembling the hardware.

