OpenVPN on a Raspberry Pi

My parents and I, who come from the Netherlands, have recently bought a cabin in Norway. We have a lot of wishes and ideas for this cabin, but one of the first projects I started on right after we signed the contract was the setup of a VPN server on a Raspberry Pi. The goal is to have any device connecting to the WiFi in the cabin appearing to be in the Netherlands, so that my parents can ‘work from home’ from the cabin and can stream Dutch TV and Dutch Netflix. For this to work, we need a router that can act as a VPN Client and a VPN Server to connect to.

By having the router connecting to the VPN Server, any device that connects to the router will also be connected via the same tunnel to the internet. By installing the VPN server on a Raspberry Pi, I can just ship a readily installed unit to the Netherlands with minimal setup steps for my parents while they remain 100% in control of their VPN endpoint. This is important to ensure that for example Netflix will not block their stream, as any data appears to come from their own home instead of a (known) VPN provider.

For this project we use the following components:

I recently bought an Asus RT-AC66U B1 router, which I know can act as a VPN Client. The Asus 4G-AC68U is a model from the same product line, which also includes a 4G simcard slot.

Software-wise, we only need only a handful of services/programs:

  • The latest Raspbian Lite
  • PiVPN
  • A Dynamic DNS provider, I’m using Google Domains
  • ddclient

Setup

The first step is obviously to flash Raspbian on an SD-card and shuf it into the Raspberry. I’m using Raspbian Lite since we know exactly which software packages we are going to use, and any dependencies will be installed with them. This will keep the overall system performance as high as possible.

After setting up Raspbian, we use SSH to log in as root and install PiVPN. PiVPN will install either OpenVPN or WireGuard, in our case OpenVPN as this is also supported in the Asus router. I have set up the IP configuration to be dynamic, so it can adapt to the setup in my parent’s house once it arrives in the post. Other than that I’ve used the standard settings, obviously choosing the right DNS Provider (Google Domains). I had also set up a Dynamic DNS entry in Google Domains prior to the Raspberry Pi installation, which will be used for this VPN setup.

Dynamic IP lookup

Since I don’t know the public IP address of my parents house (and they might have a dynamic IP address that changes every once in a while), one can use Dynamic DNS. Basically, Dynamic DNS checks the current public IP address of the host and sends this to a pre-configured DNS provider. The provider matches the IP address, for example 185.176.244.205, to a subdomain name, for example cloud.jessendelft.org. This way, anytime a device tries to find cloud.jessendelft.org they only have to ask the DNS provider, which will then provide them with the correct public IP address. To achieve this on the Raspberry Pi we can use ddclient. ddclient only needs to know a few basic parameters such as the login credentials of the DNS provider and does the rest by itself. It runs as a deamon in the background, automatically checking and updating the current public IP address in the DNS register.

I generated two OpenVPN configuration files which can be uploaded to VPN Clients and allows them to connect to the server, one for the Asus router and one for my private PC so I can test & debug the entire setup. These configuration files include instructions to use one of my subdomains to find the current public IP address of the OpenVPN Server in the Netherlands. This keeps the setup easy and flexible.

Lastly, I entered the Wi-Fi credentials of my parents house in a file called ‘wpa-supplicant.conf’ and placed this in the /boot/ folder of the Raspberry Pi, so they can use it both in wired and wireless mode. After running a few tests it was then ready to send it in the post, and hope that all works! I also included a guide for my father to set up the required port forwarding in his router in the Netherlands, so the VPN Server can be found from the internet.

Testing the setup

When the Raspberry Pi had arrived in the Netherlands it was time to put it to the test. We forwarded the required port in the router, gave it a static local IP address and attempted to connect from Norway.

Connecting was successful!
However, the test-pc did not have internet access.

The VPN Server in its natural habitat.

Some debugging later revealed that the ethernet port did not have the default eth0 name, but something more tropical. Changing the name of the ethernet port in the configuration (iptables) fixed the problem and allowed internet access through the VPN tunnel. Hooray!

Lastly we installed Log2Ram, which limits the logging done to the SD-card to extend the lifetime of the system. SD-cards can get corrupted when written too often to, so in order to limit the amount of write cycles Log2Ram will save all logs in RAM memory and only once a day write the entire logfiles to the SD-card.

A reboot to make sure everything works and it was finally time to check the speed of the connection!

Speedtest over 4G

Honestly, this is 10x as high as expected when we started on this project so we’re certainly very happy about this! This will allow my parents to comfortably travel to their cabin and use the internet, while they appear to be in the Netherlands.

