Wiring for smart lighting with Shelly relays!

I’m building an extension to my kitchen.

As readers of my blog and Twitter will know, I love home automation and building work presents an opportunity to incorporate more of it!

My Current Smart Lighting

The vast majority of smart lighting in my house is provided by Shelly devices. These are incorporated into the ceiling roses or loft spaces and provide 99% of the lighting control. When my house was being refurbished back in 2021, I asked the electrician to ensure that each ceiling rose had a permanent live or that the permanent life was easily accessible. This enabled me to add the Shelly 1 devices without any drama.

A different approach

With our new extension, we were going to have a mix of down lights, track lights and pendants. The track lights and down lights would make the Shelly 1 devices really tricky to install. I had a chat with my electrian and asked him whether or not I could have all the wiring pulled back into one central location. I explained how the Shelly devices worked and he said it would be no problem at all.

To explain this a little better, I’ll go over how it’s “typically” done.

Wiring of a standard ceiling rose

In a typical ceiling rose, power from the consumer unit (fuse board) arrives at the unit. A wire then runs from the pendant down to the switch. Power is sent down to the switch and comes back to power the light.

In my arrangement, the power, lamp wire and switch wire would all be come back to a single location, where I could install a Shelly device.

My proposed electrical arrangement

I had eight lighting circuits in total, covering the kitchen, the utility room and the outside lighting. After first fix of the electrics (where all the wires are put in) we had a mass of cables!

Wiring it all up

The electrician decided to use a small consumer unit to store all the wiring which was a great idea. It provided common rails for the multiple live and neutral wires what would be needed.

After a little troubleshooting, he got it all wired in.

Eight lighting circuits in one place!

When it came to configuring the Shelly devices, I hit a few bumps. Firstly, two of the little buggers were dead. I knew I’d fried one or two of my original ones when I was first installing them (one electrically and one botched firmware install), but I never threw them out. This meant I only had six operational units. The sixth one worked, but I couldn’t connect it to the Wi-Fi network, so it was practically useless. I scavenged a dimmer module from another light so the electrician could finish.

It was when I came to adding everything in Home Assistant that the biggest problem revealed itself. The metal consumer unit wreaked havoc with the Shellys’ Wi-Fi connection. The RSSI was really poor, and my experimenting showed about a 30% success rate when trying to operate the light via the app. They don’t have any external antenna, so I knew they’d always struggle.

Going Pro

At this point, I recalled that the Shelly product line contained the perfect alternative. The Shelly Pro range! These are DIN rail mounted units, designed specifically for consumer units. They provide the standard switch wire and on/off support, but also have power monitoring included.

More importantly, they also have ethernet connectivity, which would solve the problems caused by the big metal box. Unfortunately, I didn’t have any ethernet cables going to the unit, so that would have to be solved first.

Moar ethernet!

After some detective work in the eaves and loft, I found a route for my ethernet cables that didn’t involve any drilling or fishing of cables. I pulled in two cables and fished them down through the kitchen ceiling into the unit where the consumer unit was installed. All invisible, no orange wires showing, which is important.

I have isolated the wiring unit at the fuse board and checked with my Fluke tested before I started feeding cables in. If you are working with electricity, please be careful! If you don’t know what you’re doing, get a professional!!

Getting two ethernet cables down through the rafters!
My cable is visible through the opening on the right

With some help from my wife and a coat hanger, we got the two ethernet cables through.

I have lots of ethernet cables in the loft, along with a small five port switch. I crimped the cables and tested them. Stage one complete!

Stage two was replacing the Shelly units. I worked one by one until, removing the wires from each individual Shelly and moving them into the Shelly Pro. I did it slowly like this as nothing was labelled, so this way I didn’t have to keep track of too much. The switch wires were either different colours or had a little collar on them.

Short time lapse showing the installation of the second Shelly Pro

After about an hour, I was finished. I connected the ethernet cables and both devices appeared on my network. I did a video of the whole process and it’s up on YouTube – https://www.youtube.com/watch?v=hxtuzFlFZ5s


So aside from the issues with WiFi and a metal box, the approach worked out as planned. That said, one thing I’d have benefited from was an isolation switch. When I was swapping out the Shelly 1 devices for the Shelly 4 devices, I had to kill the power at the fuse board, which is in the garage. A couple of trips back and forth could have been saved by having a switch beside the unit.

Next step is to add these to my Home Assistant integration and connect them to Homekit.


Matter, Unifi and mDNS

I started playing around with the connectedhomeip repository last week in an effort to get a better understanding of Matter and Thread.

One of the issues I ran into was related to how Matter uses mDNS and DNS-SD.

After hours of messing around with both my nRF52840 and ESP32 boards, I could see both WiFi connections (ESP32) and Thread connections (nRF52), but pairing via the chip-tool and iOS would fail.

Open Thread Border Router showing my Matter device on the network

As I got to understand more about the pairing process, I realised that the DNS-DS part wasn’t working. Matter uses services called _matter._tcp and _matterc._tcp to indicate they are present and ready to be commissioned.

Using WireShark, I could see that the mDNS traffic I expected just wasn’t arriving correctly.

Unifi and mDNS

I came to realise my issue wasn’t related to Matter, but to my Unifi networking setup.

The first setting to change is Router Advertisment. This is required by Thread networking when you an border router. It lets the devices on the Thread network advertise onto your IP network. You’ll find this under the Networks tab.

The next setting to tinker with is under the WiFi panel. Select your WiFi network and ensure Multicast Enhancement is enabled. Most importartantly, ensure that Multicase and Broadcast Control is disabled! This setting, when turned on, only allows certain devices to Multicast.

With those two settings, I began to see the services appear on both my Mac and Windows PC. Pairing was then successful using both iOS and the chip-tool.

Using the macOS dns-sd tool to browse for Matter services

I’ve a lot to learn about Matter and networking, but this might help you get unblocked. If you’re learning more about Matter, I’d love to hear from you. Tell me what you’re up to in the comments!

Gas Energy Usage – Nov 22

With Christmas around the corner, I wanted to post an update on my November 2022 gas usage before I wind down for Christmas.

Usage in November last year 292m3, which is around 10m3 of gas a day. That’s about 110kWh per day.

November 2022 was a different story. We were out of the house for a week or so, due to building work, so the heating was turned way down. Total usage was 119m3. If I factor in the time we were absent, the average usage is 6m3 or 70kWh per day.

As we are having work done on our house, the hallway is much, much colder than it should be as the thermal envelope of the house is compromised. Even with the figure being higher than it could be, a 40% saving is impressive! I’m very happy with that.

December will be the most interesting as the first two weeks were sub-zero!

Gas Energy Usage – Oct 22

As it’s now the first of November and heating season has begun, I wanted to do a quick comparison of my gas usage between Oct ’21 and Oct ’22.

In Oct ’21, we used 93.2m3 of gas, which is approximately 1024kWh. We were away for eight day’s that month, so the usage was zero.

Spin ahead to 2022 and for October we’ve used 890kWh of gas. That’s 134kWh less gas used.

Firstly, I stopped using gas to heat my water (for the most part) by switching to the immersion. Looking at Mixergy’s data, they estimate I used about 221kWh of gas to heat my hot water during October. 8 days of the month had no heating.

If I factor in the 221kWh of hot water, we’ve actually used *more* gas this October that we did last October! Of course, that doesn’t consider the 8 days that we were not home. If I guestimate the usage at 3m3 a day, it would add 270kWh.

October ’21 would therefore be about 1300kWh in total. Take away the known hot water usage of 221kWh and the guesstimated hot water usage of 76.8kWh (9kWh a day) and we’re left with 1000kWh of heating. That’s a reduction of 110kWh.

Is that a good reduction?

I’ll be honest and say I hoped the reduction in usage would be much higher. It’s been very mild this October, with average temperatures breaking records across Europe, so the fact that my heating used almost 900kWh is disappointing. In addition to the warm weather, I’ve lowered my boiler’s flow temperature and I’ve had Thermabead cavity wall insulation installed.

Admittedly, we’re doing an extension, so the back of our house has been opened up (with an OSB false wall), but even with that, I can’t say I’m not disappointed.

That said, this is a marathon, not a sprint. The weather will be turning colder as we head into November. Last November we used 3280kWh gas with about 3000kWh used for heating. I’m hoping to see a 10 to 15% reduction in this.

First Tesla Model Y Road Trip

Back in 2019, we booked a 2020 trip on the famous Jacobite train, which starred as the Hogwarts Express in the Harry Potter film series. COVID-19 closed the railway, which meant we had to postpone the trip until this year.

The original plan was to drive up to Fort William, in Scotland. At the time of booking, I was driving a VW Tiguan and living in London. The journey didn’t pose any real challenges.

Fast forward to 2022 and I’m now driving a Tesla Model Y and living in Solihull. This was going to take a little bit of planning. There would be four of us travelling, two adults, two kids under ten and a boot full of enough clothes and supplies to last us at least nine days. Fully laden is the term I’d use!


We did 1275 miles at cost of about £100, which is 8p per mile. In comparison, our friends did 1475 miles in a diesel, which ran them about £300 or 20p per mile. Had I used cheaper, slower chargers, the total bill would have been less, maybe only 6p or 7p per mile.

To the Isle of Skye!

The Jacobite train departs from Fort William, which is north of Glasgow. We booked an AirBnB for two days. As we were heading that far, we figured we might as well go a little further and added another AirBnB in Portree, on the Isle of Skye.

From Solihull to Portree was 520 miles and the route goes via Fort William, so it was pretty direct. The Tesla Model Y has a quoted range of 330 miles, but that is probably more like 280 or 300 in real life. This meant I’d need to have a vague idea of where we would be stopping to charge up.

Predeparture (100%)

Prior to leaving home, I charged the car to 100% using my Zappi home charger. This took two overnight sessions. I then set the car to precondition the battery before leaving. This can be done using the Tesla app and I left the car plugged into the wall to avoid using any of the battery’s charge.

Preconditioning will warm or cool the battery so you set off with the best possible range available.

My charge history as captured by Teslamate

#1 Solihull to Gretna Green – 220m (100% – 21%)

Leaving around 5pm on a Friday, we headed straight up the M6 to Gretna Green and stopped at the motorway services. I booked a nights’ stay in the Days Inn in an effort to break up the journey, as much for the kids as anything.

I plugged the car into a Tesla Supercharger and it took about an hour to get the car back to 100%. Thankfully it was very quiet. The 62kWh cost me £29.76. I was honestly surprised it was so expensive, but given the cost of electricity it shouldn’t have come as a shock.

#2 Gretna Green to Balloch – 110m (98% -> 59%)

The kids started acting up after we passed Glasgow and as it was approaching lunch time, we decided to stop at Balloch, on the southern tip of Loch Lomond. We parked up and I spotted there was an EV charger. A *free* EV charger. Once plugged in, we had a wander on the shores of Loch Lomond to stretch our legs.

I got 18kWh from the charger in the hour and a half we were there, taking the car back up to 80%. Not too shabby for £0!

#3 Balloch to Fort William – 85m (80% -> 50%)

This stretch of the journey was absolutely amazing. The scenery was breath taking.

For any James Bond fans, this road was featured in the Skyfall movie. We took a small detour down what is called “The Skyfall Road” in the hopes of recreating the iconic scene. Alas, this proved to be a bust since I didn’t prepare well enough! More on this later.

We continued on through Glencoe and on up to Fort William, where, with the help of some friendly locals, we located out AirBnB.

#4 Fort William

As luck would have it, there was a 22kW charge across the road from the flat. At 18p a kWh, this was pretty cheap, so I took the opportunity to plug in the car and charge it to 80%. This took 25kWh and cost me £4.61.

We did our trip on the Jacobite Train, which was pretty great. As we were travelling to Skye the next day, I took one last opportunity to put a few more kW into the car at the same charger. Another 11kWh and £2.14 took the car up to 85%. More than enough to get us to Skye.

#5 Fort William to Portree – 110m (82% to 36%)

This leg made very obvious the difference in motorway vs A roads. The weather was also wet and miserable, so the heating in the car was on. That said, 42% to do 110 miles wasn’t too shabby!

#6 Portree

We did quite a lot of driving in and around Portree, with day trips to dinosaur footprints and castles. For the most part, the roads were A roads, but there was also a lot of driving on single track roads.

After the first day trip, the car was down below 20% so I decided to go to the charger in the town centre. Thankfully it was unoccupied. Unfortunately, I couldn’t start the charge session using the ChargePlace app. I’ll admit that I got a little worried at this point. If I didn’t have access to a rapid charger, it would mean leaving the car plugged into a wall socket back at the AirBnB for 2 days!!

I called the number and the agent was able to set the charge up for me without any issues. They explained that their app has trouble talking with older charging stations and that manual intention was required. There was a 45min limit (with 15min grace period) on the charging sessions(!) so I opted for the 50kW charger instead of the slower 22kW. An hour there and the car was charged to 66%.

The following day I used the charger again and filled the car to 100%. The day before leaving, I use the 3pin charger to replace the miles lost from the days’ road trip and we were ready for our trip back to Glasgow.

#7 Portree to Fort Augustus – 90m (95% to 65%)

No visit to Scotland would be complete without a visit to Loch Ness 🙂

We drove down along the shore to Fort Augustus, where we parked up at a free charge point. As we had plenty of range, I went for a 22kW charge. 2 hours added 22kWh for £0.

#8 Fort Augustus to Glasgow – 141m (91% to 50%)

This leg of the journey took up back through Glencoe and we had another stab at the Skyfall picture. The small, single track road was much, much quieter. Whilst I didn’t manage the perfect picture due to a Skoda being parked in the shot, we got close enough!

#9 Glasgow to Abingdon- 40m (40% to 22%)

The drive back from Glasgow to Solihull was going to be over 300 miles, so I know that starting with less than 100% would mean two stops on the way home. The first stop was at Abingdon services. When we pulled up at the supercharger, it was 1/3 full (2 cars out of 6 bays).

The Tesla route planner said that a 25 minute stop was necessary, but as the other bays filled up, this increased to 45 minutes. Instead of 120kW, we got 50kW.

Whilst the kids played games on the Tesla’s screen, I reviewed the rest of the route. I knew the car recommended at the services just south of Preston, which was perfect, since we’d planned a short stop in Preston to visit some family. On closer inspection, I could see the route required us to double back to the services, which was odd. On checking, I discovered that the Preston chargers were only available on the northbound side!!!

We cleared the route and tried again. This time the Tesla recommended a stop at the Trafford Centre outside Manchester! This would add lots of time and miles to our journey, but we didn’t see to have any choice. We decided to just head for Preston and once there, check ZapMap to pick another route.

We ended up staying for an hour, added 54kWh and taking the charge up to 90%. This cost £26.

#10 Abingdon to Preston – 145m (90% to 41%)

It was during this part of the journey that we started to hit the holiday traffic. Lots of it. It was stop start and 30mph for a long part of the journey. Our kids fell asleep and with the cruise control and autopilot steering, it wasn’t as stressful as traffic usually is.

It also had a real silver lining! As we crawled along, the miles used less battery power and as we approached Preston, we recalculated our route. We no longer needed to head towards Manchester. Instead, we had enough range to make it Stoke-on-Trent!

#11 Preston to Trentham – 70m (41% to 17%)

With 41% and about 70m to cover, we were feeling more relaxed now. We had checked the two superchargers stations around Stoke-on-Trent and spotted that the one at Trentham was a 250kW one. This would mean a shorter charge, so we decided to shoot for that one, even thought it was further than Keele services.

It was totally worth it. The Trentham services has twelve chargers and only one car was there when we arrived. The car told us it needed 8 minutes before we could continue our journey, but in reality, 3 or 4 would have been enough.

As it happens, there was a nice restaurant opposite, so we popped in and bagged a table. I returned to the car having left it about 10 minutes. 29kWh added @ £13 bring the car up to over 50%.

#12 Trentham to Home – 59m (51% to 31%)

Uneventful final leg!


The journey was a total of 1275 miles with 313kWh used. I haven’t received the bill from the two charges on the Isle of Skye, but the other charges totalled about £80. Add about £6 to cover a full charge at home. I reckon it will be about £110 in total.


For all the hours and miles driven, the Tesla’s autosteering behaved flawlessly. I had the autopilot steering engaged for almost all motorway driving and it only put its foot wrong once, with a little wobble as we drove only the M8, south of Glasgow. When we did the first leg, it was 220 miles straight, without a stop. I got out of the car feeling great. That would never have happened in my Tiguan. The 100 miles between London and Birmingham would have had me yawning and needing to stop.

I don’t really understand it. I mean, I was paying attention, checking mirrors, overtaking etc. but having the car do most of the steering and accelerating must be less taxing on your brain? All I know is that I did almost four hours in one go and felt fresh and relaxed when I got out of the car.

I even tried the autosteering on some of the A roads as they were very well market. For the most part it had no problems, but on a few occasions, it reduced speed to deal with “poorer conditions”. This didn’t make sense to me on some occasions as the road looked well marked and the sun was shining. That said, I’d glad it’s cautious!

Comfort and boot space.

1200 miles in comfort. No moving around in my seat or getting a numb arse. Surprisingly comfortable on the bumpy single track roads. Wife had no complaints either. Kids did complain about being too hot in the back, but we realised that we’d blocked the vents with a bag 🙂

In terms of the boot space, we packed in seven bags of clothes, two large bags of food, a laptop bag, boxes of walking shoes, toys, coats, one bed guard and a yoyo zen buggy. And we didn’t use the front trunk at all!

Lessons Learned??

In hindsight, I should have fully charged the car in Glasgow. We were there for two nights on the way home, giving me ample opportunity to find somewhere to plug it in for a few hours. We would have only needed one stop on the way home. Some charging capability in the hotel carpark would have been very useful. If you’re parked up for 36 hours, even the 3 pin charger would be sufficient!

We also got lucky with our charging stops I think. At Abingdon, we might have been stuck there for two hours had we arrived when the chargers were all occupied. There is no system for queuing or being alerted to a charger freeing up, so we would have had to sit in the car waiting. Not ideal at the best of times, but even less so with two small children.

We did stop for a toilet break along the way and whilst there was one GridServe rapid charger there, it was full (two cars!). Somebody was leaving as we drove past, but the driver frantically gestured to indicate another car was waiting. If I’d been less than gracious, I probably could have snuck in and hooked up for 15 minutes.

This is balanced with the 250kW charger experience. As it was a few miles off the motorway and after hours, it was basically deserted.

I can see why they say we need another 300,000 chargers over the next few years.

Wrapping up

Driving through Scotland was amazing. The ChargePlace charging network is pretty extensive up there and their free charging points are great. Their support with the Portree charger was great. I wish it worked with the app, but I’m sure there is a ticket on their development backlog to sort it out.

As an EV driver, this has boosted my confidence even further that long trips just take a little longer and require a little planning. A small sacrifice I guess.

My Mixergy IoT device – The start!

I’m loving my Mixergy tank, but one of the main issues is that the temp display is connected to the tank by a short wire. My tank sits out in the garage, so without consulting the app, it’s hard to know how much hot water you have.

The Mixergy control unit, showing charge, connection state and heating info.

Using my Home Assistant Mixergy integration and Siri Shortcuts, I’ve created something that my wife and I use. We can ask Siri to “check the hot water”. and it will reply with the current charge and water temperature. This is really useful as it works on our Homepods.

As fun as it is having to ask the computer for the tank measurements, I wanted to actually put a gadget into the bathroom, which would simply display the current charge etc.


When choosing the platform, there were a few considerations. Firstly, I didn’t want to spend any more money. I have small screens and MUC devices strewn around the office, so I wanted to make use of the stuff I already had. Secondly, it needed to use little or no power since it was going into the bathroom.

Years back, I purchased a WaveShare e-Paper display, but never found a use for it, until now. E-paper is great as it consumes no power when it’s idle. This felt look a logical choice!

For the MCU, I picked D1-Mini, which has an ESP8266 controller on it. These are great little boards for experimenting with.

