Home Automation – Take 1

One of my life long objectives is to automate everything around me,but there has always been one are where due to technological limitations or high price that I never ventured to – home automation.

I’ve had a set of Philips Hue lights for a couple of years, and some other random bits of pieces (1 Wemo plug, Netatmo weather sensors,…) , but nothing that was really running “automatically” or was in any way grouped together.

This all changed when my friend Konstantinos brought me a Google Home device over from the US.I was surprised with how it finally made the Philips Hue lamps more than a gimmick and actually made them more flexible, but at the same time it was clear to me that Google Home still does little to integrate all of the random little devices that exist out there (yes, it has ifttt integration, but it’s not only slow  but extremely limited), many of them not more than stupid ideas, many still lacking a lot to make them truly useful, but others, if used correctly (and with a lot of patience) actually quite flexible and surprisingly useful (some would disagree here) in day to day life.

After some research , I came across home-assistant.io, an open source hub for a lot of devices and online services (as I’m writing this it has support for 583 components). Home assistant allowed me to integrate all of the devices I had and made them work together, and allowed me to script simple but useful functionality (eg. turn on hue lights 1 hour before sunset if we are at home). For the stats geeks it also allows for integration with Grafana.

Main issue with home assistant ? It made me want to automate more ! I eventually purchased a set of zwave (a wireless networking protocol) devices to be able to act on other parts of the apartment (turn on light relays, close/open shades) as well as to trigger action on movement or door’s opening as well as a Logitech Harmony Hub to be able to trigger actions via infrared.

For most people out there most of these automations are unnecessary or just a sign of laziness. For me they are a demonstration of what consumer technology is able to do when pushed a little bit beyond its normal uses.

Below is my current device list as well as what they are currently being used for.

  • 2x Google Home – Voice Control (lights, scenes [eg. bedtime, watch tv])
  • Logitech Harmony Hub – Infrared control (Interact with TV, Amplifier, Cable receiver)
  • Philips Hue lights – A lot of them spread out through out the apartment
  • 2x Aeontec Door Sensor – Apartment door (sends alert to phones if door is opened and there is no one home); home office door (turns lights on if darkside when door is opened, turns light of when door is closed)
  • Aeontec Multisensor – Turns on dinning room lights if we sit at table and it’s dark
  • Fibaro Switch – Allows turning hall lights on or off
  • Fibaro Roller Shutter – Control of electrical window shade (automatically closes when no one is home and living room get’s too warm) ; Closes down when entering “Watch TV” scene
  • Netatmo Sensors – Humidity, Temperature and CO2 sensors
  • A few Mi Flower Sensors – Measuring humidity and sending alerts when it gets too low

Other non-core components that also interact with this : Yamaha Amplifier, Chromecast, nVidia Shield TV (curious to see what role it will take once Google Assistant is integrated), Lametric time, Plex, …

Some other automations:

  • Bedroom lights fading on automatically in the morning and dimming of at night;
  • Living rooms dimming during dinner, and dimming off at night;
  • TV turning on to night news if I’m at home;
  • (…)

I consider this to be only the beginning, and there is a lot of tuning still to be done, but I find it amazing how much can already be done with so little tinkering.

 

Raspberry PI (auto) Flickr uploader

I’ve always used Flickr as the main backup repository for my DSLR photos, but I have to admit that their desktop uploading solution was never one that I really liked…

Usually I don’t like to have to leave my workstation on just to upload photos, and I don’t like to use it while photos are being uploaded because the bandwidth usage makes Chrome extremely slow, so I decided that I needed a way to upload my photos as automatically as possible (at least the JPG versions, the RAW/NEF files are a different story…).

This seemed like a great chance to play with my Raspberry PI 3. I googled around and didn’t find anything that did what I wanted, so I did a simple Python script that is fired up by usbmount whenever a mass storage device is connected and uploads the files to Flickr.

If anyone is interested, just head to github.com/drcursor/flickrup.

ceph single node deployment on Debian Jessie

This is obviously only interesting for testing purposes, but it was still painful enough without any complete guides and with current issues that Jewel and Hammer have running on Jessie.

  • Make sure you can ssh to localhost without manually entering a password
  • Install dnsmasq

apt-get install dnsmasq

  • Make sure the host returned by hostname -f resolves to an ip address other than a loopback
  •  Add the apt source :

wget -q -O- ‘https://download.ceph.com/keys/release.asc’ | sudo apt-key add –
echo deb http://download.ceph.com/debian-hammer/ jessie main | sudo tee /etc/apt/sources.list.d/ceph.list
apt-get update

Important to notice that I added the hammer repo instead of the most recent one, jewel.  I was able to get jewel running without any issues on Ubuntu, but on Jessie, it just refused to work.

  • Install ceph-deploy – this tool will to all the heavy lifting for you, no need to manually configure everything.

apt-get install ceph-deploy

