Sending smartphone notifications from Ubiquiti EdgeRouter Lite

Following on from my success of getting my Edge Router Lite to successfully run multiple load-balancing schemes for dual-WAN, and more importantly, assign different devices to different load balancing schemes, the next natural evolution was to send iPhone alerts when any of the links went down.

In principle it is quite easy, because the ERL already makes provision to run an arbitrary script when a link transitions (from active to inactive and vice versa). So, it's really just a question of having the right script. 

If you Google, you'll find examples for sending email, but I wanted something more immediate (and less configuration effort - i.e. to not have to set up sendmail).  Based on another example I considered using the service, but wondered if I could use IFTTT to do the same, as I am already a user. (Saves me signing up to something new). 

Turns out you can, by using their "webhooks" service; and turns out it's so simple, it's almost untrue. 

IFTTT Webhooks allows you to generate simple triggers from a single web request

IFTTT Webhooks allows you to generate simple triggers from a single web request

Step 1

First go to your IFTTT account and add the "webhooks" service. This will generate a unique key for you, which you need to make a note of. Annoyingly this is done in a font which does not distinguish between capital I and lowercase l, but you can regenerate the key, or paste into something where you can change the font. 


Step 2

Next, log in to your Edge Router and navigate to /config/scripts and create the following script (I called mine failover-notify) :

A script to generate IFTTT phone notifications. Obviously use your own key.

A script to generate IFTTT phone notifications. Obviously use your own key.

Don't forget to make the script executable with the command chmod +x failover-notify

Step 3

Return to IFTTT and create an applet which uses the webhooks service as a trigger and the notifications service as the action:

Note how I have called the event "bb_failover". It is crucial this matches the name in your script (it comes in the URL after /trigger/ ). It is this name that allows you to configure many different triggers on IFTTT to do different things. Obviously you could use a different name, providing it matches in both places. 

Value1 will be populated with the Load-Balance group name; Value2 will be the Port (eth0, eth1 etc.) and Value3 will be the status (either active or inactive). 

