Latest blog entries

The Linux of Things

Saturday, January 26th, 2019 at 3:49 pm

As is becoming a habit, January for me means attending linux.conf.au which this time around was held in Christchurch, New Zealand.

The theme this year was “The Linux of Things” and rather than paraphrase the definition I will simply quote part of it:

“Building on the role that Linux plays in our everyday lives, we will address IoT-related opportunities and concerns from the purely technical through environmental, health, privacy, security and more.”

Those who know or follow me should immediately spot that that this is strongly aligned with my recent enthusiasm for home automation. I lost count of how many conversations I had with people about what I had done and what they had done, then there were a number of relevant talks that added more information into the mix. It is a lot to think about…

A few of the bigger takeaways are:

  • Home Assistant is good for automation and displaying recent history, but store long term history elsewhere.
  • Use what you are comfortable with. For others this may mean off the shelf devices, but for me this means I will continue building simple functionality into arduinos.
  • What you actually do is also highly personalised. Just because someone triggers the aircon in their office to turn on when they make their first cup of coffee doesn’t mean that you have to as well.
  • Always learn from what other people have done, and just as importantly share what you have done so others can learn from you.

That last point isn’t really new or home automation related, it is part of the philsophy underpinning open source itself, so not surprising that it came up (a lot) at an open source conference ;)

As is also becoming a habit, I am not going to travel to another country just for one week, in a similar way that I followed up Hobart 2017 with a road trip, I am also following up Christchurch 2019 with a road trip:

I will need to hold off (for now) the planning a road trip from the Gold Coast, because that is where LCA will be in 2020…

Tagged with: , ,

Those slow flashes

Thursday, December 6th, 2018 at 10:21 pm

Today was was my first time riding to work in too long and although there was plenty of light, as I rode on the suspended section under the freeway near Kooyong I was reminded of something that annoys me because it can be dangerous: a slow flashing front light.

So what am I talking about? Consider this road rule:

259. Riding at night
    The rider of a bicycle must not ride at night, or in hazardous weather
    conditions causing reduced visibility, unless the bicycle, or the rider, displays -
    (a) a flashing or steady white light that is clearly visible for at least 200 metres
        from the front of the bicycle; and
    (b) a flashing or steady red light that is clearly visible for at least 200 metres
        from the rear of the bicycle; and
    (c) a red reflector that is clearly visible for at least 50 metres from the rear of
        the bicycle when light is projected onto it by a vehicle's headlight on low-beam

On its face this is all reasonable, my particular issue is with the word “flashing” because it doesn’t indicate how slow or fast the flash should be.

I prefer a fast flash as it draws your attention, but is still continuous enough that you can follow where it is, especially when there is a bend or obstructions.

On the other hand a slow (where you can notice the delay) flash I find to be dangerous as you may not have seen enough flashes to get an idea of the direction and speed the bike is moving, before you need to allow for the direction to be changing because of a bend or curve in the path.

The compounding factor with this morning’s example was that it was also a super bright light. The sun wasn’t quite up and the freeway casts a decent shadow, it isn’t good to be faced with a blinding intermittent light on a narrow path with metal railings on both sides.

For the record I had my lights on, if I want to see I have the front on steady, but I wanted to be seen so today was the fast flash…

Tagged with: ,

From broadcast to stream

Saturday, December 1st, 2018 at 9:02 pm

Once I had my central heating controlled by Home Assistant based on a schedule in Google Calendar I started to think about how I could also control my stereo that I use as my alarm clock. This 25 cd stacker double tape desk stereo (purchase from Brashs gives an idea of how long I have had it) was the final clock in my house (I’m considering my car stereo to be out in the garage) that I would need to adjust for daylight saving.

My first thought was to find a manually tuned radio that I could just control the power of via a relay. I was able to find a few cheap radios, but they all had electronic tuners, so you couldn’t just kill the power. I also didn’t want to use an old radio, because it wouldn’t be as nice.

Next I started looking into playing back the infrared codes from the remote control for my stereo. This looked promising, but I was starting to like the idea of getting rid of the reasonably large stereo.

I briefly looked into a radio tuner module controlled by the Arduino. This would give me the ability to remotely tune to different stations, but it would also need some form of powered speakers that turned of/off at the same time.

Another option was a network speaker and I considered some cheap wifi speakers, but dismissed them when I found that nobody had integrated with them, I also didn’t find anything good said about the phone app they use for control. Also on the network speaker approach were options like a Sonos or a Google Assistant speaker. These are a lot more expensive and require cloud integration that I didn’t like.

The solution I went with was a network speaker somewhere in the middle, a speaker with integrated Chromecast. These have been discontinued in favour of more expensive models with Google Assistant, (I was able to find a new one on ebay for a very reasonable price) but with the advantage over a cheap speaker of there being a Google Cast component in Home Assistant.

Once setup on my wifi network it was again fairly straightforward to create automations to trigger playback from a network URL, the tricky part turned out to be finding the streaming URL for the radio station I wanted. If you go to there website the stream is provided by iheartradio which I couldn’t get to work, but I found a different source for the same station from the website of the radio network.