Easy enough, eh ? You want to go the manual way, instead of using ceph-deploy? Be my guest.

  • Now let’s create the initial configurations with ceph-deploy. First we are going to cd into a new directory, where ceph-deploy will create config and access key files.  For this example ceph-test-1 is the hostname returned by running hostname -f.

mkdir mycephfiles
cd mycephfiles
ceph-deploy new ceph-test-1
echo “osd crush chooseleaf type = 0” >> ceph.conf
echo “osd pool default size = 1” >> ceph.conf

The 2 last lines are there to ensure that ceph will be happy with just one node running and won’t wait for new nodes to join. Take a look at ceph.conf, it will be used in all the following steps.

  • This step will install ceph itself. If we were installing into multiple nodes, this command would essentially ssh into those nodes, install ceph, and copy the configuration and key files created in the previous step.

ceph-deploy install –no-adjust-repos ceph-test-1

The argument no-adjust-repos is required here to ensure that ceph-deploy doesn’t install the latest version of ceph, and keeps using the repos defined at the start.

  • This step creates the ceph monitor

ceph-deploy mon create-initial

I had some issues running this on a fully updated Jessie installation. If you get an error about starting services, edit /usr/lib/python2.7/dist-packages/ceph_deploy/hosts/debian/__init__.py and comment out lines 27, 28,29 and run the command again. This is due to the system looking for a systemd init script when its actually still sysvinit.

  • We can now create our osd

mkdir /osd
ceph-deploy osd create ceph-test-1:/osd
ceph-deploy osd activate ceph-test-1:/osd

I’m using here a normal directory, you could also choose to use a block device, but for testing this is usually more than enough.

  • To check that everything worked you can now run the following commands

ceph health
ceph status

Health should be OK, and there should be one osd up.

  • If you need to restart the entire process, run the following commands

ceph-deploy purge ceph-test-1
ceph-deploy purgedata ceph-test-1
ceph-deploy forgetkeys
rm -rf /srv/ceph/osd /osd

  • To create and map an rbd you can use the following

rbd create test –size 4096 -m ceph-test-1
rbd map foo –name client.admin

You should now be able to format and mount the rbd as you would with any block device.

  • Current rbd mappings can be listed with the following command

rbd showmapped

References

Kindle Oasis short review

I’m a fairly occasional book consumer, and a very frequent gadget user. I usually read books in their original format, but over the last couple of months I’ve started using my old, but trusty, Kindle 3rd Generation on my commutes to work.

I’ve never found the Kindle to be very comfortable to use – I always struggled to find a correct position to hold it – and the latest generations never seemed interesting to me because they kept the same physical format and actually made it a little bit worse by removing the buttons. I thought about buying the Kindle Voyage (name always reminds me of this) as it had a much better screen than my 3rd Gen. Kindle but contrary to all other models, reimplemented the buttons (kind of), but decided to wait for Amazon to come up with something new.

Low and behold – Kindle Oasis, the new Kindle is upon us. After the initial images I was sold, as the ergonomics finally seemed to fit with what I would expect from this kind of device. Once it was finally officially announced, and even though the price is quite high I decided that I would give it a try.

First reviews were all unanimous : great quality, good ergonomics, evolutionary but not revolutionary, expensive (some like the Huffington Post, even use the kindle as an example of consumer waste), not waterproof.

I honestly couldn’t care less about the waterproofing – not sure where people are using their kindles, but on my daily use there is no water involved. Price was obviously the biggest let down, but I still think that taking into account the quality of the device, and comparing it with other “gadgets” like tablets or smartphones, it isn’t exceedingly expensive.

The Kindle box greets you with a Voltaire quote “I don’t know where I am going, but I am on my way.” and informs you of the Kindle Oasis real name “Kindle Generation 8”. Inside it two boxes, one for the battery cover, and another one for the Kindle reader itself.

The device itself and the cover are great to hold – it would be great if they had 10 or 20 grams less, but you can see that they made an effort to make the weight balanced and the touch soft on both plastic and felt parts. The grip is great on both left or right hand usage.

Upgrading from the 3rd to the 8th generation also meant getting a new version of the Kindle software (users coming from Paperwhite or touch devices won’t see much difference) – X-Ray, GoodReads integration, new book shelf screen, etc.

Screen is amazing – instead of the greyed out screen I was used to, I’m presented with a white screen with great definition. Looking at the old Kindle screen now seems to me like looking at an old washed out book.

First usage issue I had was with the page up/page down buttons – even though they were on the same position as on my old Kindle, it just felt weird to use the top button for Page Down and the bottom button for Page Up. On the 4th Generation it felt much more natural as the buttons had different sizes. Amazon must have felt this could be an issue as they added an option allowing you to invert the buttons.

Second usage issue, was related to the touch. There is no way to disable page flipping on touch (I learned later that the Kindle Voyage suffered from the same issue). This is actually very cumbersome as any unintentional touching of the screen causes a page change. Amazon could easily add an option to disable page flipping or at least to define sensibility/time until touch acts.