Also, you will need the IFTTT app installed on your iPhone, to generate the notifications at the device end. (The app doesn't have to be running though).

Step 4

Return to the edge router for the final bit of configuration.  You might want to test your script at this stage. If you type ./failover-notify A B C the script should run and give a success message, and shortly after you should get a notification on your phone. There's not much point proceeding until you can get this to work.

Once it does work, you can come out of the command line and go to the config tree. Here you choose the load-balance group you want the script to apply to.

Now, if you only have one group configured, you will apply it to that group. If, like me, you have more than one group, you might want to only apply it to one of the group to prevent duplicate alerts. This will depend on what your groups do and what alerts you want to get.  

In my case, for example, both my load-balance group balance across both my only WAN links, so in fact I only need to apply it to one load-balance group, as both WAN links will be covered, and it doesn't matter which group I choose. I wouldn't apply it to both groups, as then I'd get double notifications - i.e. one from each. 

Choose the Config-Tree tab and navigate to the load-balance group you want to monitor

Choose the Config-Tree tab and navigate to the load-balance group you want to monitor

After deciding which group(s) to receive notifications from, navigate to it, and put the full path to the script in the transition-script box, then click preview and save. 

And that's it. Test it by disconnecting one of your WAN links, and see what happens!

Configure Ubiquiti Edge Router Lite with Preferential Load Balancing for different devices via dual link WAN

Snappy title, huh?

Introduction and Purpose

In this article I give the steps to configure an Edge Router Lite so that it can apply different load balancing rules to different devices on your home/local network. There might be a few use cases for this type of configuration, but here's mine:

I live in a rural area with slow ADSL broadband (around 2Mbps) and no imminent prospect of fibre. I am also a home worker, and that speed is practically unworkable. Thankfully in December 2016, Vodafone expanded 4G coverage, such that I can now receive it via an aerial on my house. So, at the time of writing, I have a 50Gb per month data plan on 4G, and can get speeds of around 40Mbps.  I need both links, because not only is their variability in the services, due to things like weather, but 50Gb is simply not enough. So, I need to split my traffic over the networks so that my work activity gets priority on the high speed link, and other stuff (such as music streaming) favour the slower - but uncapped - ADSL link. 

Using the edge router, this configuration does exactly that. The inspiration and configuration schema itself was provided at but without instructions. As a novice to networking, my eyes glaze over at all that config and the prospect of recreating it at the command line. So I set out to configure it via the UI (and succeeded). This article shows the steps. 


I have several media streaming devices in the house, e.g. SONOS, Amazon Echo Dot. The reality is, for playing music they do not need 4G speeds, and up until now have been unnecessarily consuming 4G data allowance on my existing load balancing set up. That set up is just one load balance group with a 75:25 split ADSL:4G, which in itself is not ideal because it favours the slow link, but is necessary to keep my 4G usage within the necessary limits.  The SONOS in particular is a culprit because it is in my child's room and plays a playlist of about 3 hours' duration each night: it really doesn't need to use 4G at all (except perhaps for fail over) - so the plan is to "pin" that device to the ADSL link.

The same goes for the Amazon Echo Dot in my office, and the Echo Dot in our living area, which is hooked up to a soundbar. 

The plan with the configuration is to have these 3 devices belong to their own load balance group, and balance that group so that it is almost 100% supplied by the ADSL link. In actual fact I am going to start off with 90-something percent, so that when the ADSL link is being heavily used (child watching iplayer for example), there is some availability of additional bandwidth from the 4G side.  Failover will be left in place so that there are no interruptions in the event of ADSL failure (or me tripping over the hub). 

Remaining devices, for now, will all belong to a different load balance group which is more equitable, allowing them a greater share of the 4G. I need to run the system for a while to establish the right level within my data cap, and indeed plan to introduce a further load balance group which tips the balance the other way; thus allowing, for example, my work PC to have a 90:10 balance 4G:ADSL. For the purposes of this article, however, all these remaining devices will stay in the default load balance group, which was created using the Edge Router wizard. 

Part 1 - Static IP's

This whole set up relies on creating a group of devices you can assign to a load balance rule, and applying that rule to the firewall prior to the default rule. In order to create the group of devices, they need to have static IP's rather than the default dynamic. That way they can always be identified.  Knowing that I plan to expand the number of devices that I might do this with, I decided to reserve a larger-than-default range of IP's for this exercise, and future use.

So, i reduced the existing dynamic IP range to stop at on the basis I would reserve - 239 for my "ADSL-pinned" devices. This can be done in the DHCP Server menu.

next step is to create the static mappings for the SONOS and Amazon Echo devices. One way to do this is from the DHCP Server -> Static MAC/IP mapping tab. 

I have set my SONOS to the first address in my "reserved" static range: xxx.231

There's also another (quicker/easier) way to create these mappings: from the Leases screen. Just find your device in the list.

Note that I didn't change the name of anything, just the IP address to something in my static range. Note too, that the existing IP leases hold good even after this change, so the devices do not take on their new IP until you reboot them, which we can do at the end. 

So, I mapped my Office Echo dot to static IP and Kitchen dot to xxx.233

The above steps complete part 1, which accomplishes this configuration step of the original solution:

Part 2 - Firewall Group

Now we need an "Address Group" with those static addresses, as per the original solution:

This can be done from the Firewall/NAT controls - I created a group called A nice

A nice feature is the ability to add a range of IP's, not just individual devices (choose "Actions -> Config"). I chose to add the whole of my range so that any device mapped into that static range in future will automatically adopt the ADSL load-balancing scheme. 

Part 3 - Load Balancing rules

The original solution requires creation of an additional load balance rule:

So, to begin with, I am going to create a load balancing group, using a 90/10 rule, called LB-ASDL-primary. This can be done from the Config Tree pane. (Navigate to the branch shown in the bold breadcrumb trail, and choose ADD)

Since I am running on fairly default configuration, this new group just needs to mimic the existing master group (G), so that means adding the right interfaces (eth0 and eth1 in my case)

Once done, we need to work down the configuration for LB-ADSL-primary, replicating what we see in "G".

Again, if like me you are running on default config, in reality most settings can be left alone, and it's just the weight that needs amending. Once, that's done, click "PREVIEW" - which is essentially a "check and save" function - at the bottom of the screen.

With this configuration, my SONOS/Echo devices are still going to use 10% of the 4G link. It will be trivial at a later date to make it 100% ADSL and 0% 4G, and set the 4G as failover-only, if desired.  That's this step done. 

Part 4 - Amend Firewall "Modify" group

Referring back to the original solution - we need to change the firewall "modify" rule to add a new "modify" rule, which will reference our new load balance group. Thus our new group of devices will get their special load-balance treatment before the remaining devices get the default treatment. 

Note that in the new rule we have to reference our new load balance group and then also the devices (address group) that are the source. As a reminder:

  • Our Firewall/Address group is called ADSL_link_devices
  • Our Load balance rule is called: LB-ADSL-primary

In the config tree (see below), the existing config built by the wizard looks like this, with rule 100 set as the load balancing rule, and the default load balancing group called "G".

We will add a new rule and reference to the group. It will be before rule 100, and use our new load balance group, and assign our new address group (i.e. target devices) to it. 

Add a rule 90, then change the "source" to reference the new address group. 

Now we need to define the actual rule. It's a "modify" rule, so navigate to the modify branch under rule 90, then reference our new load balance group in the lb-group slot. 

And Save ("Preview")

That's this step done.

Finally - Apply to Interface

A firewall rule is nothing unless it is actually applied to an interface, as per the original solution:

As you might have suspected, following this method you don't have to perform this step, because we have modified the existing rules "live" (called "balance" by default) and all our changes are already in place on the interface they originally applied to (eth2 in my case).  (shown below for completeness)


Before we change anything else or try our devices, check what is currently happening: our new group has no traffic (as we expect)

20 test 1 before.png

Now we play something on the SONOS / Amazon Echo, to see which WAN link the media comes down. Since the IP addresses of the devices have not yet changed, nothing new happens, and (happily for this test) the data comes over the 4G link (eth1): exactly what I am trying to prevent.

And another check from the command line (i did sneakily change the weightings to 91/9 in the meantime, for those with a beady eye). 

Now we reboot the devices so that they acquire their new static IP's. (Seems you can't ask Alexa just to reboot, which is a shame :) ). We can confirm that the devices (e.g. Echo) have picked up their new IP in the .23x range, which they have:

