Mellow_labs
19 supporters
Home assistant automated blinds Part2

Home assistant automated blinds Part2

Feb 28, 2021

This tutorial is a follow-up to the first one which you can find here: https://www.buymeacoffee.com/mellowfire/home-assistant-automated-blinds

Last time we managed to get the blinds rotate, this time we're going the extra mile and making them fully open and close.

Parts list

DC 12V High Torque Motor: https://www.amazon.co.uk/gp/product/B0752ZY6YW/ref=ppxyodtbasintitleo03_s00?ie=UTF8&psc=1

L298N Motor Driver: https://www.amazon.co.uk/gp/product/B07H76LH76/ref=ppxyodtbasintitleo03_s00?ie=UTF8&psc=1

I spent a while trying to find a pulley to hold onto the nylon rope that comes with my blinds. Eventually I gave up and just designed my own; after a few days of testing and redesigning I finally had something that had a good grip on the rope, without damaging it. https://www.thingiverse.com/thing:4776585

Now to the electronics, we're going to start off by removing a part we've added last time the buck converter. Simply, we don't need it anymore the L298N Motor controller for the DC motor converts 12v to 5v. Which we can use to power the D1 mini and the DRV8825 so following the diagram; remove the back converter, wire up the L298N and the 12v DC motor. Now let's move onto the code!

Luckily, DrZzs has already done the code for the DC motor for us. All we have to do is merge it together with the code for the stepper motor, and uploaded to the D1 mini.

Here is my merged code: https://github.com/FireMarshmallow/ESP-home-blinds/blob/main/blinds%20v2

We don't have to install anything fancy to get the integration into our dashboard this time, we just need to add it to a card.

Now let's mount the motor to the wall... Once again using command strips, be sure to add a fair amount of tension onto the motor; otherwise the pulley won't get a good enough grip on the rope.

Now we have to calibrate the motor. Unlike the stepper motor, the DC motor can't keep track of the steps so the measurement of how long it takes to open and close is done in seconds. So using the motor from the closed position count how long it takes to open the blinds. And repeat for the opposite way. Then change it in the code under:

  • open_action:

  • - switch.turnoff: shades2

  • - switch.turnon: shades1

  • - delay: 25s <----

  • - switch.turnoff: shades1

  • close_action:

  • - switch.turnoff: shades1

  • - switch.turnon: shades2

  • - delay: 25s <----

  • - switch.turnoff: shades2

And that should be it! Your blinds now go BRRR.

In the future I'm planning to add some end stops, but for now it works fine.

If you enjoy or even have suggestions for my projects & would like to support me please consider Buying me a coffee

Enjoy this post?

Buy Mellow_labs a coffee

More from Mellow_labs