Normally, I would be firing up a ZephyrRTOS project and writing some C, but this time I wanted to spend less time messing around and more time actually getting something finished. I’d heard about ESPHome and took a look. ESPHome is really cool platform that works with various MCUs and allows you to just cherry pick various components to build what you want. Put it all into a YAML file and install it. You can even update it over the air. It’s pretty cool.

It also supports ePaper! You’ll find the support detailed here, in addition to the wiring information. https://esphome.io/components/display/waveshare_epaper.html

To create a node for my Mixergy, I put together this little YAML file:

  name: bathroom
  platform: ESP8266
  board: d1_mini

  ssid: "<wifi_ssid>"
  password: "<wifi_password>"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "Bathroom Fallback Hotspot"
    password: "<update_password>"


# Enable logging

# Enable Home Assistant API
  password: "PWD"

  password: "PWD"

# Sensor
  - platform: homeassistant
    id: current_charge
    entity_id: sensor.current_charge
    internal: true
  - platform: homeassistant
    id: coldest_water_temperature
    entity_id: sensor.coldest_water_temperature
    internal: true
  - platform: homeassistant
    id: hot_water_temperature
    entity_id: sensor.hot_water_temperature
    internal: true

# Display
  - file: 'fonts/arial_narrow_7.ttf'
    id: font1
    size: 32
  - file: 'fonts/arial_narrow_7.ttf'
    id: font2
    size: 78
  - file: 'fonts/arial_narrow_7.ttf'
    id: font3
    size: 24
  clk_pin: D5
  mosi_pin: D7

  - platform: waveshare_epaper
    cs_pin: D1
    dc_pin: D3
    busy_pin: D2
    reset_pin: D4
    model: 1.54in
    full_update_every: 30
    rotation: 90
    lambda: |-
      it.printf(100, 10, id(font1), TextAlign::CENTER_HORIZONTAL, "Mixergy");
      it.filled_rectangle(10, 50, 5, 130);
      it.filled_rectangle(50, 50, 5, 130);
      it.filled_rectangle(16, 180 - (130 * (id(current_charge).state / 100)), 33, 129 * (id(current_charge).state / 100));
      it.filled_rectangle(10, 180, 45, 5);
      it.printf(60, 51, id(font3), TextAlign::TOP_LEFT, "%.1fC", id(hot_water_temperature).state);
      it.printf(130, 88, id(font2), TextAlign::CENTER_HORIZONTAL, "%.0f%%", id(current_charge).state);
      it.printf(60, 162, id(font3), TextAlign::TOP_LEFT, "%.1fC", id(coldest_water_temperature).state);

This connects to the Home Assistant API and queries three of the sensors that belong to my Mixergy integration. It then renders this on the ePaper screen, showing a simple representation of the Mixergy tank, the hot and cold water temperatures and the percentage charge. It’s everything you need to know about the tank, at a glance.

Next Steps

Next step is to connect this sucker to a battery and experiment with the ESP8266 deep sleep. I think a five minute interval for refresh is probably enough (dropping to hourly at night), but connecting to WiFi and redrawing the screen consume a lot of power, so I’ll have to play around with it. Maybe I can use a small solar panel too as the unit will probably sit on a sunny windowsill.

I’d also like to make a little case for it, but I’ll need to do some research and see if there isn’t something I can just buy. This Waveshare unit is pretty common, so somebody must have made a case!

Then I’d like to add some sort of boost button, so we can charge the tank too. That’s further down the line as it will require changes to my Home Assistant integration…

Other Ideas

Given that a cloud API exists for Mixergy already, it would probably be possible to build a standalone unit that wouldn’t require Home Assistant at all. I’ve thought about this for my iOS shortcut – if I changed it to query the API directly, the Shortcut would be usable by anyone!

Smart Bulbs: my lightbulb moment?

I’ve always disliked smart lightbulbs.

Turn them off at the wall and you immediately question why you paid 1000% more.

I’ve held this position for years and years, until one day I came across a tweet by Troy Hunt where he used the words detached and Shelly1. This immediately captured my interest!

Now, I’ve had a few Shelly 1 relays installed in my house and they brilliant. So brilliant in fact I’d sort of forgotten about them. But when I heard about Troy was using them in combination with smart bulbs, my mind started racing.

Somewhere in the past 18 months, Shelly added a new Button Mode into their settings called Detached Switch.

Traditionally, you would install a Shelly 1 and use the button type of Edge Switch, which would allow the wall switch to turn the light on and off by flipping it. You can turn it and off via an app and the wall switch. Brilliant. Of course, the problem with smart bulbs still remains – turn the Shelly off at the wall and the smart bulb loses power.

This is where Detached Switch mode comes in! The relay is basically On and when you flick the wall switch, it raises an event and you then react accordingly.

With this combination, we can have a smart bulb and use a light switch!

Setting it up, however, does require jumping through a few hoops.

Setting it all up

Once the relay has been physically installed and setup, you can switch the Button Type to Detached Switch using the settings webpage on the relay. This disconnects the relay from the switched live.