So,let's play some music again and re-examine the interfaces. Look at all that lovely red = eth0 = ADSL...  just what I wanted.


And finally, confirm the stats from the command line, we see LB-ADSL-primary load balance group is now pulling data in the right proportions:

Very happy. Case closed!

If you are a Londoner, this may make you cross [fire statistics analysis]

The tragedy at Grenfell tower ( ) has turned a lot of attention to what has been happening in the fire service. There are numerous claims of improved performance, and counter claims of "fiddling the figures". So, the question is, what does the data really look like?

FRA (Fire Rescue Authority) and FRS (Fire and Rescue Service) data is publicly available at

There are many many tables and sheets of data available, and it has been a challenge to keep this "brief".

The data above covers the whole of England, broken down by authority. The starting point is to accept the data and take it at face value, before performing analysis and drawing conclusions. Indeed, analysing the data can help to determine its integrity.

There are various caveats associated with the data as it is provided, and these need to be understood. Indeed, something that is quickly apparent, is if you don't know how to handle this data correctly, you will make mistakes and errors that will lead to incorrect conclusions. I can say this with authority, because I made a few initially! 

Simple things like changes in capitalisation of dimensions between time periods, can cause aggregation to fail. Similarly, much of the data contains totals as well as broken down data, causing the risk of double counting for those not paying attention. Finally, most of the sheets do not have raw data, but have year by year drop downs - necessitating copious amounts of copying-and-pasting to reassemble the underlying information.

What changed when?

Much public discourse has been made of the fact that accounting systems changed, particularly during the tenure of Boris Johnson as Mayor. Indeed, the accounting system did change, from a paper based one to an online one (2009/10), which ultimately has provided greater granularity and timeliness. In my opinion there is no obvious attempt to "cook the books" due to the change of this system of recording.

Further discourse has covered the classification of fatalities, with the claim that, for example, fatalities later in hospital began to be omitted from statistics. Neither the accompanying notes, nor the evidence from the data supports this hypothesis.

Indeed, the data includes non-fatalities as well as fatalities, and classifies the former into different types, which includes the nature of the hospital treatment. It is hard to envisage such a well-classified data set, collected from 10's of individual authorities purposefully being manipulated to consistently exclude one type.

Note - due to the fact that injuries can become fatalities quite some time after the initial event, data for the most recent year is not necessarily complete. Fatalities may rise in due course, while injuries decrease. For the present year at the time of writing, ending financial year April 2017, data is considered complete up to January 2017 (thus is lower overall than previous years)

So we can dispense with introduction and get to the meat of this subject, the notes from the data sheets themselves are posted at the end of this page.

Let's look at the data - England - the broad trends

The first chart is total Fatalities due to fire, in England, over the period since 1981. The chart below includes a computed trendline to best-fit the pattern.  Over the last 38 years, overall fatality has, basically, steadily fallen.

We can see that same data, now broken down by location type; and this is one of the first of several important steps in making correct sense of the data. Prior to 1999, data is only available as a whole for dwellings. But subsequent to that, it is classified by dwelling, road vehicle, other building and other outdoors.  This important, because I want to focus on dwelling fires.

Looking at fatalities naturally leads us into considering non-fatal injuries as a comparison.

Here the story is rather interesting. The first point to note, is that prior to 2009/10 and the introduction of the online reporting system, we did not have any sub-classification.   This does open the door to potential misuse of the data - e.g. to compare "severe hospital" injuries post 2009 with "all injuries" pre 2009 and claim an astonishing drop.  However, if one were to do that, the discontinuity would be so great, that it would be immediately obvious. In contrast, the properly aggregated data shows the same post-1989 falling trend in injuires as with fatalities.

