Friday 28 November 2014

Superfast broadband will be coming to Coldingham

UPDATE 27th April 2017 : Latest Progress


UPDATE 20th April 2015: Coldingham is listed on the list of exchanges next for upgrading!
http://www.digitalscotland.org/news/thousands-more-homes-in-scotland-set-for-a-superfast-broadband-boost/


If you're following the national superfast broadband rollout you'll know that progress across Scotland is steadily being made.  In the last few weeks, I've noticed several new green fibre cabinets popping up across the Scottish Borders, and some are even getting close to where I live!  However, it was with disappointment that I read most recently that although the exchanges of Ayton and Eyemouth were being upgraded (by the end of 2014), Coldingham was not yet on the list.  How could a village like Coldingham, the same size as Ayton but with a swelling tourist population in the summer, be left behind?  I decided to investigate.

By effectively making a nuisance of myself, I made contact with a very helpful senior member of the Digital Scotland project team.  He explained the reason.

The BT infrastructure, made up of local exchanges and larger aggregation points was the reason Coldingham was being upgraded on a different timescale to the towns and villages around it.  Both Eyemouth and Ayton exchange are connected to (aggregated by) an exchange in Berwick which already has superfast equipment installed.  However, Coldingham (along with Reston, Abby St Bathans and Cockburnspath) is connected to an exchange at Grantshouse - and you guessed, it doesn't have the superfast equipment installed yet.  Therefore, any work to enable broadband in Coldingham is dependant on Grantshouse getting it first.  The good news is that we are scheduled to receive superfast broadband, the current plan enables this in July-December 2016.  At the time of writing, that's still some way off which is frustrating when our immediate neighbours are able to stream cute kitten videos so much faster.

The next question is of course whether you'll actually see an improvement in speed when the technology arrives!  BT are installing new green street cabinets like this one that are closer to your property and therefore can offer faster speeds to your home.  But where they are placed and how many are built is still a mystery, even to the project team!  Each one can cost anywhere between 15K to 50K depending on the available land, power and access, but BT are being incentivised by the number of houses they "enable" and also by the number of houses they enable at above 24Mbps (the European standard that subjectively defines what 'superfast' means).  So here's hoping you get one near to you!

The good news is that the Scottish rollout is looking at alternative technologies that still deliver superfast speeds to those who are more remote.  Fibre-Optic cable all the way from the exchange to a house is known as FTTP and is being used in some cases in the Borders.  This is the ultimate goal as it will enable a completely future-proof connection without the problems associated with copper cables.  Secondly, they are looking at a relatively new method of delivery called Fibre to the Remote Node (FTTRN) which effectively puts a much smaller version of the green cabinet on top of a telegraph pole nearer to your house.

If you want to know more, the Digital Scotland website gives some good information and they've just updated their map tool to show more detailed information about specific locations.

Looking on the positive side, the "delay" in getting superfast broadband to Coldingham and the surrounding area means that the technology may be more advanced by the time it arrives, giving us more options and ultimately a better service.  There may only be 22 days until Christmas 2014, but I'm counting the days until Christmas 2016 (757 if you're interested!)




Thursday 19 June 2014

How to make your Nest Thermostat email you when "auto-away"

While Nest are still to release details of their API, some clever people have already deconstructed the methods by which your Nest Thermostat (and Nest Protect) talks back to Nest Cloud HQ and have released a PHP script which can pull data from Nest Cloud HQ, allowing you to do with it, whatever you want!

Some examples of the things that I am currently doing:

1. Graphing my internal Nest temperature reading using PRTG


2. Capturing and emailing me when Nest thinks I'm "away" and when i'm back.

3. Monitoring the internal battery voltage of the thermostat - could potentially be used to notify me of a power cut whilst away from home (for example, if the voltage drops below a certain level).

Gathering and using all this data first relies on capturing it with the improvised Nest API.

Here's what you'll need to do:

1. Visit the link above and download the nest.class.php file
2. Publish the above on a web server that supports PHP, and has Internet access
3. Create another PHP file that "includes" the above class and gathers and presents the data you want.  There are examples on GitHub, and I've included my own hacked together example here:


 <?php  
 header('Content-Type: text/xml');  
 require_once('nest.class.php');  
 // Your Nest username and password.  
 $username = 'your@nest.email.address';  
 $password = 'YourNestPassword';  
 // The timezone you're in  
 // See http://php.net/manual/en/timezones.php for the possible values.  
 date_default_timezone_set('Europe/London');  
 $nest = new Nest($username, $password);  
 // Get the device information:  
 $infos = $nest->getDeviceInfo();  
 // Start XML Output  
 echo "<nest>";  
 // Print the current temperature  
 printf("<nesttemp> %.01f </nesttemp> \n", $infos->current_state->temperature, $infos->scale);  
 // Print the current humidity  
 printf("<nesthumidity> %.01f </nesthumidity> \n", $infos->current_state->humidity, $infos->scale);  
 //Print Auto Away 0 or 1  
 printf("<autoaway>%.0f</autoaway>", $infos->current_state->auto_away);  
 //Print Manual Away 0 or 1  
 printf("<manualaway>%.0f</manualaway>", $infos->current_state->manual_away);  
 //Print Battery Level  
 printf("<battery>%.02f</battery>", $infos->current_state->battery_level);  
 //Close XML  
 echo "</nest>";  
 ?>  

When you GET this php file, it shows XML output like this:

 <nest>  
 <nesttemp>24.6</nesttemp>  
 <nesthumidity>39.0</nesthumidity>  
 <autoaway>0</autoaway>  
 <manualaway>0</manualaway>  
 <battery>3.94</battery>  
 </nest>  

4. Now using something like PRTG (free for a licence of 10 sensors) and the HTTP XML Sensor type, you can GET your PHP script every few minutes (I wouldn't recommend more than once every 5 minutes), and have PRTG automatically interpret the XML into sensor values.  All you need to do is tell PRTG the full web address of your php file and also which XML tags you want to capture.  The sensors it produces will look like the ones shown below:



5.  Lastly, once you have the data captured, graphed etc, you can set-up a notification within PRTG to send an email when a certain value is seen on a sensor.  In our case, to email us when the Auto Away sensor = 1


I've found that setting a single threshold trigger when the value = 1 and then another notification when the condition clears seems to work best - rather than 2 separate threshold triggers for 1 and 0.

There are numerous other things you could do with this depending on what you want to monitor and the Nest API allows you to SET certain parameters as well as GET them.



Tuesday 20 May 2014

5 things I wish IFTTT.com would support

Having been less than complimentary about blog posts starting with "X things...." I now produce a blog post with exactly that title.

If you haven't heard or used IFTTT yet, you need to learn about it.  It's not an understatement to say that this service, or others like it, could become the backbone of machine-machine (software to software) automation.  For a home automation geek like myself, it opens lots of opportunities.  I'm already starting to use it for processing emails and alerting from my IP garage door project.

However, there are a few things I would love to see IFTTT include on their roadmap....


  1. AND functionality.  For example, I want to combine 2 triggers, so that if both of them are true at the same time, then the action is taken. Example: If you receive an SMS from The Boss AND it's after 6pm THEN reply with "I'll deal with this in the morning"
  2. Add an HTTP POST channel.  This would allow IFTTT to send an HTTP POST request to a web site/script of your choice based on a trigger.  The script (written in PHP for example) could perform, well, anything!  There is a work-around however.  For me, a great use of this would be to auto-generate a credit voucher for CheekySMS when I receive a specific SMS that tells me someone paid for credit.
  3. Introduce a Nest channel :) - I know Nest (Thermostats and Smoke Alarms) are already building an API, so wouldn't it be great if we could get things to happen based on temperature or potential dangerous events in our homes.  WeMo and Philips Hue are already supported so full home automation with IFTTT doesn't look too far away.  X10 aside, a standard home automation protocol has long alluded us, but with a service like this, it becomes less of a problem.  Device manufactures such as Nest, and Philips can focus on delivering great hardware (and APIs) and let services like IFTTT provide the middleware to translate between them all.
  4. Introduce a SIP voice channel - Alerting by SMS or email on your smartphone is all very well, but call me old fashioned, what really gets my attention is when the phone rings!  Just an automated, text to speech service would do!
  5. Introduce a text search capability - By this I mean, provide a specific web page URL to IFTTT and trigger on a content change or a specific item of text within that web page.  Great for alerting based on a price change on your favourite online store, or maybe getting an alert when tickets to a popular concert get released.


