Thursday, February 4, 2016

Home Automation - Raspberry flavour

Wireless indoor lighting, sort-of

If you've been to Sweden on different times of the year, you quickly notice that the amount of sunlight varies between 5 hours to 20 hours. Hence, in the winter, you want the lights on quite a bit,

To avoid adjusting the light timers to account for the dusk/dawn moving about 15 minutes per week in spring and autumn, I've wireless:d a lot of the lighting with the help of a Raspberry Pi 2 Moveld B, a 2.8" touchscreen, a Tellstick Duo and a ok-ish Java program called NexaHome. I've mainly used Nexa and Proove switches and relays. The latter are cheaper and works just as well. The Proove switches' relays give a good "thunk" when switching on or off and that actually feels safer than something quiet and tiny, especially when you're dealing with mains voltage.

There are plenty of guides on the Internet on how to setup each of these, all better than what I can write. Suffice to say, installing Raspbian and downloading & installing packages (Java, Qt, etc), compiling what you need (the Telldus daemon/GUI and touchscreen driver) and setting everything up wasn't too hard.

The setup works pretty well and the wireless 433 MHz signal reaches 15 m to our storehouse where we have some christmas lights hooked up. NexaHome has a web server so I spent a few minutes crafting a special webpage to fit the RaspBerry's touchscreen. Thus, one can control the lights by not having a smartphone. I like that, but I also like being able to shut off the lights from bed if I went to sleep a bit earlier.



The main issue I had with the setup once I got it up and running was that I couldn't get the touch screen and the HDMI output to work at the same time. I think it's just a limitation of how the driver was written at the time. (Maybe it has changed now). It'd been nice to use it as a media player or some such, but with Netflix, Spotify and Viaplay via Chromecast, we're pretty well set and I haven't missed it. Nowadays I don't have time to consume as much media, so the few series/movies I watch I can pay for. (Not like back in college where I had watched ~140 Naruto episodes in a month or two.)

The NexaHome software isn't the best nor greatest, but it has worked for me over a year or two, so I've actually donated a bit. The commercial alternative was SwitchKing, but I felt the price at the time (250 SEK, ~25€) was a bit too much since what I had at no-cost worked. I noticed that the price has recently dropped as the authors have put the project into support-mode, so it may be worth taking a look again. However, having worked with real industrial PLC:s the recent year, I'd much prefer something of that sort now.

Anyway,  the Pi will probably serve it's duty as a home (lighting) automation center for a few years to come. The 433 MHz RF system is nice and good value-for-money, even though it misses a light or two sometimes (even on repeat, but rarely more than a few times per month),

We'll see what happens when or if new requirements are needed.


Next post will be about my (scrapped) first plan for the house's sun blinders ... and maybe hint of what duty that Arduino will actually end up doing...

TTFN.

Thursday, January 28, 2016

I'm back!

So, after a three year hiatus on postings I'm here again! Yaay!

This post will be the first of a short-ish recap of past highlights and future plans, of which I am quite excited. I will also try and keep the posts shorter but more frequent.

Professional life changes

Halfway through that time I changed employer, and managed to learn quite a few new tricks at the new place. I'm still doing software development, but as a consultant, which has exposed me to a lot of new people, places, projects, PLC:s and PowerPoints. (And companies, languages, APIs and hardware, but those don't start with a p. ;)

My current job is as a (heavily developing) systems architect at Bit Addict. The company is lead by an old friend of mine from the university days, and I signed on as peon #1. We've grown from 2 to 5 people in 1,5 years and are targeting around 8-10 in a few years. We're doing software work for manufacturing & automation companies, ranging from ERP-integrations all the way to safety hardware installation. Our customer are pretty high tech, high power lasers (4-6 kW), titanium 3D printers or surgery simulations, so the applications are quite exciting.

Nevertheless, the best part is that we're out there, doing good work that our customers appreciate and building a company and relations by our own. A lot is being learnt, but as long as one avoids making the same mistake twice, it's all part of the process.

Reminiscing...

I suggested the name of the company as I used the same name for a small PC demo a friend and I did together for DreamHack 1997 (this was back in high-school). This, kids, was when all we had to play with was a framebuffer and a weak CPU. No libraries, APIs or GPUs or whatnots. It was all our own code, except for the music-player, the VGA-mode setter, and a bit of interpolation code we got from his big brother.

You can still download and run it in a DOS emulator if you want to. It's not that good, honestly, but as we came in 3rd place out of 7-ish entries,  I suppose a tiny bit of pride is in order. This was back when there was about 400 attendees with their own computers, as opposed to 9500 last year (2015).

It's a different world today, since the competition is more about creativity than technology, but looking at 4K or 64K demos never fails to impress.

I actually got a huge flashback to the demo scene days by playing TIS-100 over the holiday (christmas gift from a friend, thanks Nix!). The fun part if the game is sitting and optimizing a program until it is as small, fast or efficient as it can be. The downer is that I can't fool my brain into thinking it's a game all the time, thus it feels a bit close to work at times. Still, good fun and recommended to anyone who've done a bit of assembler hacking in their youth.


My next post will be about ... Home Automation!  .. Starring a raspberry pi... Stay tuned.

TTFN.