For me, I use HomeAssistant, so I use the Shelly Integration to add the relay. When you open the device, you’ll see there are seven entities. The switch.shelly1_xxxx entity points to the actual relay, so toggling this switch will actually toggle the relay on and off.

The entity we’re interested in is the binary_sensor.shelly1_xxxx_input. This entity is connected to the switched live on the Shelly 1, so flicking the light switch will change this entity from on to off. By default, this entity is disabled in HomeAssistant, so you’ll need to enable it.

The Shelly Integration shows more than just the relay control

I purchased a LIFX IR bulb, one with a full color range and HomeKit support. LIFX setup was easy. The LIFX app found the bulb and connected it to my WIFI and HomeKit.

LIFX Nightvision A60 1200 lumens [B22 Bayonet Cap], Full Colour with  Infrared, Wi-Fi Smart LED Light Bulb, No bridge required, Compatible with  Alexa, Hey Google, HomeKit and Siri : Amazon.co.uk: Lighting

As I use the LIFX integration on Home Assistant, the bulb was added automatically.

I now had my smart bulb and my detached Shelly relay.

To connect these two things together, I used NodeRed. I use NodeRed for all of my automations. The automation is just two nodes. The first listens for state changes from the _input entity and it then toggles the LIFX bulb on or off.


I’ve switched out all the a lot of the bulbs in my house to these LIFX bulbs as I picked up some refurbished dawn/dusk bulbs on Amazon.

It’s been around a month since I started converting all the bulbs and pendants, but in that time I’ve only had one issue and that was caused by one of the LIFX bulbs losing connection with HomeKit – which didn’t affect Home Assistant.

This setup is a great combination. The kids are can use Siri to turn on some of the lights and when we’re going to bed, the physical switch works as it always has.

There are some things I need to tweak, like brightness. For example, if we dim the light as we settle into the evening, we’re left fumbling for an app or asking Siri if we want the brightness back up when we turn the light on the following evening. I need to add some automations to just reset the brightness overnight or something.

My Mixergy Smart Hot Water Tank

I recently installed a Mixergy smart hot water tank into my new house, as part of a total renovation. I’ve been very impressed and wanted to share my thoughts on the product after using it for a few weeks.

The problem with hot water tanks

For me, the problem with hot water tanks two fold.

  • You’ve no idea how much how water you actually.
  • You don’t know how hot the water in the tank actually is.

My previous arrangement had a 210L unvented cylinder connected to a system boiler and controlled using a Nest Thermostat. In a setup which is repeated around the world, my boiler turned on at 5AM and heated the water for 30 minutes.

During the summer months, the water that came out of the tap would burn your hand. Sometimes we’d have water for two showers and a kids bath and other times, my shower would run cold towards the end. Never a great start to the day.

I tried to get a handle on this myself, by installing two temperature problems on the inlet and outlet of the tank and using the temp of the hot outlet to try and guess how much hot water we had. It worked pretty well, as it took some of the guess work out at bath time. That said, I still had to boil the kettle to top up the water as it ran cold from the tap.

I wanted to install more probes, so I could measure the temp at a few places, but the best I could manage was the positions of the various outlets. In the end, I had four probes attached to my tank, which helped, but it was never just accurate enough.

Why not just keep heating the water?

This is a solution that most people suggest – just heat the water for another thirty minutes in the afternoon, or boost it before you give the kids a bath.

For me, this just wasn’t what I wanted to do. Burning gas is something we need to stop doing for the environment and besides, why waste money heating water that’s already hot enough?

Enter the Mixergy!

I stumbled across the Mixergy tank quite by accident, whilst watching an episode of the YouTube show Fully Charged. The brilliant Robert LLewlyn had one of the tanks installed in his home as part of a trial and during the show he interviewed the creator of the product.

What makes the Mixergy tank different from other unvented cylinders is that it can tell you roughly how much hot water you have, as a percentage of the tank’s overall volume. It will also give you the inlet and outlet temperatures (like my crude attempt!).

In addition, it also heats the water by volume, meaning you only heat the amount of water you want, rather than trying to heat all the water in the tank at one go. This gives you much greater control. If you only need 100L of water during a normal day, the Mixergy tank will heat that amount. Better for the environment and my pocket.

The design also enables the tank to heat water more quickly, so in the event you do run out, you won’t have to wait too long.


Mixergy offer a few variations on the base tank, allowing you to access different heat sources.

Solar PV – The tank has an electric element installed as standard and you can have a dual element installed, which allows you to power the element using Solar power

Solar Thermal – The tank can come with a secondary coil inside, which enables you to use Solar Thermal

Heat Pump – All the tanks are heat pump ready and they require an exchange to be installed. This can be added in the future.

Hydrogen Boilers – As it’s an unvented cylinder, the primary heating coil will work whether connected to a gas boiler or a hydrogen boiler, so again, the tank is future proofed.

I vacillated between the solar PV and solar thermal options. In the end, I opted to just have the Solar PV version. I figured that Solar PV offered more flexibility and is something I’d be more likely to invest in, combined with a home battery. Mixergy also offer integration with Timer-Of-Use electricity tariffs and that offers a little more flexibility too.

