Author Archives: Greening Me

Improving the Home Area Network

While generally the network at our smart home works well, I have in the past had some issues with inability to connect between devices. Many of the smaller smart devices use Bluetooth (and in particular Bluetooth Low Energy – BLE) because battery devices lack enough energy capacity to run WiFi with adequate battery life, but we have had some issues with WiFi-connected devices. Intermittent WiFi issues included:

  • connection between all HomeKit hubs (2 x Apple TV + iPad)
  • connection to an external HomeKit WiFi bulb or WiFi smart plug
  • connection from iPad to Raspberry Pi HEMS

After some head-scratching I concluded that the issue relates to my WiFi network or indeed networks. Like many people I have dual band WiFi – 2.4 and 5 GHz. The 2.4 GHz is supported by more devices, carries for a longer distance, but can carry less data; while the 5 GHz can carry more data, but is supported by fewer devices and has less range. Devices with 5 GHz capability can generally choose either frequency, but many cheaper devices are 2.4 GHz only.

It seems to me that devices on the 2.4G WiFi network can reach each other, hardwired ethernet devices in the home, and the external internet. Similarly devices on the 5G WiFi network seem to be able to reach each other, hardwired ethernet devices in the home, and the external Internet. However devices on the 2.4 GHz and 5 GHz WiFi networks don’t seem to be able to reach each other. I couldn’t find any setting in my router that might join or separate these WiFi networks.

The solution that I came to was Powerline adaptors. Powerline adaptors extended a wired ethernet connection over the existing mains electrical wiring of the home rather than require new dedicated cables. Typically these Powerline adaptors are sold in pairs – one to be wired to the router and one to a remote device – but it’s possible to pair additional units. Indeed I currently have three units from two different manufacturers all interlinked:

  1. In my study connected to the router.
  2. In the lounge connected to the Apple TV.
  3. in the airing cupboard connected to the HEMS (as illustrated above).

The effect of this is to put the Apple TV on the wired ethernet with the result that the iPad (however connected to the internet) can reach it as can the external HomeKit WiFi bulb on 2.4 GHz. Similarly, with the Raspberry Pi hardwired, then the iPads can reach it regardless of their internet connection, rather than only when the iPad was also on 2.4 GHz.

The result seems to be a significant improvement in robustness and it didn’t even cost me anything as I had two pairs of Powerline adaptors already from prior projects.


Powerline adaptor

From back to front:

  • Mains socket incorporating USB power supply for Raspberry Pi HEMS
  • Black USB power lead to HEMS
  • Powerline adaptor connecting HEMS to Powerline network with mains socket
  • Yellow Cat 5 ethernet cable to HEMS
  • Mains plug with ‘Do not unplug’ label supplying power to HEMS-driven relays and RF Solutions Mainslink radio transmitter to car charger.

From top to bottom:

  • Raspberry Pi HEMS (black box) incorporating relay HAT
  • 10-way junction box (white box) typically employed for wiring central heating controls
  • RF Solutions Mainslink radio transmitter
  • immersun solar diverter
Raspberry Pi as HEMS
Smart controls – HEMS and immersun.

Payback time

It been over a year now since I last reviewed what return I was getting on my investment in energy smart technology – solar panels, battery storage etc – so I think an update is due. This time I’m going to take the input data from my immersun system – one year of data from start of June 2020 to end of May 2021.

Diverted – this is where the immersun sends any surplus solar electricity to my immersion heater to make hot water. In 2020/1 we diverted 1056.6 kWh to hot water saving gas at 2.82 p/kWh. However the gas boiler isn’t 100% efficient losing heat both via the flue to the outside world and also via the hot water pipes to the home rather than hot water. If we assume 80% efficiency at the tank then 2.82 p/kWh as gas at the boiler is 4 p/kWh as heat in the tank. 1056.6 kWh at 4 p/kWh saved £37.25.

Exported – this is where I’m unable to use the solar power that we generate and it overflows into the grid. I’m not paid for Export so this is worth nothing to me.