Playing with Grafana & InfluxDB

In my search for a way to display the data being collected by Homey I often have seen Grafana as an option. Grafana is a tool to visualize data in graphs, gauges, tables, etc. It reads data from a database, is very responsive and easy to work with. As a bonus, FreeNAS offers a community plug-in which has both Grafana and InfluxDB installed and ready to go, so I could easily set up a jail to try it out.

Homey by itself does not log any data. To have it upload its variables to the InfluxDB database I just had to install the InfluxDB App, fill in the IP address of the Grafana jail & credentials of the database, et voila! From the Grafana interface I started seeing the potential Query fields being populated with all the data that Homey had to offer. Not much time after that, I had my first Dashboard populated with energy measurements, real-time power consumption and temperature data from different rooms in the house. With a little more playing around this Dasboard was shown as an iframe on my Magic Mirror.

Grafana dashboard shown as an iframe on the Magic Mirror

After doing this I realized that FreeNAS is also a great source of data (CPU usage, network & HDD speeds, RAM usage etc.) and a place where I’d like to get some more overview of what’s happening. Naturally, a quick Google-search yielded tons of people who had done this before, and I followed this guide to get FreeNAS to upload its data to a separate InfluxDB database and create a Dashboard in Grafana. I then used this dashboard as an inspiration to create a similar one for Homey and by the end of the day I had 3 different dashboards which give me a neat insight in how well my core-components from my smart home are working.

An additional line in the reverse proxy configuration and the Grafana jail was accessible through the internet. Curious on how it looks? You can find it here: cloud.jessendelft.org/grafana/.
Username: viewer
Password: viewer123

I am not sure yet if I want to keep using this system, as I ultimately want some form of 2D/3D interactive map of my house to show this information. As an interim solution though, this is quite nice and I was surprised by how easy it was to include this in my system. I like the fact that all the ground-work is up and running (FreeNAS, Reverse Proxy, Homey, etc.), and that it apparently is working so well that it is easy to build layers of complexity upon them with for example the Grafana dashboards. If you have comments/ideas on what I can do with my data, or how I can improve my system even more, please let me know in the comments!

Cheers!
Jesper

Steampunk Taptower build

I can’t believe this project took me almost a year to complete! In August 2019 I was browsing around Thingiverse for some cool idea’s to 3D print, when I found a Steampunk Tap Handle made by Fuzzie/The Beergineer:

I knew I wanted this as well, so I 3D printed the parts, spray-painted them and assembled them together with some scrap tubing and 8mm screwing rods. I also had some leftover APA102 LED strip from the Ambilight system laying around which could be used to light up the tap handle, and I ordered a couple of Arduino Nano’s to control this LED strip.

The assembled beer tab, with multi-colored LED’s on the inside.

The prototype was up and running rather quickly. I put the Arduino on a breadboard, connected the light strip to it and uploaded the code from The Beergineer. Before it worked though I made some changes to the code, which can be found on Bitbucket (including the changelog). Most notably I introduced interrupt-based reading of the push button opposed to polling it. This push button is used to change the light pattern shown inside the tab handle. I also programmed it so that every time the button is pressed, the new state is written to EEPROM so the same light pattern is shown after a power outage. Lastly I changed the main loop from an if-else loop (which had 4 if-statements) to a switch, to prevent unnecessary calculations.

Arduino Nano on a breadboard. Note the beautiful ‘push button’, aka red wire with capacitor.

And it was at this moment where this project ended up in a moving box, and didn’t find it’s way out until June 2020…

Installation

Almost 10 months after I started this project I dug up the beer tap as we would be going to our cabin during the holiday, which is where I planned on installing this. Before installation the Arduino was put inside a plastic box and covered in hot glue, to give it some resistance against rain. I soldered the wires to the headers, installed a push button on the outside of the case and put a Molex connector on the wires to make installation easy. Additionally I added a switch connected to the Arduino, which can turn the LED’s inside the handle on and off.

IMG_20200630_154312
IMG_20200701_131908
On the top: planning the box-layout.
On the bottom: components are in place.

 

At our cabin we have a refrigerator with a beer tab on top. Installation was a matter of unscrewing the old tab and screwing on the new tab.

IMG_20200704_151937
IMG_20200704_153851
IMG_20200705_195329
Installation of the Steampunk Beer Tab.

 

During the night, the LED’s inside the Tab Handle create a very cool looking scene:

IMG_20200725_223256
IMG_20200725_223221
IMG_20200725_223210
The Beer Tab at night, showing different light patterns.

 