All in all the Kindle Oasis is a great upgrade. Is it worth it if you already have a Kindle? Probably not, unless like me you have a Generation 4 or older device. But if you are looking for your first e-reader – this is the device to buy.

Don’t forget that like with all other Kindles, you can easily copy .mobi files and read them with the same quality as the books you would buy from Amazon. This Kindle has 4 GB of storage, so more than enough space for any “normal” personal library.

 

IKEA Electric Standing Desk

Ever since I started using an electric standing desk at work, I’ve wanted to have the same solution at home.

Up until recently this goal was put aside due to the very high prices of electrical standing desks ($1200/$2000). I even thought about getting a “normal” standing desk, but in all honesty, I’m quite sure I wouldn’t use it regularly – not only it’s not the healthiest of solutions (sitting all day long is bad, but standing all day long can be even worse…), I’m quite lazy and as such would easily revert to using some other desk in the house, or even worse – work from the couch.

Last week I noticed that IKEA had an interesting new solution (Bekant) for standing desks, and one that doesn’t break the bank (~$670) – only issue – the size! Even though they have it available in different sizes and forms (including corner solutions) – they were all just too large. After doing some research (that included reading some dreadful reviews), I was able to determine that I could actually buy the electrical feet and use a smaller desk top (I wanted something shorter than 80cm, was able to get 60cm ).

This solution is not “supported” by IKEA, but required almost no adaptation – I had to drill 4 holes on the table top to screw in the legs (took me around 25 minutes to measure and drill and an extra 25 minutes to assemble the legs). Table is sturdy and stable even when at full height. Motor noise speed is exactly the same as in all other electric standing desks I tried out in the past and is not disturbing at all. Getting from sitting to standing position takes around 10 to 15 seconds (see video at the end of the post).

Given that it’s also very comfortable when sitting I’m now using this very simple but effective standing desk app.

Next steps ? Arduino the hell out of it and make it change positions via the standing desk app. I already checked and the buttons don’t work by closing a circuit, so I need to do some further research (I would welcome anyone wanting to give me some pointers here).

Quite proud of the result 🙂

Addendum #1

As so many people have asked for the parts list, here it is:

Addendum #2

More than a couple of people asked for a video of the table going up and down, so here it is:

How to update a rooted Nexus device

Google has finally started to provide their users with monthly security updates.

This is good news for everyone, but more work for those of us who have rooted phones, as the OTA updates check if the system was modified before installing, and refuse to install if it was.

For rooted users, the solution, although a little bit extensive, is quite easy – flashing all the system files, and re-rooting the device.

The following is needed before starting:

Notice: The following procedure will keep all user data (some system settings are reset), but as with all system upgrades, a backup is advisable. Any and all damage you might  do to your device and your data is your full responsibility. I’m assuming anyone attempting this will already have experience using fastboot and adb.

Before starting make sure that USB debugging is enabled and that the computer you are going to use is authorised.

After extracting the factory image and booting into Fastboot Mode (usually Volume Down + Power), the following steps should be executed:

fastboot flash bootloader bootloader-angler-angler-xx.xx.img
fastboot reboot-bootloader
fastboot flash radio radio-angler-angler-xx.xx.img
fastboot reboot-bootloader
fastboot flash boot boot.img
fastboot erase cache
fastboot flash cache cache.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash vendor vendor.img

The system should now be able to boot, but it will be un-rooted.

To root it, the following should be executed after entering Fastboot Mode.

fastboot flash recovery twrp-2.8.7.2-angler.img
fastboot reboot-bootloader

After this, enter Recovery Mode (through the Fastboot Mode menu) and flash the SuperSU zip file (if needed, adb push can be used to upload the file). After rebooting the phone should be rooted and running the latest version of Android.

This was successfully tested on 2015.12.08, upgrading from Android 6.0.0 to 6.0.1 on the following devices :

  • Nexus 6p
  • Nexus 6
  • Nexus 5

Playlist for a grimy day

To break the silence, here is a playlist suggestion for a grimy day.

Playlist Link

  • The XX – You Got The Love (Florence And The Machine cover)
  • Portishead – Give Me A Reason To Love You
  • Sleeping At last – 99 Red Balloons
  • Katie Melua – Wonderful Life
  • Radioactive – Madilyn Bailey (Imagine Dragons Acoustic Cover)
  • Antony and the Johnsons – Knocking on Heaven’s door
  • Vintage Postmodern Jukebox Radiohead Cover ft. Haley Reinhart – Creep
  • Lenna Bahule – Nakupenda
  • Vicente Palma – Como Um Sonho Acordado [Fausto]
  • Voz E Guitarra 2: Márcia + Dead Combo – Visões Ficções

Abandon-blog?

Pripyat Gym

Pripyat Gym

After a couple of years of neglect, time has finally come to refresh this blog a little bit.

A new front page, new responsive theme and a lot of changes in the way information is organised.

Why all this trouble if no one is reading? No idea… 🙂

Nailed it!

Dilbert

Older posts

© 2017 E. Balsa

Theme based on hemingway and unoUp ↑