Perhaps of equal interest in the above chart is the steep rising trend in injuries from 1981 - 1998.  The data itself does not give the answer to why this happened; undoubtedly numerous factors are responsible. (Amongst those reasons may be changes in fire regulations, and for those who wish to explore them, a summary can be found on wikipedia

The shape of this chart is likely to lead some readers to suspect malfeasance is afoot. However, as before, while we see a reversal in trend, we do not see a marked discontinuity; rather a turning of a worsening situation to an improving one - which is of course the intended effect of fire regulations and fire prevention policy. In truth, we should be glad to see this effect.

The natural next step is to plot fatalities and non-fatalities against each other to see any correlation. Here I have broken the data down into decades (by colour).

Looking at the 80's and 90's what we see is a trend that is most probably a result as a focus on fire fatality prevention. As fatalities decrease over those two decades (starting at the far right and working left), injuries increase. You can plot a fairly good fit trend line through the brown and blue marks, which tends to suggest that fatalities were being "turned into" injuries. I.e. the seriousness of the worst fire injuries were being reduced.  Many factors could contribute to this trend, such as improved fabrics and materials, improved building materials and building standards. (e.g. measures such as fire doors which delay the impact of fire, thus reduce risk of death but may not prevent injury from smoke).

Then we have the inflexion point at the turn of the millennium, where the previous rising injury trend is fully reversed. Now fatalities AND injuries are falling.

It's tempting to suppose this sharp turn is mysterious, but perhaps it is not as sharp as we might think: there is a cluster of 10 or so points at the turning point of this chart, representing a whole decade turning fate around.  It is not the turnaround I find most surprising, but the sharp descent as we come into the 2000's and 2010's. Here the improvement in injuries is as rapid as the worsening was pre-2000. This must surely be attributable to some significant interventions?

One that I particularly suspect is the introduction of smoke alarms. Smoke is a key cause of injury, and the availability of an early warning to escape smoke injury must likely have a dramatic effect. Indeed, smoke alarm ownership rocketed during the 1990's.

Causes of Fire

Once again, for the curious, we can look at general causes of fire, before looking specifically at dwellings. This can help us understand whether factors outside the control of the individual (such as home wiring, manufacturing standards of appliances etc.) have a role to play.   Causes of fire are shown below. I have chosen to show them as a percentage of all recorded primary fires, so that any relative rising or falling trends can be seen.

Unfortunately the data contains a large number of "other/unclassified" records, so I have replotted the chart with that line removed (data NOT recalculated).  The new plot seems to suggest cooking appliance fires on the rise, but we shall below, all is not what it seems.

If we now look at causes of fire, but this time for dwellings only (with "other" still included), well, that's different picture - this time we see a much flatter line for cooking appliances; though perhaps not surprisingly they account for 50% of dwelling fires.

Somewhere along the line I expected to see smokers' materials drop too (especially with the advent of e-cigarettes), but that actually seems to have changed little. Electrical distribution causes have risen slightly over the period. Again, in the light of revised building standards, this seems counter-intuitive, but on the other hand, older buildings continue to age and presumably increase in fire risk from older wiring. 

What's happening in London?

The data above sets the broad context for the events that triggered this article. The analysis above has not found any obvious discrepancies in the data. That is not to say that data, or portions of it, could be used and quoted out of context, either deliberately or inadvertently. But that is left for the reader to judge for themselves.

One of the key thrusts of discourse surrounding London fire and rescue services has been the budget cuts imposed. The headline budgets, of course, go towards vehicles, premises, equipment, training, staff etc. We have data for staff for Greater London - which speak for themselves.

Stepping back, you can't argue that while there have been cuts to fire service staffing since 2010, fire fatalities and injuries have continued to fall, suggesting that the cuts themselves have had no impact.  This is probably an unwise conclusion, for various reasons:

  1. The fall in fatalities and injuries, as we saw earlier, is part of long term, nationwide trend stretching back at least 36 years. Other factors, which improve fire safety, are clearly at work here; and cuts to budget may simply be serendipitously "riding on the back" of the general trend.  Removing "slack" in the service has a certain logic to it, but cutting too deep can only have negative consequences in due course. 
  2. The fire service does not just provide reactive response but also proactive preventative measures, such as education and fire-checks. Unlike "fire response", proactive measures have a longer term, delayed impact and the effects may not be seen until several years down the line.
  3. The fire service is essentially an insurance policy. It needs to be there when you need it, otherwise it is not effective insurance. By definition this implies it must also be resourced at times when it turns out not to be needed.

The data shows that both reactive and proactive functions have suffered during the time period of budget cuts. The chart below shows response times in minutes (x axis) vs. number of incidents in a given year. Broadly, incidents have been falling, so higher incidents (y axis) are earlier in time.  

When you look at the cluster around 6.5 minutes, all of which occurs from 2010 onwards, you can't help but think someone made a conscious decision that 6.5 minutes was the target response time. Sadly, the data is not available to look at the actual distribution. 

The conclusion here is stark, response times have increased from 4.5 - 4.7 minutes to 6.5 - 6.7 minutes DESPITE the number of incidents decreasing.  This suggests that cuts have not simply been to remove "slack", but have been much deeper, to the tune of 40% or more worsening of average response times.

Proactive measures

Interestingly, there are reports of 25% reduction in fire inspections as a result of budget cuts ( ).

However, the number of inspections itself does not tell the whole story, because the quality of those inspections may also matter. The available data actually reports number of inspections (not broken down by type, sadly) and also number of hours performing inspections. These are plotted together below.

So, here’s a classic kind of chart which lets you tell whichever story suits your purpose: over the period 2010 - 2016, fire inspections have actually increased on aggregate. If you are a politician, that would be a good number to quote.

But the number of hours spent performing them has radically fallen, by 56% on the 2010 level, and 58% on the 2013 level.    This means a 2016 inspection was being performed in well under half the time It was 5 years previously. One might question whether quality suffers as a result, or if something else has transformed the nature of inspections.

For me, personally, this is the most telling, and I hazard-to-say, shocking insight.  The door is open, potentially, for some form of technological solution to have slashed the time taken to perform inspections, but there has been no other evidence forthcoming to support this position as yet.

Regrettably it leaves my analysis somewhat inconclusive, and we sit and wait for promised enquiry to reveal a deeper set of facts about the events and context surrounding Grenfell tower. We can only hope that we do get those facts.

The statistics in this table are Official Statistics.                                                                    Source: Home Office Operational Statistics Data Collection, figures supplied by fire and rescue authorities.


Next Update: Autumn 2017

The full set of fire statistics releases, tables and guidance can be found on our landing page, here-                                                                                                                                                                        


Financial Years                                                                                        

2015/16 refers to the financial year, from 1st April 2015 to 31 March 2016. Other years follow the same pattern.                                                                                        

Note on 2009/10:                                                                        

Before 1 April 2009 fire incident statistics were based on the FDR1 paper form. This approach means the statistics for before this date can be less robust, especially for non-fire incidents which were based on a sample of returns. Since this date the statistics are based on an online collection tool, the Incident Recording System (IRS).                        

General note:                                                                        

Fire data are collected by the IRS which collects information on all incidents attended by fire services. For a variety of reasons some records take longer than others for fire services to upload to the IRS and therefore incident totals are constantly being increased (by relatively small numbers). This is why the differing dates that data are received by is noted above.        

Note on Imputed figures

During 2009/10, Greater Manchester and Hertfordshire Fire and Rescue Services were unable to fully supply their casualty data. As such totals for these Fire and Rescue Services were imputed. For these imputed records detailed breakdowns are not available. As such, some detailed breakdowns may not sum to their corresponding totals.                                                   

The England total hours figures above for "Number of Fire Risk Checks carried out by FRS" include imputed figures to ensure a robust national figure. These imputed figures are-                                                                                        

2015-16: Staffordshire                                                                                        

2014-15: Staffordshire, Surrey                                                                                        

2013-14: Cleveland, Staffordshire, Surrey                                                                        

2012-13: Cleveland, Staffordshire, Surrey                                                                        

2011-12: Cleveland, Lincolnshire                                                                

2011-12: Bedfordshire, Cleveland, Greater London                                                                                        

Figures for "Fire Risk Checks carried out by Elderly (65+)", "Fire Risk Checks carried out by Disabled" and "Number of Fire Risk Checks carried out by Partners" do not include imputed figures because a large number of fire authorities are unable to supply these figures.                                                                                       

1 Some fires are excluded when calculating average response times. Please see definition document for a more detailed explanation.                                                                         

2 Primary fires are those where one or more of the following apply: i) all fires in buildings outdoor structures and vehicles that are not derelict, ii) any fires involving casualties or rescues, iii) any fire attended by five or more appliances                                                                