I think this was a fun little project to do. Unfortunately I wasn’t able to properly hide the cables as the metal in the tab tower was too strong to drill through with the tools we had available at the cabin. Therefore, they run on top to the black box which holds the Arduino. Other than that, I am very happy with the result.

Cheers! And don’t forget, keep Beergineering!

Jesper

Homey – The center of my smart home

Anybody who has a couple of smart devices in their house will recognize the fact that every brand seemingly has their own way of communicating with their devices. This can quickly result in you having a ton of different apps on your phone, each controlling one separate thing. In addition, they’ll probably tell you you need a dedicated hub to communicate with these devices. This means you are either stuck with one brand, or with multiple brands that are incompatible with each other.

“Do you want the lights to turn on when you come home? Sorry, your smart light bulbs are not compatible with the door sensor. Want to be woken up when your basement is flooding? Sure, just get a flood-sensor, a new app on your phone and make sure your phone is always on & connected otherwise you won’t receive the notification.”

From the time working with smart devices I have come up with a few rules I try to stick to as much as I can:

  1. No services should run on my phone directly, otherwise they will drain the battery and they require me to always have my phone on. They should be offloaded to a dedicated external device.
  2. My phone should have as little apps as possible.
  3. Devices, and in particular the lights, should have a high WAF-factor (Wife Acceptance Factor), meaning:
    1. They should work quickly and reliably.
    2. They should preferably have a physical button, or at least have voice control so that they are easy to (manually) control.
  4. Lesser important, but where possible choose a device that does not require WiFi to avoid unnecessary traffic on my WiFi network which could make it slow.

A big help in living after these rules has been my Athom Homey. I bought a Homey V2.0 in November 2019, and since then it has slowly become the center of my smart home. Homey is a smart home hub, able to communicate directly with over 50.000 devices of over 1000 manufactures, without the need for additional hubs. It is able to communicate over both WiFi, ZigBee, Z-Wave, 433MHz, 868MHz, Infrared and Bluetooth, so it is extremely versatile in terms of what devices it can communicate with.

Homey has become the center of my smart home.

Homey is also accessible from outside my local network, so as long as I have internet I can check up on the status of my devices at home. At the time of writing I have around 30 devices integrated into Homey, and 17 apps to control all of them and the automation’s that run behind them.

Current integrations

Smart WiFi sockets

One of the simplest things you can start with when starting your smart home are smart WiFi sockets. These plug in your existing wall outlet, and measure the voltage, current and power of whatever is plugged in to them. In addition, they have a relay which you can use to turn things on & off.

Homey can use the relay to turn things on and off, for example the power to our robot vacuum Dustin to control when it is allowed to charge. Additionally, with the help of Flows (which I’ll explain a bit further down) you can automatically detect when a device is on by monitoring the energy consumption. This is useful for, for example, the washing machine or the dishwasher. In our case, when the washing machine is running it uses a certain amount of power. Homey monitors if the power consumption of the smart WiFi socket exceeds 100W, and if it does it turns on a virtual device which is called ‘Washing Machine’. Vice versa, if the energy consumption drops below 10W for over 5 minutes, the virtual device ‘Washing Machine’ is turned off. A full guide on how to implement this can be found here. This is used to calculate the total energy consumption & price, but also allows us to ask ‘Hey Google, is the Washing Machine on?’, and Google Home will understand and tell us the answer.

In my case, I currently use BlitzWolf SHP6 sockets (10A versions) for controlling power to the Playstation and Dustin, and BlitzWolf SHP2 sockets (16A versions) for monitoring the washing machine and the dryer. All of these sockets are re-branded Tuya sockets, and I have flashed them with ESPurna software to make them compatible with Homey and remove the need for a separate BlitzWolf hub. I am considering moving towards Aqara smart plugs as they use Zigbee instead of WiFi, see rule #4.

Homey integration into Google Home

Talking about Google Home, Homey is integrated into Google Home. This means that any device that is added into Homey automatically gets forwarded to Google Home! This makes it very simple to add voice steering to anything, from the Awning to the Playstation.

Google Home overview, showing the devices on the Balcony. All devices are accessed by Google Home through Homey.

One exception to the ‘easy integration’ are the Aqara temperature sensors. Homey does not support the synchronization of sensors to Google Home (link). I therefore made a virtual thermostat for each sensor, which did allow exposure to Google Home. This however meant that if one asks for the temperature in the living room, Google Home will respond with ‘The temperature is set to X, and currently it is Y degrees’.

Philips Hue