Generation – this is the energy that we generate in the solar panels. I’m on the UK’s legacy Feed-in Tariff (FiT) scheme which pays me to generate electricity. In 2020/1 I was paid 14.65 explicitly for every kWh that I generated. I also received deemed (rather than metered) Export which paid 5.5 p/kWh on 50% of the kWh that I generated (which is where the ‘deemed’ part comes from). 5.5 p/kWh on 50% is equivalent to 2.75 p/kWh on 100% of the Generation making my revenue 17.4 p/kWh per kWh generated or £693.51 on the 3985.7 kWh that I actually generated.

Imported and House – these are respectively the electricity that I buy from the grid and that which I used within the home including appliances and car charging, some of which will comes from my own solar panels. The difference between House and Imported is the electricity that I used from my solar panels which would otherwise have been bought from the grid. If I assume that each kWh that I use from my solar panels avoids buying a kWh of electricity from the grid at 16.36 p/kWh (current Energy Saving Trust value for the average UK electricity price) then I avoided buying £423.81 of electricity by using the output of my solar panels.

Diverted1056.5 kWh*£0.04=£37.25
Exported338.6 kWh*£0.00=£0.00
Generated3985.6 kWh*£0.17=£693.51
Imported4748.9 kWh*-£0.16=-£776.92
House7339.4 kWh*£0.16=£1,200.73
Total£1,154.56
Return on smart energy investment @ 16.36 p/kWh grid price

With an investment of £8,670, £1,154 represents 7.5 years to pay back the capital invested.

I’m actually on a smart tariff so my electricity cost in this period at 8.05 p/kWh was significantly less than the UK’s average 16.36 p/kWh. This lower price will arguably reduce the value of the energy generated by the solar panels for self-consumption, but equally the ability to maximize the value of a smart tariff is itself a saving.

Diverted1056.5 kWh*£0.04=£37.25
Exported338.6 kWh*£0.00=£0.00
Generated3985.6 kWh*£0.17=£693.51
Imported4748.9 kWh*-£0.08=-£382.29
House7339.4 kWh*£0.08=£590.82
Total£939.29
Return on smart energy investment @ 8.05 p/kWh grid price (excluding the tariff benefit itself)

Using my actual average energy price rather than the higher UK average grid price pushes down the return by over £200 (£929.29 versus £1,154.56). However the costs of buying the imported 4,748.9 kWh falls by £394.63 through the tariff benefit, increasing the annual return to £1,333.93, and reducing the payback period from 7.5 to 6.5 years.

Thus, had I invested in this technology at one time back five and a half years ago and shortly after we moved to this house, then we’d have been in sight of payback with 1 or 2 years left. In practice of course I’ve made the investments at different times (solar first five and half years ago, battery around a year later, smart tariff later still), so my payback will be achieved a little later.

A snapshot of the ImmerSUN diverting to hot water

Some other statistics:

  • Of solar panel output:
    • 91.5% replaced bought energy (self-consumption)
    • 65.0% replaced bought electricity
    • 26.5% replaced bought gas for water heating
    • 8.5% was exported to the grid
  • Of incoming electricity:
    • 54.4% was from the grid
    • 45.6% was from the solar panels (“green contribution” in ImmerSUN’s terminology)

Power(vault) to the people

It’s now around four and half years since I bought my Powervault G200 storage battery and two years since I started managing it from my Home Energy Management System (HEMS).

Originally the Powervault set up simply to store surplus electricity from my solar panels for later use but, following my change to Octopus’ Agile tariff, I started to use the Powervault to optimize electricity costs when there wasn’t going to be enough solar, charging when electricity was relatively cheap and discharging when electricity was relatively expensive. Initially I configured the Powervault manually to achieve this but later moved to the HEMS doing it automatically.

The fundamental principle has remained the same through both manual and automated periods, with the battery being set into one of three modes depending on price:

  1. Force charge – where the battery charges at full power (usually from the grid) for the required number of hours – when grid electricity price is cheapest.
  2. Only charge – when the battery charges proportionally to the solar surplus (but will not discharge) – when grid electricity is mid-price (i.e. too close to the price at which the battery was being force charged to be economically advantageous to discharge)
  3. Normal – when the battery charges or discharges proportionately to the solar surplus/shortfall – when grid electricity is comparatively expensive compared to the force charge price.
Battery operating mode for different conditions

