Using NFC tags to automate my home

Imagine a home with a smart thermostat to control the heating, smart lights to control the lighting, and smart sockets to control other electrical devices. Well, for some people, that doesn’t require a lot of imagination – it’s just the way things are!

My home isn’t quite like that. We still have an analogue thermostat switch on the hall wall (one day we might upgrade) but there are various smart sockets around and we do have some smart lighting. The smart sockets control things like the heater in my Man Cave, the Christmas tree lights (mid December-January 6th only) or the fairy lights in the garden. And I wrote some posts about the smart lights, in this two part series in 2021:

NFC tags

Many of us are familiar with Near Field Communication (NFC), even if we don’t know it. It’s the technology used in contactless payment cards. To learn more, I thoroughly recommend watching Professor Hannah Fry‘s Secret Genius of Modern Life TV episode about the bank card, on BBC iPlayer.

And those smartphones we carry everywhere with us, well, if they are NFC-enabled, they can read NFC tags to perform other operations. It’s not just for making electronic payments!

All you need is to buy some tags and, as much as I try to avoid the big online marketplace that sells everything from A to Z, that’s where I picked mine up.

What follows is for iOS, as my family are all iPhone users (tested on 17.2.1). Android users can do similar things, but you’ll use a different app.

Shortcuts and automations

The iOS Shortcuts app has a section called Automation.

  1. Click + to create a new automation.
  2. Scroll down to NFC.
  3. Click Scan and scan your tag, then name it.
  4. Pick when to run the automation (immediately, or after confirmation) and whether to be notified.
  5. Select what the automation will do.

That’s it. Just touch the top of the iPhone to the tag and it will run your automation. Stick it to the desk, the wall, or wherever is handy to run the automation.

Things I discovered

In this experiment, I did find out a few things…

  • I should have bought tags with sticky pads. Or maybe not – a glue stick seems to work pretty well for attaching them to things.
  • They don’t seem to work on metal things (like my desk lamp, or the metal switch sockets in the Man Cave). I guess it interferes with the signal, so you’ll need to stick them nearby.
  • The iOS Shortcuts app will integrate with many applications, but not directly with Alexa, it seems. I have tested a couple of workarounds though:
    • Play a recording that issues the Alexa command.
    • More elegantly, use the scripting option to Open the Alexa app, wait a second, speak “Alexa”, speak the Alexa command.
  • You can also create quite advanced no-code scripts to launch menus and ask for input – for example scan the same tag and ask whether to turn on the device or turn it off, then take action accordingly.

There’s more in this thread on Twitter/X…

Conclusion

NFC tags are cheap (especially when bought in bulk) and an effective way to automate tasks around the home (or at work, in the car, or wherever). There’s lots more that you can do with NFC tags and YouTube is full of videos to provide inspiration. Have fun!

Featured image from the Computer Science Wiki, used under a Creative Commons Attribution-NonCommercial-ShareAlike licence.

Smart lighting: Part 2 (adding Innr and IKEA Trådfri bulbs to my Philips Hue installation)

This content is 3 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

My blog posts are like buses. You wait years for one to come along, and then two arrive at once. The only problem is that they are four years late.

In part 1 of this series, I wrote about getting started with Zigbee lighting, in the form of Philips Hue. Unfortunately, although it’s widely supported, Hue can be expensive so I quickly started to add compatible devices to my network. Here’s what I found.

Coloured bulbs

Whilst I use white lights in communal areas, I have some coloured lamps in some of the bedrooms and in the home offices. I also have one on the landing outside my office, which can be linked to my Teams presence information to show if I’m busy, using Isaac Levin (@isaacrlevin)’s PresenceLight solution).

Rather than shelling out £50 for a coloured Philips Hue bulb, I used Innr smart bulbs (both B22 and GU10 formats). These are also Zigbee-based but are not Apple HomeKit certified. That means that they work with the Hue app, but not natively in iOS. I decided that I can live without that (even more so since I switched to Android).

Innr supports connecting its smart bulbs to a Philips Hue bridge (but not for Hue Sync).

Low cost GU10s

I mentioned in my first post that I have some low-voltage MR16 bulbs in the house, for which I can’t find Zigbee replacements. Newer parts of the house (like the loft extension) have mains voltage GU10 fittings. For these, I used inexpensive IKEA Trådfri bulbs.

At the time, getting Trådfri working with Hue was a bit hit and miss but newer firmware seemed to improve this. The IKEA website even states that the Trådfri products can be used with Hue:

Do the IKEA smart lighting products work with the Philips Hue Bridge?

Yes, you can use the IKEA smart lighting products together with the Philips Hue Bridge.

How do I connect my IKEA smart lighting products to a Philips Hue Bridge?

If the software version of your IKEA smart lighting products is 1.2.x or later, you can connect them directly to a Philips Hue Bridge. Simply follow these steps: – First, make sure that the light sources that you want to connect have an updated software version (1.2.x or later).

– Keep the light sources close to the Philips Hue Bridge.

– Search for new devices with the Philips Hue app.

– Do a factory reset of the light sources by toggling the main switch six times.

[…] If the software version of your products is not 1.2.x or later, you need to update it by using a TRÅDFRI gateway and the IKEA Home smart app.”

IKEA Smart Lighting product support

A few things I found:

  1. Trådfri bulbs do seem to need to be physically close to the Hue Bridge in order to pair (as noted above).
  2. Some early firmware versions didn’t work so well with non-IKEA gateways (as noted above). I’ve had no real issues with my 2017 Week 44/46 and 2018 week 01 bulbs. You can find the version number on the packaging before purchase. According to the Hue software, these are all running software version 1.2.214.
  3. I couldn’t make IKEA Trådfri accessories (switches, etc.) work with the bulbs whilst the bulbs were paired with Hue. Your mileage may vary. I returned my Trådfri gateway to the store.
  4. Sometimes, the Trådfri bulbs will stop responding (remain on or off, regardless of control). This can usually be fixed by removing them from their fitting and then reconnecting them (basically rebooting the bulb). Later firmware may help.