When it came down to cost, the 210L Solar PV Ready Tank I ordered was a little over £1200. An equivalent 210L unvented cylinder can cost anywhere from £300 to £800, depending on all sorts of factors. The Mixergy tank itself is close to the top end in terms of size, insulation etc. so I reckon it was around £400 more.

Ordering and Delivery

I ran into a few bumps here. When I got in touch with them originally, they confirmed they could make delivery on my desired date, to coincide with the plumbing work. However, as we got closer to the dates, they reached out to tell me they wouldn’t make it in time. I was pretty annoyed to say the least.

They reached out again a day or two later to say I could have the slimline version of the tank, delivered on the original date at no extra charge. I rushed over to the house with an inch tape to confirm it would fit, with the required clearance. Thankfully it did and the order was confirmed.

The tank arrived. I must admit to being a little giddy with exceitment!


The Mixergy tank is essentially just an unvented cylinder with some additional technology built into it. This means the installation of the tank is the same as any other unvented tank. Our heating engineer installed it without any issue. We were short a few capping nuts and because they were a very unusual size, we had to contact Mixergy to get them. They did provide them, but fortunately, the engineer found a few he had and finished the job..

Being a smart home enthusiast, the heating engineer didn’t connect the thank to any heating controls. This is something I wanted to tackle myself.

I chose Tado for my central heating. This was for two reasons – it offers HomeKit integration and they have an API that HomeAssistant can use. They also have nifty smart thermostatic valves, so individual rooms can be controlled as zones.

As plumber installed my central heating in an Y-Plan configuration, I knew that control of the valves would be split, with the Mixergy tank controlling the hot water valve and the Tado would control the heating. The setup was straight forward and after a lot of reading and some triple checking, it worked. Thankfully.

The Tado control unit all connected to the two valves

The App

With the tank wired into the boiler and fully commissioned, it was time to connect the app with the tank.

This was very simple, thankfully. The tank comes with a Power Line adapter, so it was a case of plugging in the powerline adapter and connect that to my router. I then scanned a QR code on the adapter and the app connected to the tank.

I went through the settings and configured things like target temperature (how how you want the water) and the schedules. You can set the tank to simple heat a certain amount of water or you can have it maintain a minimum amount of how water. You can also boost the tank to a certain amount of water on an ad-hoc basis! Very nifty.

As it’s unvented, you can also setup the cleansing of the tank. If you don’t already know, unvented cylinders need to be heated to a certain temperature every few weeks to kill any and all bacteria in the tank. With my old tank, I just left the boiler temp very high to ensure that the water was always hot enough. To maintain a lower temperature and do a manual cleansing every few weeks would have required going into the loft, boosting the boiler temperature and running the water for an hour. It was simply easier to take the lazy approach. Mixergy solves this by automatically managing this process. You choose the days and times that you want it to occur and it will use it’s best judgement to run automatically. They recommend you do it on days when you might want a lot of hot water anyway, so I opted for the days we bath the kids.

Another nice feature of the app is that it can give you energy consumption information!

First Showers

After our first night at the house, I fired up the app the following morning and boosted the water to 30%. I really had no idea how much water we’d actually need. 30%, as my wife will tell you, was not enough as her shower ran cold.

I think it was a combination of the flow rate being at maximum on the shower, the thermostatic valve not being calibrated and the fact that 60L isn’t enough water for two showers!

By reducing the showers flow rate just a little, we now get by on a charge around of 60%. We do too thi

The API + Home Assistant

Another factor in favor of Mixergy is the fact that they offer an API for interacting with the tank. Once I had the tank installed and connected, I spend an hour exploring the API and seeing what sort of information it returned. I was able to add a basic integration into Home Assistant that returned some basic information about the tank’s status.

I’m hoping to get this added into the Home Assistant platform, but I’ve a lot of work ahead of me!

You can check this integration at https://github.com/tomasmcguinness/homeassistant-mixergy

Final Thoughts

Overall, I’m very, very happy with the Mixergy tank. At this moment in time, I don’t have any figures to really see if I’m saving money.

My previous energy supplier, EON, only had bills available for three month blocks. For example, From 26th of April to the 26th of June, I used 112m3 of gas. I’m guessing we wouldn’t have had the heating on as we were into May, so basic division estimates around we used around 38m3 a month. Looking at my Octopus data, June for example, my gas usage was a little under 30. Of course, we had a gas hob in my previous property, which doesn’t factor in this time.

Of course, as we head into the winter, it will be ever harder to estimate, but my gas concern is over the entire house, and I hope the combination of the Mixergy tank and the Tado will reduce my overall gas consumption. Good for my pocked and good for my kid’s futures.

Automating our dual fuel towel radiator

As I explained in my earlier post, heating our bathroom, we installed a dual fuel tower radiator. A dual fuel radiator is one that can be heating by both our central heating and an electrical element inside the radiator. This allows us to dry our towels without having to turn on the central heating, something that is very useful in the summer months.

The dual fuel element connected via a spur in the wall

I opted for a dumb element, one that has no controls built into it. There are plenty of elements on the market that offer controls, Bluetooth integration and that sort of thing, but they can be very expensive and require dedicated apps etc. I wanted something I could add to my Home Assistant installation, something I had full control over.

