Control multiple blinds with one esp8266


#1

I followed all the steps and manage to make my blind works, however I was wondering if it was possible to control multiple blinds with the same ESP8266 chip? A servo motor per GPIO and select to which GPIO the webserver sends the command? I have four blinds covering up my backyard window and I would like to motorized all of them (worst case I can duplicate the setup four times), but I am pretty sure it is possible to only use one ESP8266. As I am not an expert in webserver and motor control, I am not sure how to communicate to different pin on the chip. Any clue, idea or suggestion to make it work?


#2

If I understand correctly, yes. You can attach 4 servos to one controller board. I would assume you will need a power supply that will satisfy the needs of all four servos.


#3

I am controlling 4 blinds with my server. You can buy four blind kits from mksmarthouse and code them separately within your openHAB setup. Take a look at mksmarthouse blinds control software and view the video and you will see how Matt setup his server for three blinds with servos. You will need to flash each of the blind’s boards separately as shown in the video. Giving each of the blinds boards a distinctive name at the time of flashing allows you to add them in the openHAB code and setup your rules to open and close multiple blinds at the same time or you could code them to open and close at different times and at different percentages. My four blinds are coded for the same time and the same percentages to open and close.


#4

I think its pretty obvious that you are able to run an infinite number of devices on a single openHAB server. He asked about controlling multiple blinds (and therefore multiple servos) with a single ESP8266, not server. am currently in the process of building a setup for large windows that have two separate blinds on them so instead of treating each blind as a different window, I am going to try and control the two blinds (and two servos) with a single ESP8266 controller. I am going to try the obviously simplest idea first and just make a Y-cable to brach off the controller to two servos. I will let you know how it works as well as add video of the setup working (if it actually works) :crossed_fingers:


#5

did you get anywhere with the Y-cable - i have 2 blinds next to each other, and seems overkill running 2 units as they will always be opened and closed together.


#6

You can go into the Arduino code and tell it which blind is on which pin. Then you can program them individually. You can have 1 ESP8266 control several blinds via the signal line but you will need to provide correct voltage to each motor.


#7

Yes, that is what I am trying to do (haven’t put much time lately), but my question is more about how to do it. How can you make the webserver to send the right pin command to the esp8266? This is where I am stuck. I tried a couple things without luck so far. If anybody has done it, it would be appreciated if you could share!


#8

I use NODMCU’s. Like 4 bucks a piece or less. They have a ESP8266 chip and the great thing about them is they are also like a mini Arduino. In your sketch under Void Setup you will need to split the incoming messages and make each a little unique up, down, stop… up1, down1, stop1… up2, down2, stop2 etc. Then replicate the void messages received and change each accordingly BUT change the pin number to match the pin that is activating the blind you want to control.

void messageReceived(String &topic, String &payload)
{
String msgString = payload;
myservo.attach(D4); //Pin Number
if (msgString == “UP”)
{
myservo.write(0);
delay(1000);
}
else if (msgString == “DOWN”)
{
myservo.write(180);
delay(1000);
}
else if (msgString == “STOP”)
ETC.

void messageReceived(String &topic, String &payload)
{
String msgString = payload;
myservo.attach(D3); //Pin Number
if (msgString == “UP1”)
{
myservo.write(0);
delay(1000);
}
else if (msgString == “DOWN1”)
{
myservo.write(180);
delay(1000);
}
else if (msgString == “STOP1”)
ETC.

void messageReceived(String &topic, String &payload)
{
String msgString = payload;
myservo.attach(D2); //Pin Number
if (msgString == “UP2”)
{
myservo.write(0);
delay(1000);
}
else if (msgString == “DOWN2”)
{
myservo.write(180);
delay(1000);
}
else if (msgString == “STOP2”)
ETC.

Its dirty and there is a shorter way of doing it but hey… It works LOL

I believe the same can be done with just the ESP8266 chip as well but you dont have as many pins.


#9

Hey gamdsIngr,

Thanks for the help, this is exactly what I am trying to achieve. I tried your solution, but I am not able to compile the code as arduino IDE won’t let me use twice the same void messageReceived(String &topic, String &payload). I am a bit confuse on how to use mqtt, I suppose I should create as many topics as I have servos, but how?

I would greatly appreciate if you could give me some more advice on how to solve my issue!!!