[RELEASE] ESP8266 / Arduino servo controlled smart blinds

Controlling the blind from Alexa isn’t working without using a simulated dimmable light and syncing using WebCoRe. I think I’m on to the reason as for why. The ST device “recently” tab log is showing that the commands from Alexa came through successfully and it even sets the device to On and the level to the correct level but I get no activity from the actual device until I touch the level slider in ST even just to adjust 1%. In the “recently” log, the only difference between the Alexa command and the ST command is that Alexa is adding a decimal point to the level. For example, instead of “Level is 76”, it sends “Level is 76.0”. Since there isn’t a way to change the Alexa side, is there a way to change the DTH to accept a tenth of a percent as a valid command? I guess my simulated device is accepting it and then WebCoRe is repeating it in the correct format and that’s why the WebCoRe hack works. This should be a repeatable issue for anyone else trying to control their Blinds with Alexa if I’m correct. Is anyone else able to control with Alexa?

Yes. The issue is that the Ardiono code is only able accept numbers in a particular format because it is set up for each percentage as a json endpoint. It might be easier to fix the Arduino code than the Alexa control. The lines in the Arduino sketch you would want to adjust are:
server.on("/100", []() { server.send(200, "text/html", webPage); setting = 180; });

You would want to add another line that says:

server.on("/100.0", []() { server.send(200, "text/html", webPage); setting = 180; });

I don’t know how you would format in the DTH but I’m sure someone does. For now, I think that work around is better than a simulated dimmer.

I’ve been looking for a while to encorporate these with the ST_Anything code by @ogiewon. It seemed so perfect. The board is already right next to my window…why not add a contact sensor to it? Why buy a whole other sensor when I can by a cheap hardwired contact sensor and hardwired motion sensor and wire them to my board. I’m not a programmer by any stretch of the imagination but I know more than the average bear so I gave it a try. And after many failed attempts, I’ve finally come up with a sketch that seems to work with the NoceMCU and Wemos boards. It allows you to use both the ST_Anything functionality along with the servo controlled blinds. I have an example sketch which only uses two of the capabilities of ST_Anything, but you get the idea. Now, there’s probably a lot of extra stuff in here I could clean up but when I started to the sketch would no longer compile, so I figured, if it ain’t broke…

1 Like

I can not get wifi to work. How I fix it.

I’m sorry, I don’t understand your question. What is happening? Your esp won’t connect to your wifi? Are you sitting your WiFi ssid and password in the sketch?

Yes I I’m. but the SmartBlinds.ino Will not connect to my Wi-Fi.

22:24:08.080 -> 1384, room 16
22:24:08.081 -> tail 8
22:24:08.082 -> chksum d
22:24:08.083 -> v3de0c112
22:24:08.084 -> ~ld
22:24:09.835 ->
22:24:19.748 -> wdt reset

wemos d1 esp8266 servo
I can not get code to make a servo work for me in smartthings.

You have to use v2.2 of the ESP8266 board library to get it to work.

How do I check what version I have?

Well I’m actually looking to do is is make a Servo go 180 degrees to open the vent. Then go back to zero to close the vents. We’re talking about a HVAC air vent. I’m not at programmer by any stretch of the imagination or Hardware designer.

Go into your board manager and find the ESP8266 library and it will be listed. There’s a drop down to select the version you want to use.

I do not see the ESP8266 v2.2? Can some one remote access my computer to help me fix it?

No, this is not support, this is a user forum. You are using the Arduino IDE? If you are new to programming this might be a bit too complex for you to accomplish with your first project. There are a ton of guide out there on the Arduino IDE and how to install the esp8266 community developed board profiles. I would look at some of those and get familiar with the Arduino IDE before trying to work on this project.

I jest got it to connect to Wi-Fi.

Okay. You didn’t answer any of my other questions so I’m going to assume you’re good. Also, FYI, please don’t post the same question in several different posts on the same day. if you don’t get an answer in a few days then by all means post away. But it makes thing really messy for the rest of us when you post the same question 5 times on the same day.

Yes I’m using Arduino IDE. I’m a newbie to programming with SmartThings.
How do I the test Blinds. To see if it talk to SmartThings?
I have installed esp8266-adjustable-blinds-beta.groovy

I’m sorry but you that is a very lengthy how-to which is already listed in the beginning of this post. Good luck.

1 Like

I hope people are still active on this post :slight_smile: Love the program so thank you for your work on this! I have an issue though, I upload the code to my ESP8266 but then I cannot get it to connect to the wifi, it just gets stuck in a loop, I have serial printed the Wifi status and just seem to get a value of ‘6’ instead of WL_CONNECTED

Anyone have any ideas? really keen to try this out!
Thanks in advance.

What version of the ESP 8266 board library are you using. Try 2.2. That’s the one I had to use.

Are you talking about the link that gets added in board manager? Or something else?

That did the job! Thanks so much!

1 Like

I can’t believe I just found this. I think this box is the missing link for me making my own blind automation stuff finally work! Thanks!

1 Like