Homey communicates with my Philips Hue bridge over WiFi/LAN. The Hue bridge takes care of the communication with the light bulbs and light switches over Zigbee. Theoretically Homey could take over the functionality of the Hue bridge completely (Homey talks Zigbee after all), but I have one reason why I haven’t switched it out yet: Reliability. The Hue system has over the last 4 years proven itself to be very, very stable. We have never had issues where we pressed a button, the lights would not come on. They respond quickly, all the time. I have realized this is essential to keep the family on-board with the whole smart home journey.

Also, I can tinker as much with Homey as I want while the lights and light switches will still be working fine as they are on a separate system. Lastly, resetting each separate light and programming it into Homey will require a lot of work (with 4 light switches and 17 light bulbs this is quite a job). Since everything works so smoothly, it is best to keep this system as is for now.

Tibber

Here in Norway every energy meter is since January 2019 ‘smart’, as they are all required to have a HAN-port (Home Area Network-port). This port reports every second the real time power consumption of your house over M-Bus, which means that when you connect an M-Bus reader to this port you can get this information send over for example WiFi or Zigbee.

This is where Tibber comes in. They are a Norwegian energy provider and sell a little device called a Tibber Pulse. The Pulse connects to the HAN-port (but also works with smart energy meters in other countries), snaps onto the front of your meter with magnets and sends the data over WiFi to Homey.
Tibber is also my energy provider and connected to Homey, which means Homey has access to my current energy prices, information on lowest and highest energy prices during the day as well as statistical data on the price. This I use for example to calculate how much it costed to wash our clothes, or to charge Dustin during the time of the day the energy prices are at their lowest.

BTW, if you want to sign up for Tibber, give me a shout! We can both earn €50,-/500NOK in their web store if I register you as invited!

Flows

Flows in Homey are like If This Then That (IFTTT) applets. You can program certain ‘triggers’ which start an automation (If This), which will then perform certain actions (Then That). In addition you can program parameters which need to be met before the actions are performed. A few examples I have below are:

  • Detect if somebody is showering.
  • Virtual Devices.
  • Automating the extending and retracting of the awning.

Detect showering

This was my first automation, and mostly meant to try out the ‘Flows’. This flow runs when humidity changes in the bathroom. When the humidity is greater than 80%, the first flow creates a notification saying ‘Somebody is showering!’, and then deactivates itself. A second flow activates when the humidity is lower than 80% and the first flow is disabled. This indicates the shower is back off, so it simply re-enables the first flow.

Two flows to give a notification when somebody is showering.

This has worked remarkably well so far. I’ve never seen any false positives, nor any double notifications.

Virtual Devices

If a device cannot be added directly to Homey, maybe because it is a ‘dumb’ device or it is incompatible, it is often possible to make a Virtual Device by looking at the power consumption, like what we do with the washing machine.

Another possibility for virtual devices is to use them as (voice activated) triggers, for example with the Playstation. When the virtual device ‘Playstation’ is turned on by Google Home (‘Hey Google, turn on the Playstation’), Homey runs a flow which turns the electrical socket on, turns the TV on and sets it to the right input channel. The TV then sends a CEC command to the Playstation, which will turn it on as well.

When the virtual device ‘Playstation’ is turned on by voice, it turns on the TV, Playstation socket and sets the TV to the correct input.

There is also a second flow that turns the Playstation power socket off again when the power consumption drops below 10W, and the countdown timer (which is set to 5 minutes) is not running.

Awning automation

The awning motor which I recently installed can be steered from Homey using a Z-Wave signal. An extensive description of how the awning is extended and retracted based on the seasons & weather can be found here.

Future Expansions/Idea’s

I have ordered a couple of different Aqara sensors to go and try out. All of these sensors use Zigbee to communicate, which I like a lot as it doesn’t clutter my WiFi network. Among the things I have ordered are firstly a wall switch which I’m planning to use to steer some of the lights in the hallway. Secondly, a door sensor to turn up the light intensity of those same lights for a couple of minutes when the front door is opened. Lastly, I ordered a flood sensor which should give an alert on the Google Home devices when it detects a flooding, as well as flashing the lights. I also have some cool ideas for the Xiaomi lux sensors, which could completely automate the awning and the lights in the living room.

Another thing I am looking for is a cool-looking dashboard which I can for example put on a tablet somewhere in the house, which can then be used by the rest of my family to control devices and check the status on them. This will greatly increase the WAF factor because it makes the data more accessible. I am considering to use MQTT to push data to the Magic Mirror, where I can create a floor map to show the status, but this won’t enable us to steer devices. If you have any suggestions, please let me know in the comments below!