If you're using IFTTT already, share your stories, or let me know how you could make use of these ideas.


Monday 19 May 2014

My DIY Garage Door IP Control

It wasn't until I was 100 miles from home that I remembered I'd left the door to my new garage wide open!  There was nothing I could do about it until I got home again 8 hours later, so it got me thinking about a way of controlling it remotely.  I already have a wireless key-fob, but I wanted something with a bit more range and so my search for an IP enabled garage door began.  There are some ready-made solutions by the big manufacturers but they are expensive and somewhat restrictive.

The first step was to see what I could do with the Garador Garamatic 7 electric "motor" I already used (in combination with the key-fob).  Luckily, like all Garador electrically operated doors, it's possible to add an external impulse button to start/stop the door travel cycles.  Effectively this is just an electrical short across 2 connections inside the control unit and is usually used for a push button start/stop or a manual key switch.  See figures 10/11 in the Garador manual.

Next I found an Ethernet connected relay that included an SNMP and HTTP interface, a really nice piece of kit with a thousand uses!  There are a number of these on the market, but this one came from a UK based distributor and most importantly had the HTTP interface/API that I planned to use to pass commands from my smart phone.  Additionally it also had digital inputs on board.  Although this wasn't essential, I figured that being able to sense when the garage door was closed was also quite important - I could have used a webcam I suppose - I might still do!



Lastly, the Ethernet connection to the garage was accomplished (in the short term at least) using a pair of TP-Link powerline adapters.  To my surprise, these worked across multiple RCD units.

The connection to the door motor control unit was made using 2-core cable, into the "Normally Open" and "Common" connections on the Ethernet relay.  In order to start the travel cycle of the door, the relay only needed to close for a second, so the pulse feature of this relay was ideal for this.  For each pulse of the relay, the door will open, stop, close, stop etc but it will also stop automatically when the door reaches the end of it's travel as normal.  During testing, I was using the web interface built into the relay.


Next was the sensor to detect the state of the door.  With the relay having the ability to take digital inputs, I decided to buy a cheap reed switch usually used with household burglar alarms.  The switch was placed in a static location at the top of the door frame, while the magnet - stuck to the door - would travel as the door opened and closed.  It took some trial and error to make sure they were positioned correctly, especially as the working space was very limited when the door was closed.  The wires from the switch could be hidden nicely along the door track with the help of some cable ties.



The reed switch wires came back to the digital input 1 and ground connections on the relay so that when the door was closed, the digital input was high.

That all worked nicely, but I was still controlling and monitoring it all from the web interface on my laptop.  What I really wanted was a quick Android App!  There is a generic app to control the relay available on the Play Store but I wanted something a bit more customised...

I've been using App Inventor since it's early days, and it is more than powerful enough
to code a quick UI with HTTP GET calls to the URL which controls the pulse command on the relay and the URL to get an XML status of the relay.  The XML status contains the status of all elements of the relay, many of which I wasn't using, so I had to parse the output to capture the Digital Input element I was interested in.   I also added a quick "pin pad" login in case my phone ever gets "borrowed".  It's very simple, ugly, but perfectly functional!

There are a number of improvements I will make over time, including tidying up the Ethernet and power connections to the relay.  I could also perhaps add a second reed switch to tell me that the door is fully open.  Therefore if neither digital input is reading closed, I know the garage door must be stuck half open.  However, generally I'm really pleased with the result, never again will I be caught out, miles from home wondering if I shut the garage door behind me!

UPDATE: I've now added a 1-Wire DS18B20 Temperature Sensor which I purchased on ebay, to the relay via it's dedicated 1-wire input pins.  It really was plug and play, and now I can also read the temperature in the garage.  You will need this DS18B20 pinout....





