Putting in Automation in my Bathroom in the UK

 


For those of you outside the UK, and probably the rest of Europe, you may be wondering what the big deal is. Well we have pretty strong regulations about switches, power sockets, and proximity to water. So it does make it a tad difficult.

So, first of all, the pine paneling is not my taste and it will, one day, disappear. However, I need to work with what I bought when I got the house.

Initially, I just had an isolation switch and the heater, that you can see on the left, and the heater switch was actually broken so it was permanently on and it was turned on/off by the isolation switch.

There is a pull switch as you walk in, but I have a Nanoleaf bulb in the ceiling, so we don't use it.... but it is a pain to keep telling Siri, that was in another room, to turn on the bathroom ceiling light.

So, requirements for the bathroom were:

  1. Fix the heater so that it is "smart"
  2. Add a socket so I can power a HomePod mini
  3. Add a presence detector, so I needed USB.
  4. Make it look a little nicer.

Adding the power and staying within the law.


The bathroom is split up into zones, by the UK law.

by the time you get more than 0.6m (That's about 2ft) away from water source you are allowed to have a specially designed shaver socket that can normally do at least 110v, but also 230v. These have to confirm to a British Standard.

I also needed a USB socket. I must admit, I couldn't find anything in the standards about USB, but the voltage is so low that I could not see it being an issue.

If you've been following my blog, you will know that I've decided to default to Legrand Arteor range through out the house as most, not all of it, connects in via their gateway and gives me HomeKit access.

In this case, nothing actually works directly with HomeKit. However, it does fit with the whole modular capability of Legrand Arteor. Having said that, to get the isolation switch and the USB module in the same 2-gang back box, I had to trim them, and their covers down a little. So the drummer game out, and I think it looks OK.

The Shaver socket fitted directly into the 2 gang back box.

The USB-A cable you can see goes off to the Aqara FP-2 presence sensor I have installed at the end of the bathroom.

Powering the HomePod mini.

Fortunately, the HomePod mini is dual voltage and has a USB-C cable. So what I needed was a US spec power supply for a HomePod mini. Fortunately, as I had come back from the USA recently, I had my original spec power supplies, but I must admit I didn't like how they stuck out. So, you can see in the original picture that I ended up using a 3rd party supply that was a bit neater.


This goes into the 120V side of the shaver outlet, and has a USB-C port on the top. It has enough output power for the HomePod mini.

Mounting the HomePod.



I just went searching on Amazon. I wanted a holder with "cable management" (I do think it is really an overly used term , but it seems to be standard. I found the PlusACC Wall Mount for a reasonable price. It seems to work well at the moment.

I should say that the HomePod does not have any IP rating. However, from experience I know it lasts well in the bathroom as we had one in our bathroom in the USA, and it it still operating in our house.

Making the Heater "Smart"


This is actually inside the heater.

I initially took it apart to see if I could fix the pull chord switch, to discover that the issue was that a pivoting piece of plastic was actually broken. The previous owner had, unsuccessfully tried to fix it, but had used the wrong type of glue and it had broken again. I did manage to fix it and all it did was push a pop in/out type switch. So pull it once, and it pushes the switch in, pull it again and it pushed the switch which would then pop out.

Whilst I was in there, though, I could see that the power just went to a junction box at the top of the heater.... so this meant that I could put a smart relay in between. Initially I looked at using part of an Ever smart switch, but the part that needed to go in here was too big, so I used a Shelly Plus 1PM and refreshed it using the Mongoose HomeKit software. I've explained how to do that in an earlier blog post

You can see it as a red box at the top of the heater. I did want to use the Shelly Plus 1 mini, but it isn't possible to flash this at the moment.

Shelly have committed to supporting Matter at some point and when/if they do, I'll refresh it back to standard OS and use the Matter integration.


With the firmware, you can control the settings via a web server. I have put a difficult password on the relay and I highly recommend you should do that too. You can see here that I've set it up as a Switch type for HomeKit and, for good measure, you can see the button which I can press to revert the relay back to stock firmware when I wish.




When you add the relay to HomeKit, you can see it is an uncertified device, just add it anyway, and it appears as a switch. Because it appears as a switch, you get an option as to if you want it as a switch, light or fan. I chose fan and you can see it showing in the Home app as a fan called "Bathroom Heater".

Presence Detection.


Again, for those that have been following this blog, you'll know that I have been using Hiome as my presence detector. Unfortunately, the supply chain crisis created by the Covid pandemic wasn't kind to them, and they've stopped trading. Fortunately, for me, Aqara came out with the FP2 about the same time, and so I was an early adopter of the FP2.

If you are interested in the FP2, you can purchase through Amazon, but I have found that it is slightly lower cost if you go to the UK distributor, Smart-Secure.

I must admit, I've been using the FP2 for a few months now, and I've been reticent to recommend it as I did find that it was a bit too hit and miss in the early days of its release. Now, however, since the latest firmware release (1.2.2) it has got much better. Basically, it seems to have got rid of the Ghosting issues I had, where the FP2 would think there was someone there when there was not.

My implementation in the bathroom was very simple, so I've actually done a seperate write up of the FP2 in a more complex room, my kitchen diner, so you can get all the power of the device.

However, what I will say is that I still find the Hiome quicker to react than the FP2 and Hiome does work well in my house, which is made up of many small rooms. However, it doesn't work well in Open Plan and in areas like stairs and hall ways, and the FP2 is much better. I will be retiring my Hiome set up and moving to the Aqara FP2, seeing as Hiome are no longer :-(

FP2 setup.

A more detailed setup of an FP2 will follow in my next post, so I'll just provide the core narrative here. However, if you want to read, what I think, is a good review of the FP2, check out this article at Homekit News. As the firmware has been significantly updated since the article was written, it is a little dated, but it is still pretty accurate on features.

The FP2 connects to Apple Home via WiFi. You have to set it up in the Aqara App, not just for firmware updates but to actually set it up so you don't get ghosts and to get full flexibility of the product. My Bathroom was quite simple, but it still requires a little bit of work.

The first thing it asks you to do is to enable it to work out the bounds of the room, so it knows where to perceive. My Bathroom is quite small and rectangular, and that was a very quick exercise.

This will then give you an outline of the room. You can then place objects in the room. This is particularly useful when you have larger rooms and you want to use the multi-zone capability.

Finally, you exit the room and you use an AI capability so that the FP2 knows what the room is like when it's empty. I've had "fun" with this with our cats who seem to have an unnerving ability to sense when I'm trying to do this part of the set up.

What you end up with is this:


In the Aqara app, you can mostly see the layout of my bathroom. The app provides icons to place. Interestingly, there is not an icon for a sink or a bidet. The placement of the door is important, as the FP2 will now know where people will enter and exit.

It appears in HomeKit as an occupancy sensor and a light sensor. You can see the automations I have already created. Basically, when the room is occupied, turn on the light. When it isn't occupied, turn off the light. 

Automations:

Life, though, is not that easy. You don't want the light to always come on, because when it's full daylight, then it is a waste of energy and, with my bathroom window being south facing in the northern hemisphere, when the sun is out the light's very bright.

Also, in the middle of the night, if you need to use the bathroom, you don't want to be blinded by 100% brightness of the bulb/globe.

Let's take the easy one first: When the room is not occupied, turn off the light. you can run this automation all the time, as if the light isn't on, it doesn't matter if you tell it to turn off. You really do not have to put any conditions on it.



And this is the automation. Very simple.

It does take about 30 seconds to turn off the light. I assume this is because the FP2 really wants to make sure that the room is empty. This is one of the areas where the Home is superior as it counts people walking in and out, so it knows when the room is empty and reaction is immediate.

Now to the more complex automations, when to turn on the light.

What I need to do is the following:

If the time of day is between 30 minutes after sun rise and 11pm and if the lux value is less than 60, turn on the ceiling light to 100%. Otherwise, if the time is between 11pm and 30 minutes after sunrise, turn on the light to 50%.

Sounds simple, but you can't do it so easily in the Apple Home app.

Initially, I did it in a Home Shortcut. It worked, but to do it the shortcut had to find out what time sunrise was, which meant going out to the internet and that causes delays, especially where I live as "fast" Internet is effectively 40Mbs. Indeed, I was finding that the light would not switch on for about 10 seconds and I'd obviously be well into the room.

Essentially, the original solution set up the occupancy sensor in the bathroom so that whenever anyone walked in and the lux value was less than 60, it would run the shortcut that did the following:

    Get the current time.
    Get Sunrise time.
    If current time was greater than sun rise time
        If current time was less than 23:00
            turn on the light to 100%
        else
            turn on light to 50%
        endif
    else
        turn on light to 50%
    endif 

I've often found that not running shortcuts and doing automations in the Apple Home framework is quicker. So what I did was to replicate that logic and create 2 seperate automations. Unfortunately, you can do that in Apple Home, and so I reverted to using Home+, which  gives you extra capabilities not exposed in the Apple Home app such as the ability to mix sunrise and an actual time as well as multiple conditions.


This automation essentially says:

When occupancy is detected in the bathroom
If the time is between sunrise + 30 minutes and 11pm
AND the current light level is less than or equal to 60 lux
Control some accessories.

What Home+ does, though, is create a scene rather than controlling the accessories directly. Personally, I don't like that as I now get lots of scenes when I don't really need them. That's not the fault of Home+, it is a limitation caused by Apple not making it possible.

So, then I go back to the Apple Home app, replace the scene with controlling the devices directly and delete the unwanted scene.


and now you can see what it looks like in the Apple Home app. In my case it is still doing a short cut, as this is a left over from when I had the shortcut I described earlier. Still, this works in 3 to 4 seconds, which is ok. I do think I'll copy the automation, and get it to control the accessory directly where it will be quicker.

<Update 1st November 2023>
I indeed did copy the automation and remove the shortcut to drive the accessory directly, and now the light turns on within 1 second.
<Update end>

Obviously, I have a similar automation for between 23:00 and Sunrise + 30 mins. This time, though, it does not have to detect the lux value as it is night time. We know it'll be dark.



Comments