Limitations

Unfortunately, as I mentioned in my Roborock post, the Xiaomi Mi Home app is outdated which means I cannot control my Roborock through Homey. I have temporarily added the Roborock directly into Google Home, but hopefully the developer will come with an update for this app. I am also considering looking into this myself, as it looks like the app is not actively maintained any longer.

Lastly, we have a Sharp TV in the living room which uses an RF control. As no library has been created to control TV’s over RF with Homey, it cannot be added. Homey is also physically in a different room, so even if we switch out the TV for one that is controlled by IR, Homey couldn’t control it.
If I want to control the TV (and the amplifier & TV set-top box) I have two options; the first is to start creating my own app for Homey, however I find that my time to do this is quite limited. The other option is to buy a Broadlink RM Pro, which should be able to learn the controls of the TV and should also be able to steer the amplifier and set-top box (which are using IR). If you have any more idea’s/suggestions, please drop me a message!

 

Cheers, Jesper

 

Roborock S5 Max

Please meet Dustin! For my girlfriends birthday I bought a Xiaomi Roborock S5 Max, after having talked about it for many months. I dislike vacuuming and do this at most once a week. My girlfriend on the other hand would like me to vacuum every day, so we both agreed this could be a very good solution for the both of us! The Roborock S5 Max is able to do both vacuum cleaning and mopping, and I haven’t been able to find any negative review of them, hence why I choose this model.

The Roborock S5 Max has the possibility to change the name. So after a short brainstorm session with the family ranging from Bob, JARVIS (which is already the name of the house) and Dusty we landed on Dustin.

First impressions

My first impressions with this product are very positive! Dustin has a LiDAR sensor peeking out from the roof, which it uses for navigation and mapping. The mapping feature is very impressive, as it creates a 2D map of my house while it is vacuuming. Simultaneously it logs on the map where it is and where it has been. In addition to the LiDAR it has a big bumper with a pressure sensor on the front to stop it running into low items, and sensors on the bottom preventing it from falling down the stairs.

Screenshot_20200628-102150
Screenshot_20200628-120551
  • Running Dustin for the first time. On the top, mapping the house for the first time. On the bottom, mapping and cleaning were done.

After the house was mapped you can manually divide it into different rooms. This allows you to clean specific rooms, or set different vacuum/mopping settings depending on which room it is in. The map also allows for setting ‘no go zones’ and ‘virtual walls’, which make it not go into a specified area.

The LiDAR is slightly offset from the middle. This means it can do a 360 on the spot to very accurately see depth, which means you can manually set it anywhere in your house and it is able to locate itself and automatically drive back to the dock. I have tried this a couple of times, and in ~80% of the instances it successfully managed to locate itself in the house and return to the dock.

Screenshot_20200628-173154
  • Mapping complete, and the house is divided into rooms. Also a no-go zone (the red square) and no-mopping zones (the purple squares) have been set up.

Using the map you can also drop a pin to where you want it to go to. After it reached this location, you can tell it to do a ‘Spot Cleaning’, which cleans an area of 1,5m² around that spot. Very handy!

Are there any shortcomings?

I have found a few so far. When the LiDAR sees a mirror, it is convinced the room is 2x bigger than it actually is due to the reflection. This causes it to misjudge where walls are, and it get’s confused as it tries to reach these spaces. In my case, when cleaning the hallway it finds that there must be a room connected to the hallway that extends into the wardrobe, and that it actually extends all the way into the living room. It then tries to drive around to the other side to access this room, only to see that there actually is a wall there. It tries this three times in a row before it gives up cleaning this area (but hey, it shows commitment!).

Screenshot_20200703-141416
Screenshot_20200703-141841
  • On the left, the map is shown as when Dustin is placed in front of the mirror. The closet is painted red in Photoshop, and it can be seen that the walls on the back of the closet have disappeared. On the right, you can see that Dustin tried to drive back and forth a couple of times, and that when it is on the back side of the closet the walls are drawn as they are.

Another shortcoming is that it sometimes gets stuck on the doorway steps, especially when it tries to drive parallel over the doorway steps. There might be a solution by creating a separate room over these doorsteps as suggested on Reddit, but I haven’t been able to test this properly yet.

Lastly, I haven’t been able to find a way to integrate this unit into my Athom Homey. To centralize all my automation’s I’d like to have it integrated into Homey, but unfortunately the Xiaomi Mi Home library is not updated which means it cannot talk to this Roborock model. For now I integrated it directly into Google Home (an integration that would normally have been done through Homey), which at least enables voice steering.