This has been working well (and I reclaimed space where the old stereo used to sit) but it does feel a bit wrong to change from receiving a broadcast over the air to downloading a network stream, it goes against one of my goals of not relying on internet/cloud services, although it can be rightly pointed out that using Google Calendar for the schedule already violates that goal…

Tagged with:

Controlling the heating

Tuesday, November 27th, 2018 at 9:52 pm

After achieving my first long term goal of a clock that I do not need to adjust for Daylight Saving, I moved onto remote control of my central heating. Thanks to some Home Assistant components this came together quite easily.

I have gas ducted central heating with a controller mounted in a central location. You could say I didn’t need to change a thing as it was already “smart”:

Yeah, nah…

This is what is referred to as a 5+2 programmable thermostat, there are two sets of schedules, one for the five days of the week and another for the two days of the weekend. The interface between this thermostat and the heating unit itself a pair of wires carrying around 25VAC, close the circuit to turn the unit on, this would be done instead by a relay connected to an Arduino.

On the user interface side I was planning to use a Google Calendar as I could put in events to represent the schedule and I could already manipulate it from my phone the the web interface which covers off remote access. The regular schedule would be in as repeating events, but I could adjust them as needed if I knew I wasn’t going to be home until later than usual.

My original plan had been to write something that would query the google calendar and push that information to the thermostat Arduino which would compare the target temperature against the current temperature and set the state of the relay appropriately. This approached changed when I saw that there was a Generic Thermostat component in Home Assistant that would handle the logic of being a thermostat. I wouldn’t need to implement that on an Arduino, it could just be a dumb relay control for Home Assistant to turn on or off. As Home Assistant can use any type of switch component for this and I was already basing things around MQTT I looked at the MQTT Switch component.

I don’t really know how a switch should be implemented, but from the desired behaviour it was easy to work out that the Arduino would listen on a topic for a state (OFF/ON) and ideally it would publish the new (or current) state on another topic. An additional thing I added was a failsafe, the relay would timeout after five minutes, if something went wrong (eg wireless went down or Home Assistant crashed) I didn’t want the heating to run forever.

I did encounter one snag with the relay shield that I had, it was hardwired to have the relay on pin D1, but that was one of the default I2C pins. While I wasn’t using one of the I2C displays in this situation, I was trying to share code between my devices. Later versions of this relay shield let you configure which pin it uses, so in my case my I pulled out the D1 pin (I had already soldered it up) and ran a wire around to another pin.

Adding the switch logic to the Arudino sketch didn’t take long, nor did adding the configuration to Home Assistant, so it wasn’t long until I has it connected up for testing:

This worked well, so I moved onto implementing the scheduling aspect using the Google Calendar Event component and automations.

Despite parts of the documentation not matching the implmentation (I need to follow that up, possibly asking on the forum or even submitting a patch…) it wasn’t long until I had automations configured to set the target temperature when a calendar event started, and to then turn off the thermostat when the event ended.

It was now a waiting game as I needed to let the automations trigger over time, and I also needed the weather to cooperate. Fortunately I am in Melbourne where despite it almost being summer we had a week or so of cool enough weather for this to happen:

I was quite happy with this, just in time for summer to really kick in and I no longer have a need for central heating… but that does give me time to sort out a proper mounting and power supply. I was initially thinking about finding some kind of unobtrusive box to mount on the wall, but the idea of featuring the electronics (such as a Tripler Base mounted to a blank plate) is growing on me…

Tagged with:

Linking bricks

Thursday, November 22nd, 2018 at 6:16 pm

Many years ago I picked up a bulk lot of Lego because it included most of a set that I had always dreamed of having, the Car Chassis from 1980:

Lego Car Chassis (8860) with box

The most obvious pieces missing are two of the wheels, so at the time I picked up some replacements through eBay and that is how the set has been since then. When I put the set together I kept a list of the missing pieces, which I forgot about until coming across it around the same time that this video came out showing how to use BrickLink to part out a set and order the pieces from various sellers:


How to buy cheap retired LEGO sets LEGALLY! – YouTube

Although there were a couple of sets I wanted to try this on, I decided to test out the process using the handfull of missing pieces from the Car Chassis. This was successful and while I haven’t gone back to add those pieces to the assembled set, I have put together two sets at a cost lower than a used set is selling for and much lower than what a new set sells for.

So which sets am I referring to?

First up was the Curiosity Rover:

LEGO 21104 NASA Mars Science Laboratory Curiosity Rover

Followed by a Lunar Lander:

LEGO 10029 Lunar Lander

For the lunar lander in particular I opted to not to get the stickers or the minifigs, while they would have been nice, they were also the same price as all the other pieces combined, so no.

In confunction with a Space Shuttle, a Saturn V and Women of NASA, I now have the top of two Billy bookcases dedicated to NASA sets. I’m not sure if there are any other sets I will put together this way, but I won’t rule it out…

Tagged with: