In my prep for conservatory automation, I had to check if Aqara Roller Shade Driver E1 (review) is compatible with Zigbee2MQTT. I plan custom automation for 3 overly expensive blinds (which we paid over £2k for) to open and close as needed. These were mandatory, as without the blinds, the temperature inside the conservatory would reach 60℃ by 10 am on a sunny day, killing whatever plans were stored inside.
Aqara Roller Shade E1 on the inside
Since this is a less formal article, one that Aqara won’t kill me for taking devices apart, let’s start with checking Aqara Roller Shade Driver E1 on the inside. We will know what are we dealing with before we move into Zigbee2MQTT and NodeRED automation.
In my review, I mentioned that Aqara Roller Shade Driver E1 come with a built-in battery and USB-C charging port. Aqara mentions that we can actually run the units constantly plugged in (something I will probably end up doing as the position of these in the conservatory will be inaccessible for easy charging).
It’s easy to get inside thanks to 4 Torx screws. Inner poking reveals a smaller than expected battery (room for upgrades) 7.4V 1000mAh. I was expecting a 5V battery, but it looks like the voltage might be regulated better with the included battery.
After a small struggle, I yanked the main board which hosts a daughter PCB: LM19-ZGB-CN-B-T1 module with NXP JN5189 module at its heart. I’m surprised to see every imagined GPIO broken out on the PCB for easy access and testing. Something not commonly present on consumer-grade hardware. Anyone willing to take this to the next step, won’t have any issues connecting.
Lastly, a geared, encoded motor handles the chain movement and keeps the position in memory. Enough of poking around let’s play.
Aqara Roller Shade Driver E1 in Zigbee2MQTT
You will be forgiven for not knowing that the E1 driver is a westernised re-hash of Xiaomi Roller Shade Driver also made by Aqara. Unsupported natively in the west by the Xiaomi ecosystem, Aqara brought the design to the west in September.
It means that folks who already got their hands on the Chinese version of the device did the initial work on support for the Aqara E1 driver in Zigbee2MQTT and all I have to do is to verify that the same settings work for western SKUs.
In practice.
I had no issues pairing my zzh Electrolama coordinator to Aqara Roller Shade Driver E1. It binds to the Xiaomi E1 configuration from natively supported devices. However, not everything is supported. If you never paired a device before, I have a complete guide to that as well to walk you through and troubleshoot basic issues when pairing.
In the Aqara ecosystem, Aqara Roller Shade Driver E1 has the ability to report the state changes done from buttons or 3rd party triggers like Alexa or Google Assistant. Unfortunately, this is not the case in Zigbee2MQTT. While you can set the device to any position, you won’t be able to get a dynamic readout on status change. It’s disappointing, as UI would not reflect changes done by the 3rd party. Don’t worry, I will show you how to mitigate the changes done from smart assistants so the only thing you will have to worry about are changes done via built-in buttons.
Despite the support page saying that the link quality and battery information is submitted passively by the device, I was not able to obtain any information. It means that my global profile for tracking the battery statuses of all ZigBee devices on the network won’t be able to capture and store the battery levels and issue a warning.
Setting hardware limits
Before using commands, set the hard limits for the device so you won’t roll your blinds up forever. You need to pair the device to set these. Once paired, press both buttons until the LED blinks, then drive the roller into the upper position and confirm the upper hardware limit by pressing the up button 5 times. Set the shade to a lower position and press the down button 5 times to confirm the hardware limit. You should see LED blinking to confirm that.
Commands
The typical command structure works well, but there are some custom commands that you can submit to Aqara Roller Shade Driver E1. Use zigbee2mqtt/<devicename>/set
topic to pass your commands over.
{"state": "on"} & {"state": "open"} #open fully
{"state": "off"} & {"state": "close"} #close fully
{"state": "stop"} #pause action
{"position": 50} #set curtain to 50%
If you want to reverse the way the position is reported you can open your configuration.yaml
or device.yaml
and add the custom option to your device entry:
'0x54ef4410001d828a':
friendly_name: '0x54ef4410001d828a'
invert_cover: true
#true assigns 0% to position open & 100% to position closed
#false assigns 100% to position open & 0% to position closed
While I wasn’t able to obtain the current position dynamically, you can request the position by sending a status update to zigbee2mqtt/<devicename>/get
.
{"state": ""} #get position & linkquality
This data is also available when pause action is sent to the device. Pressing physical buttons and stopping the driver won’t issue the position change message.
NodeRED-ing
It’s fine, we can work with that. It means that each time an action is executed, we have to query the device. I will do that and update the device information stored in the flow variable. That data can be used to drive the user interface.
To use the sample flow make sure you will rename all Name Device* flows as the names have to be individual for each controller. With each flow, I like to introduce new features that add interesting functions to the device to keep it fresh. I try to keep the number of 3rd party nodes to a minimum so your automation last even when the maintainer abandons the project.
This time around I have added two new features integrated directly into the code:
- toggle to open/close blinds at sunrise/sunset
- toggle to open/close blinds based on “too hot”/”too cold” conditions
In a similar vein, you can use my alarm sync project to open the blinds based on the alarms set on Android devices. The world is your oyster! Let’s play.
How does it work?
Sunset & sunrise hours are taken from my daylight tracking project. It uses a ticker and a global variable that tells my NodeRED if it’s bright or light outside. It’s a great project for all who don’t have a LUX meter to determine light levels. If you are looking for a really cool Zigbee Temperature, Humidity and Luminosity sensor – check this device out to expand your array of sensors.
Aqara can shut the blinds at sunset and open them at sunrise with a single click. The same applies to the temperature toggle. When enabled, Aqara E1 will close the curtain if it’s too hot/cold based on the selected icon setting and setpoint.
Both toggles are optional and can be removed from the dashboard when not needed. If you are looking at timer based operation, feel free to set routines up as smart assistant integration is also included.
Smart Assistants
NodeRed is good, but we need to add Alexa and Google Assistant. I’ve done that 100s times over so I will refer you to the individual articles for each assistant so you understand it deeper. I will cover changes made to keep the UI updated.
Alexa
To connect to Alexa services, I use the Alexa-Home-Skill. It’s not perfect as it lacks the blind setting, but it’s the most reliable Alexa virtual device controller. Set it up for ON/OFF and % use and use it as lights for voice commands. It means you have to tell Alexa to turn things ON/OFF rather than open-close, but you can bypass this by setting up appropriate routines that respond to open/close instead.
Information from the Alexa node is split into 2 payloads. One reacts to true/false, the other passes the numerical values over. Both payloads update the user interface and changes are visible after 5 sec in your Dashboard.
Google Assistant
To integrate Google Assistant I use Smart Nora. It’s an upgrade from Nora and the use is exactly the same as in my Nora tutorial so don’t be worried when you see a different name in the linked tutorial.
The node identifies as a blinds controller, however, it doesn’t have a control card in Google Home. You can use “Hey, Google Open X” and the payload in NodeRED is always submitted in %. This means that if you going to reverse the output in device configuration in Zigbee2MQTT you will have some translations to do.
Dashboard
I made a small card, that allows you to open/close/stop the operation and set the curtains to a specific value. If you can’t see the image for the blinds, inject the picture URL at the start and you will be ok. The flow works as is and other than the update to the device name, you don’t have to modify anything else.
I kept it in a separate group, to visualise the disconnect from the Smart Assistants updates. Each time there is an external update, it triggers local elements to update and re-issues state updates via MQTT.
Aqara ZigBee 3.0 line up so far:
- Aqara Hub M1S (EU, UK, US)
- Aqara Hub M2
- Aqara G2H Hub & IP Camera Banggood, AliExpress, US
- Aqara Camera Hub G3 UK, AmazonUS
- Wireless Remote Switch H1
- Smart Wall Switch H1
- Aqara T1 switches (UK, US)
- Aqara Curtain Driver E1
- Aqara Contact sensor (US, UK, AliExpress, Banggood)
- Aqara Temp & Humidity (US, UK, AliExpress, Banggood)
- Aqara Vibration Sensor (US, UK, AliExpress, Banggood)
- Aqara Leak Sensor (US, UK, AliExpress, Banggood)
- Aqara PIR with Luminosity (US, UK, AliExpress, Banggood)
Final thoughts
I hope the battery information will be exposed soon. Despite trying to modify the converter for Aqara Roller Driver E1, It made no difference and the battery info isn’t posting. The good news is that it works with the latest version of the Zigbee2MQTT and custom coordinator. If you have any questions about this flow, feel free to ask via this Reddit thread.
Project Download
Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.