Conclusion

So far, Dustin has been vacuuming our house multiple times in the last week. The rest of the family seems to be happy with him as they are using him extensively and without my help. I have good faith in that I’m able to fix the doorway problem, and if all else fails I can always make them lower so that Dustin is able to clear them better. All in all, I am very happy we finally have one running around :).

If you have any tips/updates on the Homey integration or the other issues I’m seeing, feel free to drop me a comment below!

Awning Motor #2 – Installation & Configuration

Installing the Dooya awning motor was a bit cumbersome, due to the sheer size of the awning. Our awning is 7 meters long, which means that it requires at least 3 persons to lift the unit off and on the roof. In total we needed 2 installation attempts. During the first attempt we managed to remove the old, manual crank system and slide the motor into the awning. After we slid in the motor we found that the manual crank system was wider than the new motor, which meant the motor could not be slid in completely whilst also being attached to the side plate supporting the awning:

IMG_20200616_112025
IMG_20200606_170328

Old crank vs. new motor. The lower picture shows that the motor is not fully slid into the awning.

To allow the motor to be slid in completely there were basically 2 options:

  1. Shorten the support beam holding the awning to the roof.
  2. Use bolts to offset the motor from the side plate.

Shortening the support beam would be the most elegant solution, although this means that reverting to the manual crank at a later time will not be possible. The quality of the motor is not known, and failure is always an option. Therefore we chose to get some 50mm M6 bolts and a whole bunch of washers to offset the motor from the side plate. Simultaneously, the motor was rotated 180 degrees so that the power cable and antenna would exit on the top instead of the bottom, allowing for neater cable management.

The motor with the 50mm offset. Now the motor is fully slid into the awning.

After pairing the remote control to the motor and adjusting the outer limits, it was very satisfying to find out that it working well. It looks like the motor has enough torque to comfortably pull the awning back up, which hopefully means it won’t break in the near future.

Homey and Google Home integration

The remote control uses Z-Wave to steer the up & down movement of the motor. Homey is able to steer Z-Wave devices, and according to the Homey forums the Brel Motors app should be able to be paired to and control the Dooya DM45RM motor that is installed here.

Screenshot_20200616-121136
Screenshot_20200616-121217

On the left: Pairing the Dooya motor
On the right: The control interface in Homey.

Pairing was very simple. The app asks to push one of the buttons on the remote control that is already paired to the motor. From that signal it can determine the unique communication key to the motor (which ensures that a neighbor won’t accidentally control my motor), as well as the correct up, down & stop signal. A concern I had was that Homey was too far away to reliably control the motor, as it is positioned 3 rooms away from the motor, but the Z-Wave signal seems to have no problem reaching the motor.

My Homey was already integrated into Google Home. After a quick refresh, the Sunshade appeared in the Google Home app. Sweet!

And finally, it was time for a test:

You may notice that I say ‘close the sunshade’ instead of ‘lower the sunshade’. This is because Google recognizes the awning as blinds, which means they can only be ‘closed’ and ‘opened’. Fortunately this is not a problem whatsoever as it is easy to remember, and in the worst case Google doesn’t understand our command and we need to say it twice.

Some more Homey configuration

With Homey being able to control the awning, I could program a couple of ‘flows’. Flows can be compared with IFTTT applets that are managed and run inside Homey.

Screenshot_20200616-122944~2
Screenshot_20200616-123017

To the left: 4 flows to automatically steer the awning.
To the right: detailed view of the flow that lowers the awning.

I set up 4 flows for now:

  1. The first flow automatically lowers the awning at 11:00 if the weather is good.
  2. The second flow retracts the awning at sunset.
  3. The third flow retracts the awning when the weather applet shows it’s raining.
  4. The fourth flow retracts the awning when the weather applet shows the wind speed is over 39 km/h, which equals to Beaufort 6 or higher.

The flows that retract the awning will always run once they are triggered, regardless if the first flow has been triggered or not. This is because we are able to lower the awning manually with the remote control, and this motor only allows for a one-way communication. Therefore Homey has no way of knowing the current state of the awning. If the awning is already retracted, the motor is blocked by the end-switch and nothing will happen. To avoid spamming the motor with retract-signals a timer set to 1 hour is activated, which blocks new retract signals.

With this project done the balcony refurbishment is (for now) complete. We can now comfortably sit outside, enjoy the view and get ourselves some shadow whenever we want it with very little effort. The last couple of days have been quite sunny as well, so we have been able to enjoy our new setup quite a lot.

