Author Archives: Greening Me

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.

Eve Thermo Versions 1 and 2 compared

We currently have eight Eve Thermo electronic thermostatic radiator valves (eTRVs) in service. These valves allow us to set heating schedules and target temperatures for rooms individually, for example don’t heat the lounge of weekdays before the evening or don’t heat the playroom after the children’s bedtime. All the existing valves are the original version.

However I’ve just bought two more valves with a view to expanding control to the bathroom and ensuite. I want to add these rooms as they tend to be rooms where the windows are left open (allowing heat to escape) and the ensuite in particular is often too hot and difficult to it’s difficult to regulate the temperature as it’s immediately above the boiler. These new valves are the second generation. So what are the differences between versions?

The two versions are very similar if not the same size. The most obvious difference is that the new version has a small display and buttons allowing the temperature to be adjusted. A setup item allows the orientation of the display to be adjusted so that the temperature display is the preferred way up. The display illuminates briefly when the buttons are used to adjust the temperature.

However there are other small differences:

  1. Vacation mode. The older version has a vacation mode for winter vacations when the schedule is disabled, but heating will be enabled below the lower temperature set point. The newer version doesn’t seem to have this mode, so my existing vacation scene sets these individually: mode = on, schedule = off, temperature = 10 Celsius to achieve the same result.
  2. Lower temperature set point. In the older version the minimum possible scheduled temperature stored in a valve was 10 degrees, but a scene could set a lower temperature down to 5 degrees. I use this facility overnight to stop a rarely-used room pulling on the heating overnight in winter while still providing frost protection. However the newer version seems to have a common minimum temperature of 10 degrees. I have thus modified and renamed a scene that previously explicitly set 5 degrees to set minimum temperature, that is either 5 or 10 degrees according to valve generation.

I plan to install my two new valves in the lounge which has two radiators, and use the displaced older valves in the bathroom and ensuite.

After installation we’re now up to 10 eTRVs divided between 8 rooms (bathroom, cloakroom, daughter’s bedroom, ensuite, lounge x2, master bedroom x 2, playroom and wife’s study). Most of these rooms have individual schedules; while bathroom, cloakroom and ensuite heating is on when any other room heating is on. The latter also have window sensors and are disabled while the window is open, while the lounge also has a movement sensor which curtails heating in the evening if no movement is detected (which otherwise provides heating for my wife’s late film viewing).

Valve position for the ensuite eTRV.

The image above shows the operation of the eTRV in the ensuite which was previously the room with the greatest difficulty in maintaining an appropriate temperature – often being too hot as almost directly above the boiler. Here we can see brief morning openings and much longer evening openings on weekdays, and heating all day on Saturday. In all cases the valve initially opens wide (60-80%) to warm the room up, and then gradually closes over time until the temperature is maintained with a relatively small opening (~10%).

The system has several modes:

  1. Summer – which provides temperature monitoring, but no control.
  2. Vacation – which provides minimum temperature control, but no schedules.
  3. Winter – which provides temperature scheduling with two schedules available – one for working days and one for non-working days (not necessarily weekdays and weekends) selected from a standard Apple calendar.

Automations in HomeKit

Last night I was refining some of my HomeKit automations (rules) and it occurred to me that it might be an idea to capture some tips from the last few years.

HomeKit versus HEMS functions

I currently have around 30 automations delivering:

  • Space heating – 8 eTRVs / smart valves linked to a smart plug for boiler control and both movement and window sensors.
  • Window management – 4 window sensors and a movement sensor indicating via colours smart bulb when windows are left open (typically checked prior to leaving the house)
  • Lighting control – dusk-to-dawn lighting with colour-override by window management.
  • Watchdog – robustness aid.
  • Wet goods – control and dishwasher and washing machine in conjunction with HEMS.

In total I currently have:

  • 8 smart radiator valves (eTRVs)
  • 6 smart plugs
  • 4 door / window sensors
  • 3 smart bulbs (two coloured + 1 on/off)
  • 2 movement sensors
  • 1 environment sensor (temperature, humidity, air quality)

So, what are my tips:

It Is much more intuitive to write rules in the Eve app.

  • The free Eve app can pretty much do everything that Apple’s own Home app can do for HomeKit devices (not just Eve’s own devices). The construction of rules in the form: IF {any of one of more triggers} AND {all of none or more conditions} THEN {set one of more scenes} is very intuitive in the Eve app.
  • Eve also allows rules to be names, whereas Apple’s own Home app sets names to a trigger condition, so if you have many rules as I do with common triggers then you end up with a confusing list of rules with duplicates names which need to be opened to tell one from another.
A rule in the Eve app.

Comparison with conventional logic. Simple IF rules are very straightforward: IF {any of one or more triggers} THEN {set one or more rules}, however AND rules take a bit more thought: IF {list of AND conditions} AND {same list of AND conditions} THEN {set one or more scenes}.

A watchdog makes execution more robust. HomeKit rules are triggered by changes of state such as going from open to closed or from movement to no movement, but if some some reason a trigger is missed you may have the wrong scene set for hours. My watchdog rechecks rules every 5 minutes as described here.

AND rules. AND rules may be converted to use the watchdog principle by simply adding an additional trigger to reference the change of state of the smart plug used for the watchdog: IF {original list of AND conditions + new smart plug trigger} AND {original list of AND conditions} THEN {set one or more scenes}.

Simple IF rules. IF rules with single triggers are easily converted. The same principle applies to AND rules: If {original single trigger + new smart plug trigger} AND {original single trigger} THEN {set one or more scenes}.

Complex IF rules. IF rules with multiple triggers are more involved to convert to the watchdog principle. If you just add the smart plug to the trigger list as per the earlier AND paragraph then the rule triggers every time the smart plug cycles. If you were to add the other triggers to the conditions list then the rule would become an AND not an OR. Instead to convert an IF with multiple triggers then it needs to be converted to multiple rules – one for each original trigger condition – all driving the same scene. Each of the new rules is an IF with a single trigger as per the earlier paragraph. The existence of multiple rules setting the same scene(s) creates a multiple-trigger IF.

Multiple hubs. Having multiple hubs (in my case two Apple TV’s) can make the system more robust both during occasional software updates (it’s improbable that both will update simultaneously) but also by extending Bluetooth robustness (hubs commonly communicate to devices by Bluetooth but between each other by WiFi). Obviously the hubs need to be placed in different parts of the home. (Eve Extend can also be used to reach out-of-range Bluetooth devices over wifi, but isn’t compatible with my older 2015 Eve Thermo eTRVs.)