Tuesday 13 May 2014

A call out of the blue

A few weeks ago, I had a call on my mobile which showed a local number.  I didn't know the number but answered anyway to hear the voice of an elderly sounding gentleman asking for me by name.  My suspicions are always aroused because this is how most sales calls start, but not this one.  He had my number because I had given it to him on a scrappy piece of paper at the roadside a couple of months previously after I witnessed him and his wife in a car accident.  Having been involved in an accident myself where I was not to blame, I wish someone had stopped for me and offered their independent view point.  Had there been witnesses to my accident,  I would not have had the hassle and the expense of fixing someone elses mistake.

So after we'd established who he was, I discovered he was simply calling me to say "thank you".  His insurance claim had since been finalised and he told me he'd given up driving.  He said it wasn't because of the accident, but I suspect it was certainly a factor.  It got me thinking about how the actions of random people can have such an impact on our lives.  Sometimes we notice it, but I am sure there are many times when small random actions by strangers go on to change the course of our lives without us even noticing it happening, or having a chance to "thank" them.

Monday 12 May 2014

10 things most annoying about lists of 10 things


1. Lists of 10 things that contain more adverts than content.

2. Lists of 10 things that take you to websites that you probably shouldn't be visiting on a work computer.

3. Lists on websites that contain more lists that look like they could be interesting - see point 1.

4. Lists of 10 things that suck you with enticing offers of things you want to read and then utterly disappoint you with irrelevant content.

5. People who think you can achieve inner peace/work with a difficult boss/save your marriage by reading a list of 10 things.

6. Getting to the end of lists of 10 things without finding one you like.

7. People who post lists of 10 things on Facebook.

8. The fact that lists of 10 things seems to be the new way to blog about anything.

9. Lists of 9 things, when you were promised 10.

Tuesday 11 March 2014

Discussing broadband over the garden fence

A recent article in the online Telegraph about seeking better broadband speed, had me shaking my head. The news often does this, not because the subject makes me sad but because of the inane, dumbed down way it is presented.  In this case, it's the advice given that gets me typing.

Read the article if you like but I have paraphrased it here for you:
Question: Does broadband speed on the same exchange, vary between ISPs?
Answer: Yes, ask your neighbours for their recommendations.

All other things (internal wiring) being equal, I agree that the maximum (sync) speed you will achieve is going to be roughly similar to that of your neighbours, but ask your average neighbour for their opinion of their own Internet Service Provider and you will probably get such a biased, subjective view, it's almost not worth boiling the kettle.  It certainly is not advice I would be offering in a national newspaper column.

So if speed is not the end game, what else should you be looking for in an ISP?  For me, the biggest factor is consistency and quality, things that are much harder to measure and therefore advertise.  So if you do find an ISP that manages to measure and publish these things, surely they are worth a look.

I don't work for Andrews & Arnold (although they seem like a company I would like to work for) but I have recently become a customer of theirs, based purely on the fact that they provide measurable quality of my connection.  They have nothing to hide behind, and no basis for excuses when something isn't quite right.  Rarely have I found any service provider (Internet or otherwise) where I am confident that they are aware of something not being "quite right", before I am.  I hesitate to say "problem" because a problem occurs after something has gone wrong.  Measuring quality is about trying to prevent problems occurring in the first place, or catching them early and having the data to evidence it.

I too measure some aspects of my connection.  It may be basic, but the graph below proves to me that the consistency of throughput has improved considerably since my swap.

See if you can spot where I changed ISP!
More subtly shown here, but of arguably higher importance, is the reduction in packet loss too.
Even when averaged over 1 day, a packet loss reduction is clearly visible.  So clear that I circled it in blue!

So why isn't everyone using A&A?  It seems the vast majority do not have sufficient technical interest to care about how their ISP works or that it works well.  It's also because we have been conditioned (often by BT themselves) to expect something for nothing - £5 per month for 6 months is their current offer - but broadband is not a commodity like gas and electricity, it is just as important to many people, but the product you get out of the pipe is not the same quality and therefore not the same price - If you want broadband advice, and you don't live next door to me, read the educated, industry press!