Search
  • robot astronaut

Home assistant automated blinds Part 2


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

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

L298N Motor Driver

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 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


https://www.buymeacoffee.com/mellowfire



56 views0 comments

Recent Posts

See All

Zippy