Renovating the balcony

It’s Corona-time! Therefore (almost) everybody has a lot of time at home, including me. In order to make the most out of the situation my girlfriend and I decided it was a good idea to invest some time and money into our balcony as we can see this directly from the living room. During the day this is also the part of the house that gets the most sun as it is located at the south side of the apartment. Renovating this part of the house will therefore allow us to enjoy the outdoor weather during the spring/summer and simultaneously improve the view we have from inside the house.

The first step in renovating the balcony was to make a list of things that needed to be done.

IMG_20200503_103223
IMG_20200503_154832
IMG_20200503_154844

The situation before the renovation

  • The floor was rotten, so that needed to be removed. Underneath the wooden floor were stone tiles, which we decided to leave in place as they made a relatively flat surface, were pretty heavy, and we wouldn’t know if the concrete below would require a lot of maintenance (what you don’t know can’t hurt you).
  • All the grass in the planter needed to be removed to make room for new plants that look better.
  • The walls and planter could do with a paintjob.
  • To make the balcony safe(r) a wooden fence was placed onto the planter. To allow for painting, the fence has to be disassembled, and can then painted as well.
  • There are plans to do a large overhaul on the balconies and planters in this neighborhood in 1-2 years. One option we considered was to build a terrace similar to the one build on the veranda at the other side of the apartment, however this would have to be destroyed if they start the large overhaul. We therefore decided for IKEA RUNNEN decking, which both looked good and is easy to remove again when necessary.
  • Lastly we wanted some nice lounge seats so we could sit outside in the sun.

Preparing the balcony

I started with removing the wooden fences. This was easy as they were hanging on the planter with the help of hooks, and they were only fastened by screws in the bottom. After removing the fence it was time for the grass and the floor. First the grass was gathered in waste bags, after which I cut up the floor in pieces of 90cm (so they would fit perpendicular in the trunk of my car).

IMG_20200503_154844
IMG_20200507_141857

Before and after the floor and grass removal

I then could drive all the old flooring to the local landfill. With everything removed it was the perfect time to paint the walls. Both the red and the white had to be done, so on a nice (semi) sunny day I set to work.

The result after painting red and white.

To determine the color of the fence I made a 3D model of the balcony in Google Sketchup. In our area there are 3 common colors: red, white and brown/black. The 3D model allowed us to quickly change the color to see what looked best:

Balcony_brown
Balcony_red
Balcony_white

In the end, we decided white would look the best. Brown/black made it look like a barcode, while red would not really fit onto the white planter and the trees in the background. We therefore choose to paint the fence white.

The rebuild

It was then time to lay the new floor. The RUNNEN floortiles are very easily clicked into place, and give a very nice result for such a short time. I again made a timelapse of the process, which can be found below:

At this point, we bought some plants and planted those in the planter. After replacing the fence and securing it into place the balcony was almost done.

IMG_20200514_172147

Lounge set

The last thing that was missing was a nice place to sit and enjoy our newly refurbished balcony. After some consideration we again reverted to IKEA, this time to buy an ÄPPLARÖ 4-seat lounge set.

I’m really looking forward to drink a cup of coffee there during the morning, and to enjoy a beer during the evening. The entire family is happy with how it turned out, and hopefully we’ll get a lot of sunny days this year to enjoy the outdoors!

Awning Motor

I bought this 200 watt motor to motorize our awning. This specific model is a Dooya DM45RM tubular motor, which is able to deliver 40 Nm of torque. Hopefully this will pull our 7 meters long sunshade in and out without problems.

As a bonus, it looks like this unit can be connected directly to Homey, which also means a Google Home integration (via Homey) is possible (‘Hey Google, give us some shadow’). I’m looking forward to install this bad boy!

Home NAS Server Setup

This website runs on an Intel NUC.

Actually, a lot of things are now running on this little NUC. Before showing you exactly what processes/services are running, please allow me to explain why I have this NUC in the first place.

Home Assistant and the NUC

In our previous house I was running Home Assistant on a Raspberry Pi. Home Assistant is a piece of software that can observe, control and automate nearly anything that can be part of a smart home. In my case, I had the following devices connected to it:

Linking all these devices together required something more robust than a Raspberry Pi, hence why in April 2019 I bought an Intel NUC NUC6CAYH. This little fellah has an Intel Cerion CPU, place for a maximum of 2x 4GB of DDR3L RAM, can house a 2.5″ hard drive and has a 1Gb ethernet port. I figured that this was a very good alternative for a Raspberry Pi, whilst also keeping my wallet in mind.

