I want a coffee in the morning....

<Updated 8th April 2024 as Switchbot bots are useful via Matter.>

I grew up in the UK, where coffee was just terrible. It was the 2nd worst coffee in the western world! (If there are any American's reading this, please do not ask me whose is the worst). Then I went to Australia, and discovered fantastic coffee, as the Aussies have been heavily influenced by the Italians, Lebanese and Greeks. I was in coffee heaven. This has meant, on my return to the UK, that I must now have at least one good cup of coffee a day... and this means I must have my own Espresso machine.

This was going to require a very special Espresso machine though. I wanted an automated one..... until I started looking at how much that was going to cost me. They are eye-waveringly expensive. So, I scaled my ambitions back a bit.

I needed a nice coffee machine that could: 

  • work with button presses. 
  • be able to produce 2 double espresso's at the same time
  • have a flat surface near the buttons, and 
  • must have reasonable coffee bean and water reservoirs. 
Enter the De'Longhi Magnifica S coffee maker .


OK, it's not cheap..... but it isn't eye-wateringly expensive either!

So, great! Now I've removed some of the "work" from making a cup of coffee. But I want it waiting for me when I walk down in the morning.

Now enter the SwitchBot Bot . A Nifty little device that has a little finger that pops out and can press buttons for you. When I bought mine they were only available in White, but now you can get them in black.... I subsequently bought some black ones, and have re-used the white ones elsewhere!

I initially needed 2 of these. One to Press the On button, and another to press the Double Espresso button. And that's the reason for the flat area... so be able to stick the Bots onto the fascia.


Now you can see why I wished I had black!

The top one does the on/off

The lower one hits the double espresso button.

I later realised I needed 3, which is one to push the "Steam" button, which is the top right hand side.

Brilliant! Except these little beauties only talk Bluetooth to my phone, which is as much use as chocolate coffee pot!

I need the SwitchBot mini hub .

This does many things, but one thing it does is provide a WiFi hub for the Bluetooth mesh created by the various SwitchBot devices, of which I have more. I'm actually amazed how far the signal goes, as I have the hub in a completely different room.

Adding the bots was quite easy. I just had to bring them near to the hub, and they self register. All I had to do then was name them and, optionally, put them in a Room.

I could now remotely control the buttons. It's all getting better.

Of course, if you are reading this you know that this blog is all about HomeKit, and that is an absolute requirement for me. No HomeKit support, I'm just not buying it. Unfortunately, SwitchBot did not have HomeKit support. Well, not directly. They built a Homebridge Plugin. Yippee! Superb! 

Switchbot now has Matter support via the Hub 2. The Matter support worked well for curtains, but initially not so well for the bots as they advertised them as light switches and so I continued to us the Homebridge plugin.

However, as of early April 2024, Switchbot have released V2.x of the Hub 2 firmware and this has now changed bots to be plugs. Again, not exactly what I wanted, but better than lights. Why can't they just show them as switches? 

V2 of the firmware also effectively increases the number of devices supported to 8, which now enables me to cover all of my external to the hub devices... but now means I can't show the temperature and humidity sensors as I break the 8 limit. Not a major issue for me, as the hub sits in my understairs cupboard.

These two features have enabled me to finally retire the Switchbot plugin for Homebridge, all be it with some workarounds.

Configuration

You need a SwitchBot hub. I originally bought a Mini but I now have a Hub 2, which can also do IR. I've not used the IR capability as the hub is sat in the under stairs cupboard, and all my IR devices  are already connected to HomeKit, either directly or via Homebridge.

Hardware Configuration

Adding the Bots

Initially this is very easy. You remove the battery tab from the bot, so it powers up, then you open the SwitchBot app, and here you can see the two bots I have already added. Then you press the "+" in the top right hand corner, and you see the Switchbot devices yet to be configured, and you press the icon for the bot.

This takes you to another screen, where you see the bot. In my case, it was defined as "Bot 63". Select that and you are sent to the Initial Setup screen where you name the bot, and place it in a room. I called mine "Steam" and put it in the kitchen. Once you have done that, the bot is configured.

You will probably have to also upgrade the Firmware, you do this by going into "Firmware & Battery", and then select "Firmware Version". It will then go through a few screens where it warns you not to disconnect, and then you'll get quite a rapid upgrade. In this example, I went from V4.9 to V6.2.


Now you can attach your Bot. On the bottom is a 3M sticker. Peel of the protective covers and press onto the device, fairly close to where you want the bot's finger to press down. In this case, it's right beside the button on the coffee machine.


The Buttons on the coffee machine are stateless. They do not have an on/off. You just press them and they operate a part of the machine. Even on/off is basically stateless as if you leave it on long enough, it will turn itself off. As I may be doing more than one or two coffees, this is how I have to leave it.

The Switchbot bot, though, doesn't have a stateless switch mode though, as it is designed to switch on and off a device. But it does have something close, which is "switch mode". This is really designed for paddle switches, often referred to as Decora in the USA. And, under normal situations, it would still turn off. However, if I don't connect it to the switch, the "off mode" doesn't do anything.

To do this, you go into settings on the Bot, and then select Mode, which take you into "Mode Settings", and again select "mode". This will give you 3 options, and you need to select "Switch Mode" as shown below.


Integration of bot with Apple Home via Matter.

If you want to know how to add the SwitchBot Hub 2 to Matter, take a look at a previous blog post on adding the Hub 2.

When your hub is setup, go into "settings" for the Switchbot Hub, and you can see "Matter Setup (Beta)."

You literally press the plus button next to the devices you want in Matter, and the minus button for those you do not. Below you can see the bots, curtain motors and a light strip I have added.


The bot will appear where the bridge is located and will be called "Matter 1,x", where x is a number. When you add a number of accessories that are the same, it does rather make it hard to work out which is which, so I do them one at a time.  I then moved the accessories to a special room I created called "Kitchen Appliances" in HomeKit and removed them from Favourites as these are really used for automation only.




I can now tell Siri to "Turn on <bot name>"

To be fair, I could also do that by Siri Shortcuts, from the native app, as it is one of the options under "Cloud Services". However, now it is in Apple Home, I can use those switches in Automations.

Adding to Personal Automation for my morning routine.

I added making a coffee in the morning to my morning routine, described in a previous post.

If I expand the section where it works out if I'm at home or not, it then Turned on the Coffee Machine, waited  for 50 secs, and then turns on Double Espresso. For me, that's enough time to get down stairs. If I then wanted a Flat White or a Latte, I'd tell Siri to turn on the Steam whilst I walk to the fridge to get the milk. By the time I'm back at the coffee machine, the Steam is ready to use.


However, what I failed to appreciate is that the coffee machine cleans itself every time it turns on, or off, and so I could not have it pouring the Double Espresso as that would now contain water from the cleaning and the coffee.

I needed someway to get the coffee cup under the dispenser after the machine had cleaned itself. This, obviously meant some kind of robotic movement. Not only that, but it had to be adjustable. Am I doing one Double Espresso, or two of them?

Let's get some movement going.

I needed a robot to only go in one direction. As the spout for the milk is on the left hand side, it was from right to left and back again. I did not need back and forth. There is a robot in Apple Home that does this, and it is a curtain motor. I decided to use the Switchbot Curtain. Somehow, I'd attach a tray to it, and then this tray needs to glide along and be able to deliver either 1 or 2 coffees.

Hmm, not so simple.

The Robot

I chose the I-rail version of the Switchbot curtain motor. Due to timing, I ordered the V2 as, at the time of writing, there is no I-Rail version for the V3 motors.


I selected the I-Rail as it actual gave me something very similar to a rail and gave me the ability to use something less bulky than a pole which meant I could get closer to the coffee machine as well as use less bench space.

The Tray

The Tray had to be wide enough to take too coffee cups, but not too wide as its overhang at the end would be too large. It also had to be deep enough, and the edges had to ramp up quickly, as the tray needs to run very close to the actual coffee machine itself, and the coffee dispensers do not stick out too far.

In the end, my choice was the small version of the Dalebrook L289. The size was just about correct.

Making the items movable.

The I-Rail I purchased came with the wheels to attach to curtains to run along the rail. It came with more than I needed in both length of rail, but also in terms of the wheels.

Initially, I put two sets of wheels underneath the tray on one side, and underneath the robotic motor so both would travel smoothly.



The orientation of the robot is important as there is a charge port for the robot, and this needs to be on the top so you can recharge the robot without having to dismantle everything.

The Wheel Rails

The wheels on the tray now need rails that expand beyond the ends of the drip tray, on both sides.

This led to a weird looking box.


The wood at the back is for the wheels on the bottom of the tray to run along. On the left hand side, it provided just the extra length needed to enable the tray to go far enough along to be able to deliver for 2 coffee's.

Attaching the Tray to the Robot.

Because of the height of the tray caused by the wheels, and the height of the back of the robot above the I-Rail, we needed to fill that space and use that attachment to connect the tray and the robot.

I glued, using Gorilla Glue, a piece of wood to the top of the robot and then the tray to the wood.



Test Run.

At the time, the only Apple Home support for Switchbot was via Homebridge. I had added the curtain robot to Apple Home and called it "Coffee Tray".

I did a couple of test runs, but I found a few issues.

I couldn't make it reliable. As the wheels were running over the drip tray, they would drop into the holes on the drip tray and made it a very rough ride. This caused stress on where I'd had to use glue. This was the biggest issue, as it ended up causing the device to fall apart.

Putting wheels on the bottom of the robot had tipped it upwards, and made that connection between the tray and the robot less than reliable. That was easy to resolve, I just removed the wheels, and the robot slides over the counter easily.

The Wheels went right to the end on the left hand side, making me a little uncomfortable.

I wasn't moving far enough along on the right hand side to go past the water container, as I need to slide it out to refill it.

Re-Think

I must admit, I was initially a little despondent. I couldn't see a way out. I was so close, but it just was not reliable. I left it for a few months, with it half built and annoying me every day when I made my coffee.

In December of 2023, I went back to Australia to spend time with my Daughter and Granddaughter, and I spent some time playing with Lego.

On my return to the UK, in January 2024, I was re-looking at the problem and I decided to remove the robot from Homebridge, and to re-add it via the SwitchBot Matter integration, which I covered in another post.

I also realised I could use Lego to solve the smooth traveling for wheels over the drip tray, by putting them on rails, and also to build the connection between the top of the robot and the tray.

Lego Wheels on the bottom of the Tray. 

There are two sizes of Lego train wheels, I obviously needed the small ones, and I needed to build two bogies to go on the bottom of the tray. I also needed 5 lengths of straight track with plastic rails. I also needed small flat parts to strengthen the rails connecting to each other to remove any flex. All parts were bought from eBay, where you can find practically everything you want.


Building the connector between the Robot and the Tray

I also build a connector between the top of the robot, and the tray. The top of this connector was to be smooth. It was glued on to the top of the robot, but I used 3M double sided tape to connect the tray to the connector as this gave me a very smooth connection which would be very strong.


Calibrating the Robot.

I had to Calibrate the robot in the SwitchBot app to define the most open and closed points on the I-Rail with completely open being all the way to the right.

It Works! Test Run.


You will notice that I have move the I-Rail further to the right. This is so that I could move the tray that little further along. Although it isn't necessary to get out of the way of the water container now as the rails are in the way. Fortunately, the whole device is so rigid now that I can just move the whole thing out of the way. This also enables emptying the drip tray and also the used coffee disposal.

Automation

As before, I've extended my morning personal automation.


This gets my current location, and checks that the post code is mine. Of course I'm assuming that if I'm sleeping in that location I am at home. I think it is a fairly safe assumption.

It turned on the light beside my bed
Turns on the Coffee machine, which is a SwitchBot Bot.
Waits 86 seconds (I'll be looking to reduce this as much as I can)
Then moves the Coffee Tray to, in my case 12% open.
Turns on the Double Espresso, which is another SwitchBot Bot.
Waits 50 seconds, which is grinding and pouring the coffee and then
Sets the Coffee Tray to 100% Open, which moves the Tray to the far right hand side.

First production run was the morning of the 5th Feb 2024, and it ran perfectly.

Final Build (?)

You can see it, now, with the Black SwitchBot Bots, rather better looking than the white ones.

I've also propped up the ends of the tracks with more Lego bricks to give it some added strength. The Tracks are now screwed down to the wood. The Railway buffers are just whimsical and are not really needed, but are fun.



Is it really finished?

I think not. 
  • I'm tempted to replace all the wood with Lego bricks. Not necessary, but will look better.
  • I'm going to put another set of Lego wheels under the robot, just so it glides that little bit better.
  • When we remodel the kitchen, I'll put the Coffee Machine near the sink, and add a tube to the drip tray so that it automatically drains.
  • I'm trying to think of someway to automatically notify me of when the water reservoir is low, and I think I can do it using an Aqara water sensor. Then, how to get more water in?
Still, it's functional! It works! 

Is it useful? Sort of. 
Was it really worth all the effort and expense? Probably not.
Was it fun? Yeah, actually it was.
Am I happy with it? Absolutely I am!

Final Final Build!

OK, I bit the bullet and did a more professional job. I :
  • replaced the wood with a combination of Lego and Brixx, a Lego compatible brick system that is about 1/3rd of the price. 
  • changed the tray for an uxcell Serving Tray Small Black Mini Tray 6" x 9", as it is flatter and enabled me to get slightly closer to the coffee machine.
  • Added ability to do two cups.
  • Added markers so I can see where to place the cups.
  • extended the railway 



I've taken out the coffee making logic and put those into shortcuts. This means I can call them at any time. It also makes it easier for me to change if the automation is going to do 1 or 2 cups. In the automation example below it runs making 2 coffees.



Because of the now using Matter enabled Bots and extending the railway, I've had to adjust the automation. As mentioned earlier, I now have to turn off the Bots.


This is the one cup version of the automation, so it can fit on the screen

This automation performs the following:
  1. Set Coffee Machine (turns on the coffee machine bot)
  2. Waits 60 secs for coffee machine to clean itself
  3. Set Coffee Tray (Moves it so first cup is under the spout which is 27% Open)
  4. Waits 10 seconds to allow the tray to move
  5. Set Double Espresso (turn on the Double Espresso bot)
  6. Waits 50 seconds for coffee to be ground and then poured.
  7. Set Coffee tray to be Closed (All the way to the right - with the 2 coffee version it turns Double Espresso, moves a bit more to the left and turns on Double espresso again for the 2nd cup)
  8. Set Steam (Turn on Steam Bot)
  9. Wait 6 seconds (The amount of time it takes for the bot to do what it is told)
  10. Set 3 accessories (Which is Turn off the bots for Coffee Machine, Double Espresso and Steam - remembering that turning them off in HomeKit doe snot actually cause the coffee machines buttons to be pressed again) 

And finally, the video that I have been asked for. The video starts from the machine already turned on. I have reduced the wait times, but I think I can reduce them further.





Comments

Popular Posts