3 The largest components of 'other buildings fires' are incidents in private garden sheds, retail and food/drink buildings

4 Typically outdoor fires that are ‘primary’ because of a casualty or casualties, or attendance by five or more appliances5 Typically outdoor fires not involving property                                                                        


1 Primary fires are defined as fires that meet at least one of the following conditions:                                                                                

(a) any fire that occurred in a (non-derelict) building, vehicle or outdoor structure,                                                                                

(b) any fire involving fatalities, casualties or rescues,                                                                                

(c) any fire attended by five or more pumping appliances.                                                                                 

2 Includes fatalities marked as "fire-related" but excludes fatalities marked as "not fire-related". Those where the role of fire in the fatality was "not known" are included in "fire-related". Fire-related deaths are those that would not have otherwise occurred had there not been a fire. i.e. ‘no fire = no death’.                                                                                

3 Dwellings includes HMOs, Self contained Sheltered Housing, Caravans/mobile homes, Houseboats, Stately Homes and Castles (not open to the public).                                                                                

4 If more than one smoke alarm was recorded for a fire, the fire is categorised under the most positive operation status of all the smoke alarms recorded.                                                                                

The data in this table are consistent with records that reached the IRS by 4th January 2017.                                                                                 

1 Accidental is defined as when the motive for the fire was recorded as either Accidental or Not known. As such this excludes deliberate fires.                                                                                                        