The current logic now reflects electricity price, time of day and state of charge. The fundamental relationship is with grid electricity price as previously described, but with two further refinements:

  1. During the day, even when the electricity price is relatively high, the battery is held in charge only until 80% state of charge is obtained. This helps ensure that a high state of charge is obtained before the early evening peak in Agile prices from 4 to 7 PM by not allowing the battery to discharge while the expectation is that it is being charged from solar. In the depths of winter, when the battery is more likely to be charged overnight and thus start the day with a high state of charge, the same logic allows the battery to discharge to 80% if electricity is costly during the day but still preserves charge for the early evening peak.
  2. Similarly if the battery is full, but the grid price is medium, then the battery is also allowed to discharge to 95% during the day. This allows the battery to discharge slightly to cover small peaks of demand on the assumption that a small amount of solar recharge may well be possible even if the solar forecast wasn’t high enough for recharging at full power.

To consider the two bookends of behaviour:

  1. On a really sunny day like tomorrow, the HEMS doesn’t anticipate any need to buy electricity from the grid for battery charging so all electricity is relatively expensive. The HEMS will allow the battery to discharge overnight (completely if necessary) . From 8:00 AM the battery will only be allowed to charge until 80% state of charge or 4:00 PM is reached after which the battery will be put back in Normal operation when it has the freedom to either charge or discharge.
  2. On a winters day, the HEMS potentially fully charges the battery overnight. Between 8:00 AM and 4:00 PM the battery is allowed to discharge to 95% if grid electricity is mid-price (with some hope that the 5% may be recovered from solar), or to 80% if grid electricity is high price. After 4:00 PM the battery reverts to Normal operation for the evening peak period.
Example Agile prices with typical UK domestic consumption.

I’m very pleased with how robustly my battery integration operates. It is however reliant on the continuing availability of the Powervault G200 cloud which may not be around forever as the G200 model has now been superseded. My own example is currently four and a half years old.

Batteries not included

Recharge your batteries

We have a lot of batteries. The kids’ toys seem to use endless quantities of AA and AAA batteries plus many of my HomeKit smart devices including sensors and radiator valves are battery powered (typically AA or 1/2 AA). Over the last few years I’ve been replacing disposable batteries with rechargeable batteries to reduce waste. So far every device has worked successfully on rechargeable batteries (even when the manufacturer didn’t recommend them) although in some cases low battery warnings are triggered almost continuously since the Nickel Metal Hybrid (Ni-MH) rechargeable batteries are slightly lower voltage than regular disposable alkaline batteries (1.2 versus 1.5 Volts).

Common battery sizes

Last year I came across a Lithium AA battery that had potential to avoid such issues. Normally Lithium cells have voltages in the 3-4 Volts range, but these batteries have internal voltage regulation to reduce this down to 1.5 Volts. They need a special charger, but have the potential to eliminate the almost continuous low voltage messages.

EBL AA batteries and charger

I’ve now been using the first of these for six months. They have indeed eliminated the low battery messages. I still recharge the batteries at the end of every quarter regardless of whether I have a low battery warning or not. For the Ni-MH batteries they get replaced because the low battery warning is on most of the time anyway, while for the Lithiums I’m anticipating that the voltage may dramatically collapse not leaving time to change them after the low voltage warning is triggered. I now have three sets of eight which is enough for all my Eve Thermo smart radiator valves (eTRVs).

They are currently available via both Amazon and eBay, although Amazon seems to have the better prices whenever I’ve looked.

My sole criticism of these batteries is that they only seem to be available in sets with a charger, and not as just cells, so I now have three chargers.

I now have rechargeable Lithium cells for all my Eve Thermos (2 x 1.5V AA each) and Eve Door and Window sensors (1 x 3.7V 1/2 AA each). The Eve Room and Eve Motion sensors don’t seem to mind the lower voltage Ni-MH cells.

You can teach an old Watchdog new tricks

My home unusually uses HomeKit smart automation for central heating control among other things. One feature that I’ve not seen documented elsewhere is use of a watchdog to improve robustness of the automations. Many people of course will use HomeKit as a fancy remote control, but in my case HomeKit automations have an important role in heating control linking heat demand from rooms to enabling the boiler to provide heat. It’s thus important to me that this link works reliably. However in my experience sometimes changes in state can be missed leaving the boiler not running when it should be, or running when it shouldn’t be, an error which could last for hours.