This NUC ran Home Assistant (or HA for short) very reliably, although the HA software itself needed quite some maintenance, up until we moved in December 2019. The NUC disappeared in a box, and at the new house I bought an Athom Homey to take over the task of HA in an attempt to limit the amount of maintenance work. This is why I had a NUC laying around when I decided to start setting up a Home Server in January 2020.

First step: Setting up a NAS file server

When I started on this project I knew nothing about file- or NAS servers, but I imagined that there would be open source software out there that could help me out. I had decided that I did not want to buy new hardware, as things could be tested on the NUC first to see if it would be good enough.

Two names that kept popping up were FreeNAS and Unraid. They both looked equally good candidates for me, so I picked the one that felt like it had the best chance of succeeding -> FreeNAS. Over the last couple of months I have been very happy with this choice. FreeNAS is running very stable and is in my opinion easy to use. The initial file server setup was a breeze, and in no-time I had a functioning NAS server which could be accessed through a PC with Windows Explorer (via a Samba share).

FreeNAS has a functionality which are called ‘Jails’. Jails are, very shortly explained, little isolated operating systems that use the same kernel as the hosts operating system. This means that they are more lightweight to run than a Virtual Machine as they dynamically share available RAM, CPU & HDD space between the host and other jails, but simultaneously are compartmentalized from the host. Processes run inside the jail can only access files inside the jail, and processes/files inside the jail are not aware of any file outside the jail. An additional (much better) introduction to jails can be found here. All in all, they are a perfect place to run additional programs/services without the risk of breaking my entire NAS system.

The current setup

The current HW setup, including PS4 Pro and Philips Hue bridge

Hardware

The current hardware today is, as I mentioned, running on an Intel NUC. This includes:

The HDD’s are set up in a mirrored configuration. That means that all data is copied on both drives, giving me an effective storage capacity of 2 TB whilst also protecting myself from a disk failure. This is also called a RAID 1 setup.

FreeNAS Software setup

The current setup is running 3 jails, 1 Virtual Machine, a samba share and some additional smaller services inside FreeNAS:

FreeNAS services setup
  • The Samba share allows us to access files on the server when we’re on the home network.
  • The website that you see right now is running inside a Jail.
  • A second jail contains NextCloud. NextCloud mainly allows for automatic synchronization of pictures and videos from my phone to the server.
  • Since there are multiple websites that I want to access from this web-address there is a jail set up that acts as a Reverse Proxy server.
  • Lastly I have a virtual machine that runs PiHole. PiHole is software that blocks advertisements on my home network. Unfortunately it cannot run (yet) inside a FreeNAS jail as it does not support FreeBSD, the operating system FreeNAS runs on.

So how do all these services work together? Well, that’s a different view:

Networking flow

Starting from the bottom, there are the NextCloud storage, this blog and the magic mirror which are accessible through the internet via the reverse proxy. There is also the Samba share which is accessible only on the local network for privacy reasons.

In the middle of the picture is the router which obviously has access to the internet. All DNS requests are however forwarded to PiHole. A DNS request is a request for a name server to translate the domain name of a website (for example jessendelft.org) to an address (for example 217.197.166.65), in order to connect to that address. PiHole blocks any requests to known advertisement addresses so that these requests never get resolved, which means they will not load. This way there is network-wide ad-blocking for all devices connected to it.

I have some plans of integrating Octoprint into the Reverse Proxy once my 3D printer is back up&running. I also want to move PiHole to a jail to free up some RAM and HDD space which are now reserved by the Virtual Machine.
If you have any more ideas on what I can do to improve my setup, please let me know!

Installed a mesh WiFi network

Yesterday I bought this ASUS RT-AC66U router with 2x Lyra Trio routers. These together form a mesh network at my home, giving me a whopping 1.3 GB/s of theoretical speed on the 5GHz network.

Top Gun I Feel The Need GIF - Find & Share on GIPHY

So how much do I actually get? My subscription should allow for 600/600Mbps. The following is measured on the 5GHz WiFi in the living room while the access router is a few rooms away.

It’s not 1.3 GB/s, but for a Wi-Fi connection this is not bad at all.

Still, I wanted to try and reach the maximum that I’m paying for. So in the next measurement I turned off the QOS settings in the router (to prevent it from reserving bandwidth for other services), and attached my PC to one of the LAN ports. The results speak for themselves:

So hopefully this should allow us for problem free streaming, downloading, gaming and video calling during the current Corona lockdown.