2 Other breathing difficulties includes: Choking and Other breathing difficulties.                                                                                                        

3 Physical injuries includes: Back/neck injury (spinal), Bruising, Chest/abdominal injury, Concussion, Cuts/lacerations, Fracture, Head injury, Impalement and Other physical injuries.                                                                                                        

4 Other includes: Collapse, Drowning, Heat exhaustion, Hypothermia, Other and Unconscious.                                                                                                                                                                                

Should have been labelled...

The aftermath of the recent IT fiasco at British Airways reminds me of a funny story which should be filed under the "should have labelled it" category.

In my early 20's I took a trip to Edinburgh and stayed in a cheap guesthouse. I also took my "games console" (a Philips CDi, if anyone remembers those!).

The room was a bit sparse on sockets, especially near the TV, but there was one with a 12 volt adaptor already in it... I looked to see where is was going and what it was powering, but it didn't seem to be anything in the room. So, i turned it off, and nothing seemed to change, so I unplugged it, plugged in my CDi, fired up the TV and thought nothing more of it.

Next morning, I was rudely awakened by a knock on the door and a TV engineer asking if my TV was working. I'd played my video games with no problem, so "yes" was the answer. There was some confusion, as every other guest in the guesthouse had reported their TV not working.

It transpires they meant there was no signal - and the TV company had been out since dawn clambering all over the roof to trace the fault, starting from the aerial backwards.

Well, you know where this is heading.

It turns out that adaptor powered the TV booster box in some cupboard somewhere - so I had killed everyone's terrestrial signal by unplugging it. 

The proprietor was fuming and wanted to charge me the whole call out fee. Despite being a nervous 20-something-year-old, I refused. He said we were not entitled to use the electricity in the room. I said there was a TV, kettle in the room, so he was talking nonsense. And if he had critical infrastructure powered from a guest room, it should be labelled.

(In the end I gave him everything I had in my wallet as a gesture of goodwill, which was about 28 quid; I think the call out fee was 60 something)

So - a 10p label would have saved a £60 cost to the business...

BA, take note.... 

How to set up iMessage sharing across multiple devices (especially after 2 factor authentication)

I recently set up 2-factor authentication on my apple account to provide stronger protection of my account. 

Around about the same time I noticed that iMessages and calls were not being shared across my multiple apple devices as they had been. I went into settings -> icloud -> <your apple id> -> where there are settings for:

  • contact information
  • password & security
  • devices
  • payment

I made sure that in "devices" all my devices were showing up (they are listed automatically if signed in against your apple id) - which they were

In password and security I made sure that both my mobile phones were "trusted phone numbers"

I figured that should now do the trick.. 

It didn't

After googling a bit, turns out you also have to go into settings -> messages -> Send & Receive and in there make sure that all your devices and email addresses are listed. You can also define which number/email messages appear to come from when you compose them; which means each device can initiate from its own number, or if you like, they can all initiate from the same ID. 

After I'd done that it all worked :) 

by the way, you can also go into facetime settings and do the same.. 

Maybe this is why some kids can read long complicated words and trip up on short easy ones

A study of word confusability and similarity for whole-word readers

This article doesn't claim to be a valid scientific study, none-the-less it was interesting to do, and, essentially, perform as a thought experiment. 

One of the things I have noticed with my own son and lots of comments from other parents of early readers, gifted and potentially hyperlexic children, is that such children astonishingly read (recognise) long complex words (such as "galaxy" and "knowledge") with ease, yet sometimes (perhaps even often) get tripped up on short "simple" words, such as "one" and "many". The question is, what is the explanation for this, as it seems to defy logic?

I happen to have a background in the field of speech recognition (in computers) and there are factors of that field which boil down to the problem of recognising and distinguishing words from each other. So, I was eventually moved to perform some kind of analysis investigating this. I don't know if this is original or even valid research, but it was fun to do. 

How do early readers, read?

The first thing to be aware of is two broad types of reading (and reading-teaching) methods: phonics and "whole word" (or whole language). Phonics concerns the systematic pronunciation of the component sounds of a word to reach the whole. Whole-word does what is says on the tin: the reader either memorises or deduces the whole word in one step. (As adults we tend to read like this). 