My plan was to use a Shelly 1PM to allow me to turn the element on and off. Shelly offer a wide range of smart relays. I’ve used several of them to control lighting and I’ve found them reliable and easy to setup. The 1PM model also offer power monitoring, so I can measure the power being consumed. This isn’t really necessary, but I thought it might be useful to measure this and record the long term power consumption in order to understand how much the radiator costs to run.


When the electrician was installing the element (has to be wired into the wall by a qualified electrician as it’s in the bathroom) I asked that they leave access to the wires beside the fuseboard.

Supply and load wires as left by my electrician

What they left was exactly what I wanted.

Next step was to add a double pole, fused isolation switch. I wanted to be able to knock off the radiator and Shelly relay in the winter. I could have used the RCD directly, but I liked having a dedicated switch.

I added a second backing box to house the isolation switch. I knew a single box wouldn’t hold the switch and the relay. I put a 5A fuse into the switch.

With the double pole switch installed, I then wired in the Shelly. I didn’t need to use the switched life or L1, so installation was very simple, with the load (the element) going into 0 connection.

Once I powered up the Shelly, I connected it to my WiFi network. To my delight, Home Assistant detected it and allowed me to add an integration without having to do any MQTT customization! I haven’t controlled Shelly devices with anything except MQTT, so I decided I’d try this integration out.

How the Shelly 1PM shows in Home Assistant (I renamed the relay switch)

I switched on the relay and after a few minutes the radiator began to warm up. Success!


With the relay working as expected, I added a simple automation to NodeRed

When the towel rail is turned on, this automation will start a timer and automatically turn the element off after one hour. I receive notifications when this happens.

I’ve not controlled anything like this before – it’s one thing if a light automation fails to turn off a light, but if a 600W element is left on for hours and hours bad things might happen. The notifications give me some piece of mind. I’ve never had any reliability issues with NodeRed or HomeAssistant, but better to be safe than sorry.

Next Steps

I’d like the towel rail summer automation to be more automatic, removing the need for manual intervention at all.

My first thought was to use the humidity sensor to trigger the automation e.g. if humidity rises by a few % for a few minutes, then somebody is probably having a shower.

Another option would be to measure how much water being consumed over a period of time. If it’s lots, this would give a indication that a shower or bath is in use.

I’ll go with manual for the time being, mostly to gain confidence that my automation is working.

Making a dumb light switch smart

A few months back, when planning the rewiring of our house, we decided not to include any switched 5A sockets; you know the kind of arrangement where a switch on the wall can turn on some floor lights and lamps in a room? If you want light, but something subdued, it gives you an alternative to turning on the “big light”

We had this arrangement in our previous house and we used it all the time, but for some reason, we opted to do without in our new house. Really don’t know why.

After living in the house for a few weeks it became painfully obvious that we had made a mistake. Yes, we can turn the lamps on individually, but it’s just so damn convenient having a switch!

I have WiFi smart plugs, which I could use, but these just make matters worse as you usually need your phone to turn on and off the lights and aren’t great for guests.

I began thinking of how I might make a dump light switch turn into a smart light switch.

I had a flash of inspiration, when I began thinking about the Aqara light switches I have (in boxes now) and how they had a battery powered model. They are just a push button switch with a Zigbee module. I wondered how I might break one of those apart and wire it in to the my MK switch. I did some googling and I found a YouTube video which showed exactly that – the only downside was that they were using a push switch!

Then I had the light bulb moment; Contact sensors! I did more googling and sure enough, loads of people had just connected standard Zigbee contact sensors into an existing light switches. It was the perfect arrangements. Contact sensors have simple magnetic reed switches, which send the appropriate of open or closed. Swap the reed switch for a mechanical switch and the operation should be exactly the same!

An Aqara contact sensor, opened up

I opened up one of the Aqara contact sensors I had, and inside, I found a small little battery powered module. On the reverse, the reed switch was visible. Please forgive the photo. I didn’t realise it was that blurred.

The reed switch is operated by an external magnet and indicates if the contact is open or closed
I removed the reed switch and added a wire to each of the contact plates

I removed the reed switch and put two wires onto the contacts. After pairing the device with Home Assistant, I was delighted to see that touching the wires put the sensor into a closed position. The next step was putting into a standard switch.

Put the contact sensor into a real switch

That was easy. The switch now successfully opened and closed the contact sensor. I originally used the normally open P1/COM connectors on the switch, but Home Assistant equates “open” with on, so I ended up using P2/COM, so when the switch is Off, the contact is closed.

With the switch working as expected, I created a simple automation in Node-Red to turn a smart plug on and off. Nothing fancy. When the contact is open, turn on the light and when closed turn off the light.

My thoughts turned to actually then installing the light switch and whether or not the zigbee signal would get through the metal backing box of the switch.

Please don’t do anything with electricity without first isolating at the fuse board. If you’re not comfortable doing this, please don’t. Electricity can kill.

I started by opening up the exiting one gang switch and the wiring was as expected. One switched live and

The existing single gang switch
The two gang switch in place
It works!!