Some two-and-a-half years ago I created a means to improve the robustness of such automations. My watchdog is a HomeKit smart plug which cycles on and off periodically. Two timers alternately turn the plug or or off every few minutes. The change of state of the watchdog is used as a second trigger for the rules in the automations causing the rules to be reevaluated every few minutes.

To illustrate what this achieves let’s imagine that the HomeKit ecosystem misses one trigger in ten or 10% of triggers. That would mean that one night in ten the boiler would fail to turn off when the last radiator valve closed, and would instead run all night. With the watchdog concept the rules are re-evaluated every few minutes, not just at the moment a valve closes. Thus, within a few minutes the rules are evaluated again and then ninety percent of the missed ten percent of events corrected – the error rate is now down to one percent from ten percent. A few minutes later the rules are evaluated a third time and ninety percent of the remaining one percent of errors corrected – the error rate is now a tenth of one percent or once in every thousand days. The risk of a continuing error state thus becomes vanishing small in minutes.

Previously the period of the cycle was five minutes i.e. the timer repeating an on/off cycle every five minutes. Five minutes was chosen as that’s the minimum cycle time available in the Eve app that I use to write rules. Today I realised that I could improve this significantly.

New HomeKit timers

The illustration above shows the new solution. Here I created 3 on and 3 off rules which each repeat every six minutes, which causes the state of the watchdog to change every minute..

  1. watchdog off (off rule #1)
  2. watchdog on (on rule #1)
  3. watchdog off (off rule #2)
  4. watchdog on (on rule #2)
  5. watchdog off (off rule #3)
  6. watchdog on (on rule #3)
  7. watchdog off (off rule #1).. and repeat indefinitely.

The illustration below shows a typical rule which turns off the watchdog and repeats every 6 minutes.

Example rule

The net result is that my watchdog smart plug now turns on every even minute and off every odd minute which I think provides the minimum possible delay before the system responds after any missed change of state.

Making smart choices – smart tariff smart comparison

Regular readers will know that I’m into smart electricity tariffs as a means to save money and deliver a greener lower carbon electricity grid. In the last 12 months we’ve paid an average 7.2 p/kWh for electricity when we weren’t using our own from our solar panels. However you’ll never find these tariffs on price comparison sites who will happily ignore smart tariffs while earning commission by switching you to a standard flat rate or Economy 7 tariff that makes little difference to your costs versus what you may already have been paying. I’ve thus been pleased to support a project to develop a tool to help choose between these smart tariffs which are completely ignored by the existing switching services and price comparison sites and apps.

The project is now testing its solution.

My usage and costs versus nearest rival tariff.

The system under final testing works in a completely different manner to the regular services. Rather than ask a few questions about consumption or costs, the new tool asks about smart meter details and then loads a year’s data indirectly from your smart meter. It thus knows precisely what electricity you consumed over the prior 12 months. The tool also asks about your flexibility to shift load to cheaper times in fairly simple percentage terms and then shows a range of tariffs (currently for testing real tariffs with false names) and their average monthly costs. You can overlay the costs of each alternative tariff in turn over your existing costs. You can see that, even with maximum flexibility, I’d have paid an extra £116 annually on the nearest tariff to my existing tariff.

You can find the demonstration system here https://smarttariffsmartcomparison.org/

Charging onwards

I’ve recently had the opportunity through my day job to make a lot of use of an electric car that was not my own. However this presented the inconvenience that I couldn’t charge it on my own home wallbox in the garage since my wallbox has the older Type 1 5-pin connector to suit my own car, but the borrowed car has the more modern Type 2 7-pin connector. If you were buying a wallbox the obvious solution to charging vehicles of both types is a wallbox with a Type 2 socket, however I didn’t want to go down the new wallbox route as I wanted to retain my existing smart controls.

I couldn’t add a socket to my existing wallbox due to packaging constraints (where would I install the socket) and my unsuitable protocol controller (protocol controllers for socketed wallboxes are more complex as they need to decode cable current rating and operate a solenoid). Thus I decided to go down the two outlet cables route as the lowest cost solution given that I already had the cable. My outlay was limited to a relay to switch the power to the second cable, and a switch to decide which cable to use. Use of two relays ensures that only one outlet is live at a time, as there would be a risk of touching the exposed contacts of whichever cable was not in use.


Double Pole Double Throw (DPDT) switch with terminals.

The switch sits between the protocol controller and the relays. One side of the switch directs the relay output of the protocol controller to enable either the original relay for the Type 1 connector or the new relay for the Type 2 connector, while the second side of the switch connects the corresponding control pilot to the protocol controller. The control pilot handles the communication with the vehicle for things like current limits and handshakes.

Comparison of charger block diagrams

The open/closed status of each relay is also fed back to the Programmable Logic Controller (PLC) that sets the variable maximum current limit (off, 6, 10 or 16 Amps). The PLC had plenty of spare inputs for the connection to the new relay. Some small software changes were required so that the PLC respond to inputs from both relays (generally either relay #1 or relay #2 is on, or both relay #1 and relay #2 are off).

Updated wallbox with second relay to far right and second exit cable to right lower.

From left to right:

  • 2 slots – double pole isolation switch
  • 4 slots – Programmable Logic Controller (PLC)
  • 2 slots – protocol controller
  • 1 slot – original relay for Type 1 / J1772 connector and cable
  • 1 slot – new relay for Type 2 connector and cable
  • in side panel – DPDT switch

The resulting wallbox has demonstrated its capability to charge vehicles with either Type 1 or Type 2 inlets, responding to tariff-based on/off signals from my HEMS or surplus solar signals from my ImmerSUN.

Current clamps

Main electricity supply cutout with current clamp above

As previously noted, I recently had the main supply cut-out to my house uprated from 60 to 100 Amps in preparation for installation of an additional electric vehicle charger. That involved my Distribution Network Operator (DNO) replacing the fuse within the black fuse holder with the torn red label above and replacing the brown live and blue neutral cables between the cutout and the electricity meter to the top right of the picture. In my case the technicians involved automatically moved the black current clamp that sits above the cutout from the old live cable to the new one without even mentioning it, but it did occur to me that it would be worth documenting what current clamps I have, what they do and where they are for the benefit of any future trades who may not replace like-for-like.

I have two devices that currently use three current clamps between them:

  1. Immersun. Has two current clamps, one for control and one for solar generation data only.
    1. Immersun control clamp is around the main live feed between cutout and meter as pictured above and illustrated below. It measures any flow of electricity to the grid and prompts the Immersun to divert this to water heating or car charging.
    2. Immersun generation clamp is around the main live feed between the inverter for the solar panels and consumer unit and specifically inside the rotary isolator on this cable (being a good location where the live alone can be encircled without the neutral).
  2. Powervault battery. Has 1 current clamp inside the consumer unit which encircles both the incoming live and the live feed to the immersion heater. These two cables are orientated such that flow from the solar panels to the grid or to the immersion heater passes in the same direction through the clamp as illustrated below. (This is unorthodox and not what the installation manual describes, but is done to force the priority of the battery over the immersun when a solar surplus is available)
Positions of 2 of 3 current clamps.

There were previously three additional current clamps which were used by UK Power Networks (UKPN) my local DNO who part-funded my battery storage four years ago as part of a trial. Some of these clamps may still be present as I can still see some of the associated cables, but are no longer actively used as the associated data loggers are long gone. These clamps monitored: grid in/out (duplicates 1.1 above), battery in/out (duplicates battery’s own internal measurements), and solar panel in/out (duplicates 1.2 above).

DNOs tend to be concerned about excessive exports to local electricity grids which can cause voltage quality issues. Any export from a battery could add to any export from solar panels and could cause the DNOs preferred export limit to be exceeded. Given that the battery, as installed to the manufacturer’s advice, would measure the total export then it would be possible software within a battery to limit battery export such that the sum of battery plus solar export never exceeded the DNO’s recommended value. In practice the gross output of a 4 kWp solar array rarely exceeds the 16 Amp export limit even before the load of the home is subtracted to achieve the export from the home, so in many battery + solar installations there’s little prospect of the limit ever being exceeded even without such software limits.

The question that recently occurred to me is whether if a battery had such a software limit would that limit be defeated by my unorthodox installation of the battery’s current clamp?

Conceptual arrangement of clamps

My physical arrangement on the battery clamp encircling both the feed to the consumer unit and the cable to the immersion heater is equivalent to feeding the immersion heater from a connection between the meter and the consumer unit and having the clamp between that connection and the consumer unit. As such the battery clamp may read higher than the actual export since some of the power from the solar panels that is measured by the clamp may be diverted to the immersion heater without actually being exported. Thus, if the battery has a software function to limit to export, an arrangement like mine will cause the export limit to operate more aggressively than design intent and the DNO’s export recommendation will not be exceeded. Once the water is hot, and no further diversion occurs, then a battery clamp positioned like mine will record the same current as the meter and the Immersun’s clamp. Since I regard export as an error state then such a more aggressive limit on export is of no consequence to me.

The power of mesh

Two recent manufacturers’ announcements indicate that shortly the Apple HomekIt smart home ecosystem could be getting even more robust. The announcements concern threading which creates a mesh between smart home devices. Apple have announced that the HomePod mini smart speaker will be their first device with threading capability, while Eve have announced that an imminent software update will add this capability to both Eve Door and Window and Eve Energy devices (of which we have six in total now).

The way the ecosystem currently works is that the hubs (of which we have two, both Apple TVs) communicate to each other via WiFi (or potentially wired Ethernet, both in orange) while my many smart home devices typically communicate with the nearest hub by Bluetooth (in dark green). This arrangement works well while both hubs are online, but if occasionally a hub is having issues then some devices are out-of-reach until the functionality of the hub is restored as Bluetooth struggles with the range.

However the new threading capability allows some Bluetooth devices to form a mesh (in cyan) where messages can can be passed by multiple routes from one thread-enabled smart home device to another and not just directly to and from hubs. Non-threading Bluetooth devices can then communicate to a nearby thread-enabled device (rather than a comparatively distant hub) and their messages have multiple alternative paths via the thread-enabled devices to eventually reach a hub.

BLE devices communicating to HomePod Mini hub via thread-enabled devices.

I had previously considered the Eve Extend as device capable of extending coverage to distant Bluetooth devices, but I see threading as much more attractive for me as follows:

  1. Eve Extend is configured to relay signals from a predefined set of devices (which threading does not require pre-definition),
  2. Eve Extend only covers some devices and in particular not my first-generation Eve Thermos (while threading supports any device, although only a limited range of devices form part of the mesh), and
  3. Eve Extend device allocation is fixed (so if the Extend goes down the connection goes down) but threading is dynamic, so if a threaded device goes offline (such as due to a flat battery) then an alternative path may be found via other devices in the mesh.

Eve Extend does however work differently in that it sits between BLE devices and WiFi and could thus extended coverage over a greater distance since WiFi carries further than BLE.

No fuss fuse

As we look to install a second electric vehicle charger that becomes a challenge for the electrical supply to our home which is limited to 60 Amps. I recently saw a page online by which our DNO (District Network Operator) – UKPN – could be requested to install an uprated fuse.

(Some readers may be curious regarding the irregular size of the hole around the cutout and meter. When we looked around the house I recall reflecting upon the fact that I didn’t know where the meters and consumer unit were. The mystery was explained when we moved in and these items were found to be behind a false wall in what is now my study having previously been concealed by pictures. We continued the practice by buying pictures to conceal three holes in the wall (now four) covering: electricity meter, gas meter and consumer unit (adding generation meter and isolator for solar panels).)

I’m delighted to report how smoothly the change went. I was advised that it might be the case that the work could not proceed on a first visit, and that it might be necessary for my electricity supplier to update meter and/or cables from meter to consumer unit; but the installation proceeded on the first visit with not only the cutout changed from 60 to 100 Amps but also the cables between the cutout and the meter renewed. All of this at a price of precisely nothing.

I had been reasonably confident in the meter as that had been renewed almost exactly two years ago when we moved from Economy 7 to a smart tariff, but I was less clear about the cables between the meter and the consumer unit. In the event all was fine.

The extra 40 Amps should now mean that I have no issues adding a 7.4 kW car charger which draws 32 Amps. I have previously posted about the new car charger. My task of writing the software for it is now considerably simplified as I shouldn’t need to worry about managing the after diversity maximum demand of the house to not exceed 60 Amps, and can concentrate on the other smart controls – tracking my solar surplus and responding to the smart tariff.