My anecdotal conversations suggest that early readers are one or the other: some early readers display/develop/self-teach a phonic approach, and the remainder, it's the whole world. (In the case of my own son, it's "whole word"). In my anecdotal evidence, the most startling early readers are "whole word" because even at age 3 or 4, obscure words of 8, 10, 12 or more letters can be decoded instantly. 

Since whole-word readers essentially memorise and recognise entire words, it begs the question: given that they handle complex words with ease, why do they sometimes get tripped up on short words?

It's possible to come up with lots of theories involving visual processing disorders, dyslexic conditions, motivation (laziness) and so on. However, I theorised about a more empirical factor: if children appear to recognise short words less-well, is it simply because short words are less memorable/more confusable?  

(Confusability, in various forms, is a factor we have to deal with on a regular basis in speech recognition, which prompted my thinking.) 

Mr. Levenshtein, meet Dr. Fry.

Before we get to the analysis, I need to introduce two things. The first is the Fry Sight Word list. I don't seem to be able to find out much about Dr. Fry directly on the internet, but many educational websites cite the fact he created a list of the most popular and common English words in literature, originally in the 50's but since updated. 

If these are the most common words that a child is going to see, then it seemed to make sense to evaluate what levels of "confusability" exists among them. 

Top 50 Fry Sight words

Top 50 Fry Sight words

Next we meet Mr. Levenshtein; or at least his algorithm, which provides a way to calculate the number of single character edits to transform one word into another. To put that another way, it gives a measure of word similarity - small Levenshtein distances between words means they are more textually similar than those with large distances.  

We should note that Levenshtein distance only tells us about textual character difference (structure), which is certainly useful when computers are comparing words. It doesn't necessarily tell us how similar words are through the eyes of a child (e.g. geometry), but it's a good starting point. 


Analysis Summary

Analysis Summary

To perform the analysis, I took a set of "sample words"  and calculated the Levenshtein distance against between each of those words and every word in the "Fry Sight List".
I compared the sample words against the full Fry list (1000 words) and also against the top 150, and plotted the distribution of Levenshtein distances obtained. 

What this effectively tells us is "how similar is the target word to the most common words in the language". We might postulate that the more similar a word is to others, the more likely it could be confused - i.e. the less likely to stand out as unique. Or conversely, a greater cognitive load required to uniquely recognise it.

I plotted the results for "one" "many" "who" (all identified as "trip up" words), plus "galaxy" and "knowledge" (indentfied as easily-recalled words). 

To interpret the chart, the height of each bar tells you by what amount the target word differed from how much of the Fry's list. So, for example, a 50% at marker 3 means the word differed by 3 single-character transformations against 50% of the Fry list. 

Compared against 1000 top words, we see that "one" "many" and "who" are clustered around the 3,4 and 5 mark for Levenshtein distance. Indeed, this level of "similarity" captures up to 80% of the top 1000 words. In contrast, "galaxy" is typically different by around 6 - 7 letters, and "knowledge" even more different around 8 - 9 mark.

The effect is even more pronounced when comparing the sample words against the top 150 Fry words. (Again, many websites reference the claim that just 100 words make up almost half of all written material).  Indeed it's likely a child doesn't compare the word they are reading against their whole vocabulary, but will prune their recognition against a vocabulary that's filtered down to a smaller, similar set. Or to put it another way, they will most consciously compare a four letter words against the 3, 4 and 5 letter words in their vocabulary, and not the 8, 9, 10 letter words, which will be discarded subconsciously. 

In this case the profile of the sample words is more pronounced - the short words compare against the top 150 mainly in the 2,3,4 range (anything in 1 and 2 is certainly highly confusable). And the long, complex words now stand out as being significantly different - and thus, we presume easier to recognise uniquely within the given vocabulary.


There are of course weaknesses to this analysis:

1) it doesn't consider word geometry or font, which may make some words look more similar than others irrespective of Levenshtein distance, which considers the text only

2) The Fry Sight list is really only a arbitrary representation of the vocabulary an early reader might know. To some extent, by definition, this list is insufficient, because the words that early readers surprise their parents, carers and observers by knowing, are the long irregular words.

3) It would be useful to perform the analysis against a bigger vocabulary but of words the same length as the sample word - this might better match the process a child follows when recognising the word (pruning out the obviously non-similar words)

Notwithstanding, the comparison of sample words against the Fry Sight Word list shows statistically significant disparity in similarity between the shorter words than the longer words. At 1000 words long, the Fry Sight list offers statistical significance to the comparison.  

The result is not really surprising. As we might expect, there are more short words in the vocabulary, therefore more possibility of similarity and confusion. 



A Scientific Study of the distribution of Halloween Monkey Nuts within their shells