Mixed messages

One side effect of the mixed system is that the Philips Hue software can only update its own equipment. It recognises the other equipment and will even tell me the software versions but updates would need the corresponding Innr or IKEA gateways and apps to be used. That’s a cost and level of complexity that I decided to manage without.

Software update in the Philips Hue app (Hue bulbs)
Software update in the Philips Hue app (Ikea Trådfri bulbs)
Software update in the Philips Hue app (Innr smart bulbs)

Smart Assistants

I mentioned that my cheaper bulbs are not compatible with Apple HomeKit, but I’ve had no problems working with Amazon Alexa via the Philips Hue skill. In truth, my home automation is a rats nest of Samsung SmartThings, TP-Link Kasa, SmartLife, Apple HomeKit and Amazon Alexa. I really need to look at sorting that out (maybe with Home Assistant). Watch out for a future blog post… hopefully it won’t be four years in the making).

Wrap-up

My experience with Zigbee smart bulbs from a variety of manufacturers has largely been positive. I still occasionally ask Alexa to turn on a light and find it doesn’t work because someone has switched off the circuit but that’s what us IT folks refer to as a “layer 8 problem” or an issue with the “wetware”. Whilst mixing manufacturers may present some challenges with updates, a Hue hub at the centre of a mixed network seems to work pretty well for me. After all, the likelihood of someone hacking my unpatched IKEA lightbulbs seems pretty minimal…

Acknowledgements

Featured image by soynanii from Pixabay.

Smart lighting: Part 1 (getting started with Philips Hue/Zigbee)

This content is 3 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

Earlier today, I spotted a tweet from Karan Chadda (@kchadda) that reminded me of an unfinished blog post from 2017…

So, here’s part one of the story that never got posted…

A new Hue

Around four years ago, I began an experiment. Hot on the heels of success with a Wi-Fi activated smart socket (a TP Link HS-110), I thought I’d expand on my home’s Internet of Things (IoT) credentials with some smart lighting.

I should explain that my house is a fairly typical UK house: a 1990s-built, detached property, with some pretty uninspiring pendant lights in most rooms. The kitchen/dining room is a little different, as it has low-voltage MR16 spotlights. These were recommended by the electrician who worked on our extension in 2009.

I did some research, and decided that I wouldn’t go down the Wi-Fi route. Not only were the bulbs expensive but it’s not a great use for Wi-Fi (and at the time my home Wi-Fi performance was pretty flaky). Instead, I went for a Zigbee-based solution, with Philips Hue at its heart.

The Hue gateway is pretty easy to set up – it just needs a wired connection to the network. Most home routers have a few of these; my setup is a little more extensive, with PowerEthernet running to my office and other locations that are away from the Internet connection but have a need for wired network connections. With a gateway in place, it was just a case of strategic lightbulb swap-outs, taking out traditional bayonet-fit (B22) bulbs and replacing them with smart equivalents.

Smart lighting, not so smart users…

At this point I should explain, all the smart technology is useless if the circuits aren’t left powered on. And this has been the major flaw in my plan. Our family is divided between the geeks (myself and my eldest son), and the “normal” tech users (my wife and my youngest son). If I was being less charitable, I might put my wife into the laggards category but, to be fair, she’s happy to adopt technology when she can see its value.

For me, part of that value was the ability to set up routines so that lights turn on/off when we’re away from the home. I also have one that turns all the lights off after everyone has gone to work/school (because physical switches appear to only work in one direction for my family – they can all turn lights on, but seemingly not off – I believe this is a common complaint for Fathers up and down the land, walking around houses turning lights off in empty rooms, even during daylight hours).

The biggest drawback I found was that I’ve yet to identify suitable Zigbee switches for the UK market. That means that, when the circuit is switched off (usually when leaving the house or going to bed), the lights are no longer controllable in software. On the flip side, the less-technically-inclined family members can operate the lights as normal, with the only minor inconvenience being, if the light has been turned off in software, they need to flick the switch off and on again to turn on the light “manually”.

Those in other parts of the world may have more luck – have a listen to these podcast episodes or watch some of the videos on this channel:

Form factors and accessories

Over time, I’ve expanded the system and I now have smart bulbs in the communal areas (hall, stairs, landing, etc.) as well as in the home offices and some of the bedrooms.

Unfortunately, there are no suitable MR16 Hue-compatible bulbs, so the rooms with those lights still have traditional halogen (for dimmer-controlled rooms) or LED spotlights. I’ve also stuck with “normal” bulbs in the bathrooms.

I’ve added a Hue sensor in the garage storeroom (so the light comes on when we open the door) and a couple of Hue dimmers, one of which has moved between various rooms over the last couple of years but is currently in our loft room. For the dimmer, I bought a Samotech adapter that covers the original light switch (left switched on), whilst still allowing the Hue dimmer to attach magnetically.

Samotech adapter in use with a Philips Hue dimmer and a standard UK light switch

The verdict?

All in all, things are working well. After nearly four years I’ve only had one failed bulb (replaced under warranty after about a year). The Philips Hue system seems to be a widely supported platform, with plenty of integrations (e.g. to smart home assistants) and the use of third-party bulbs in places has helped me to keep costs down to a reasonable level (I’ll write about these in my next post).

Acknowledgements

Featured image by HeikoAL from Pixabay.