Home Automation
Using Home Assistant and ZigBee to automate and control the window shades.
Using Home Assistant and ZigBee to automate and control the window shades.
Previously we automated a single motorized blind using a broadlink device and Home Assistant. Here we'll take a look at automating a group of IKEA blinds using Zigbee and Home Assistant.
🐝+🏠
In an earlier project, I explored the process of setting up a smart shade. Here we'll see how I automated my basic motorized IKEA window shades to be automatically opened and closed based on daylight or some other condition - as a group!
💡
The previous project in this series LaundryBot 1.0 - Motion Sensing we look at automating a non-internet-connected motorized blind. In that project I used radio frequency based remote controls to send a signal to the blinds to open and close with the sun.
Next, I wanted to explore the concept of opening and closing blinds automatically based on the sunset or some other condition like when the coffee machine is ready in the morning. Plus I wanted to take it one step further by coordinating a group of blinds to act in unison.
For the blinds, I'm using a cellular blackout shade from IKEA called Tredansen. Typically, these blinds are controlled through a Zigbee mesh network which is extensible through the provided Zigbee repeater that comes pre-paired with the blinds from the factory. Also included with each blind is a remote control which we won't be needing but maybe they will come in handy for a future project.
To make all of this work with Home Assistant (HA) I created a new Zigbee mesh network by adding a ZBT-1 device to my HA system running on a Raspberry Pi 3 (32-bit) and using Zigbee2MQTT to connect the devices.
If you are curious how I did this, continue reading to follow my journey.
ZBT-1 is going to help us to add Zigbee to Home Assistant (HA).
This device is developed by the Open Home Foundation as a zero setup way to add Zigbee to HA.
I was lucky I had all the necessary materials on hand from previous projects:
Home Assistant running on the local network plus a couple add-ons
Home Assistant companion app running on iOS or Android
ZBT-1
IKEA Tredansen Blinds
First I needed to get Home Assistant (HA) set up on the local network.
Next I followed the steps to install ZBT-1 being careful to stop before step 5 because I don't want to use Zigbee Home Automation integration (ZHA). For this project, Zigbee2MQTT will be standing in for ZHA - we'll get to that in a moment.
A handful of other MQTT brokers are available but Mosquitto is the easiest to set up and that's what I used for this build.
I followed the process to add the Mosquitto add-on to HA available through the HA add-on store using these steps.
Navigate in the Home Assistant frontend to Settings -> Add-ons -> Add-on store.
Find the "Mosquitto broker" add-on and click it.
Click on the "INSTALL" button.
Once the add-on was installed - I started it.
To connect to Zigbee devices (which is the technology the IKEA blinds use) I had to set up Zigbee2MQTT, which is an HA add-on available through the HA add-on store.
Navigate in the Home Assistant frontend to Settings -> Add-ons -> Add-on store.
Find the "Zigbee2MQTT" add-on and click it.
Click on the "INSTALL" button.
Once the addon was installed - I started it.
Once Zigbee2MQTT was running, the ZBT-1 failed to auto-connect. When this happens, there a good chance ZBT-1 needs a firmware update - that was my experience. When I completed the firmware update, the device appeared in the Zibgee2MQTT dashboard.
If you have the original instructions for how to pair the IKEA device you'll want to use those here. Each Zigbee device is different - but they all have some way of initiating pairing mode. Here's the instruction for how to pair the repeater I'm using for my blinds:
Push the reset button of the device with a paperclip for 5 seconds. While pairing the LED is flashing/dimming slowly. Once the pairing is finished, the LED stays on.
And then I followed the instructions for pairing the blinds:
It's recommend to first pair the included TRADFRI signal repeater in the room where you want to put the blinds. The blinds have shorter than usual range, so it is highly recommended to use the included signal repeater. Now press both buttons on the blind (next to battery lid) for 5 seconds until a white light between both buttons is turned on. The device is now awake and ready to pair for 2 minutes. After that pair the blind by holding the blind battery lid very close to the TRADFRI signal repeater until the white light is turned off (this should mean the pairing is successful)
Once I had paired all the devices and they were showing up in Z2M - I decided to create a group representing all the blinds in a given room and point to that group when creating an automation. This will streamline the process of adding more devices in the future by adding them to this group - while the automations will not need to be modified.
This is optional if the device will be solo but if there's any possibility that this system will be expanded with similar devices later on - groups are the way to go.
I navigated to Settings > Devices & services > Helpers
On the bottom right I chose + Create helper
In the Create helper menu, I selected Group
Then I selected Cover group to open the Create Group menu
Name:
This can be something descriptive or based on an area - for example Kitchen was the name I chose for one group.
Members:
Here's where each device (Entity) can be added to the group. It's ok to have just one device in a group for now - I can always come back and add more later.
Provided I created my automations using a group (rather than pointing to the individual device) the process of adding devices later will be much simpler.
Once I added all the devices I wanted, I hit Submit to confirm my choices and create the group.
Later, I explore using groups of groups and when it makes sense to use that approach.
Now that I had the blinds group, the next step is to set up an automation in Home Assistant (HA) to make the blinds automatically open and close based on a given condition.
☕
In one instance, I was excited to use the cover group called Kitchen in an automation that is initiated by the state of the coffee maker in the morning. When the coffee maker starts up the blinds open.
🌇
When the sun sets in the evening, the blinds close in unison as the automated lights start up!
I created a control on the HA dashboard to monitor the status and manually operate the blinds if needed.
I added a badge for each of the blinds groups (Kitchen and Front) and one supergroup named All to control them all.
Badges always appear at the top of the dashboard.
One tap on a badge opens a detail view and a slider control plus a button to toggle the blinds open or closed. Most of the time I don't use these because the automations do it for me - but it's nice to know I can take control if I need to.
Since I no longer needed the physical remote that came with the blinds I was excited to repurpose that for another use case.
Using Blueprints found in Blueprints Exchange, I made one remote into a Play / Pause button for anything that's playing on the TV. I'm excited to share the experience I had doing this - in fact this is a topic for an upcoming post!
🎉
One of the advantages of automating things around the house is how it effectively extends the life of the things we use every day - in the long run this will reduce waste and make our homes more sustainable.
As we get more dependent on smart devices and automation it's important to find ways to avoid having to replace our still-functional things with newer manufactured products. Every device saved from the landfill is also one fewer device generating CO2 and other waste byproducts by being made new at a factory.
Adding these modern features like automation to our existing devices also improves the life of the product by reducing the physical wear and tear on the controls since we're bypassing the buttons and remote controls by controlling these functions programmatically instead of through a physical user input.
This project was inspired by the amazing members of the Seattle DIY IoT Meetup - which was a meetup I co-founded in 2018. Shout out to all who helped make that happen!
👏
Using Home Assistant and Broadlink RM Pro+ to automate and control the window shades.