Some things are too important not to research. This year I saw numerous pictures in my Facebook feed of Halloween hauls (unanimously sweets) organised by type. That got me thinking, because I'd bought a whole bag of 'monkey nuts' to hand out on Halloween-  that we never used. Seems like they've gone out of fashion since I was a kid. 

I decided to go one better and measure the distribution of nuts within their shells. Typically a shell has one or two nuts, occasionally a prize of even more! The chart shows my results.  

Distribution frequency of monkey nuts within their shells.  

Distribution frequency of monkey nuts within their shells.  

At this time I have no way of knowing if this distribution applies to nuts growing in the wild or whether different supermarkets specify their own particular 'mix' :)  Perhaps that's for next year :) 

Make of it what you will.  

Controlling room temperature with Netatmo "occupancy detection" and IFTTT

Thanks to the addition of Heatmiser range to the online automation service IF (formerly IFTTT - "if this then that") it's now possible to control room temperature using inputs from your other IFTTT-friendly IOT devices. In my case, Netatmo weather station. 

In my house, heating for every room is individually controlled by a Heatmiser Neo thermostat, each running an individualised programme of temperature gradients throughout the day, tailored to each room. During the summer most of these are just on standby, meaning in practice unless the room drops below 12 degrees C, the heating will never come on.  

My child's room is the exception, because we don't want him to ever get too cold, and some days he naps in the afternoon; so his thermostat is always active. So far so good. Except when you open the windows, perhaps for fresh air during the day, and it turns cloudy, the temperature drops and the heating comes on and heats the great outdoors. 

Finally, I have a solution which does not involve adding sensors to the Windows.  

The first step is to use Netatmo indoor station as an occupancy detector. Over the last year I've charted the correlation between occupancy and CO2 levels and in general found that an occupied room tends to read >500ppm CO2 and unoccupied room is below that. Of course if you open the window the CO2 level drops to almost zero very rapidly. So, this basic threshold measure can be used as a simple detection of empty room and/or wIndows open.  

IFTTT recipes to control Heatmiser thermostats based on occupancy (CO2) 

IFTTT recipes to control Heatmiser thermostats based on occupancy (CO2) 


Of course, you might ask what happens if the windows are open while the room is occupied. Good question - but in our case it never happens; our child is young, so for safety when he is using the room we always have the widows locked shut. 

This simple trigger forms the basis of the input to an IFTTT recipe which controls the Heatmiser thermostat in the same room. If the CO2 levels drop (room empty or Windows open) then the thermostat is set to 'standby' (this stops it following its daily program) and if CO2 rises again ( = occupied) the standby mode is deactivated and the normal program continues to run. 

This way we hope to avoid those costly mistakes where we have opened the windows and forgotten to adjust the thermostat; or unnecessarily heated an unoccupied room.  

For the future we can explore whether outdoor temperature, wind speed and rainfall can be used to optimise performance of the indoor heating.   

Make your own wake-up clock lamp with lifx

One of the first things I did with the lifx lamp in my bedroom was create a 'wake up lamp'. You know - a lamp that increases in brightness in the morning to help you wake gently.  

It was fine. Then one morning I had a flash of inspiration. 'Wouldn't it be great if it was also a clock?' 

it occurred to me, that since the lamp can change colour as well as brightness, the colour could be used to indicate the time, while the brightness helps to wake me up. And so the lifx wake up clock was born.  

Below is a screenshot of the scenes I have used to create this. My wake up period is divided into 15 minute Windows and each window is brighter than the last and a different colour and uses a slow ramp to smooth the change. The numbers in the theme titles indicate the target intensity, just for easy identification.  

A set of lifx scheduled to create a wake-up clock/lamp

A set of lifx scheduled to create a wake-up clock/lamp

My choice of colours follows more-or-less the rainbow, so that I can remember it in a hazy stupor. Of course, you could do anything. The idea being, then, that as I drift awake, the colour of the light tells me which 15 minute time window we are in. 

Simples. Now just waiting for the dark winter mornings to really test it out.  


More Sugru projects

I use Sugru around the home and car a lot, both indoors and outdoors.  

So here's a few more simple improvements made around the house. 

First up, the classic charging cable strengthening (iPad 2) - no mystery here. 

With a 2 year old about, the iPad cable needs a bit of strengthening  

With a 2 year old about, the iPad cable needs a bit of strengthening  

Next up, finger grips for a small remote control to help stop it sliding out of the hand. 

Sugru finger grips  

Sugru finger grips  

Finally, the ultimate tool you can never find: a pointy sticky sharpish thing to perform resets and extract SIM cards. This wee metal pin came as the on/off control with my solar lights - but a paper clip would do the same job.

Device reset tool

Device reset tool

Add a Sugru handle - voila!