eg321 / esp32-motorized-roller-blinds

Control your motorized blinds with Web interface/ MQTT. Easy integration with automation systems like Home Assistant and OpenHab. 3d printing model for Leroy Merlin blinds.
https://www.thingiverse.com/thing:4093205
MIT License
89 stars 22 forks source link

Moving from my old nidayand fork #13

Open Antikillerbm opened 2 years ago

Antikillerbm commented 2 years ago

Ive done another fork from nidayand original project and still use it about 3 years. Now I want to change my 3pcs 8266 to one ESP32. The problem is I use 3 separate buttons for 3 blinds, long press - up, short - down for each I want to update everything but leave 3 separate buttons on my fancy touch panel)) Your code seems complicated, may be u can provide some help or advices, how to add extra bottons and change yhe functionality. Thanks.

eg321 commented 2 years ago

Hi,

Do you often use separate buttons to control separate blinds? I've checked different configurations and it looks like in most scenarios I do not want to control each blind separately. I'm quite rarely use buttons at all. At most cases my automation does all work (open at morning and close at evening). At other cases I'm using voice assistant to control blinds (or from mobile / PC). And here I'm control all blinds as single entity again (but can control specific blinds).

So, I suppose buttons just as backup option to control blinds when there is some issue with home automation (buttons will work even without wi-fi connection). I'm using simple 2-buttons switch with arrows: up and down. However I've implemented some additional logic to these 2 buttons:

  1. Short press - move up/down to the limit. Another short click will stop movement.
  2. Long press - move up/down until button pressed.
  3. 5 quick clicks to reboot device.

You can find this code here: https://github.com/eg321/esp32-motorized-roller-blinds/blob/master/src/main.cpp#L302

Antikillerbm commented 2 years ago

Actualy u right, is not often at all. Why I made 3 buttons, because after automations done with blinds, every peice can stay in different position. Logicaly is not right, you push the button and all curtains start moving in the same direction, regardless of the difference in their positions. Better if they align position firs then move together.

eg321 commented 2 years ago

Logicaly is not right, you push the button and all curtains start moving in the same direction, regardless of the difference in their positions.

Sorry, can't agree with you here. Short click at my FW means "full open/close" command. So, all blinds are trying to get their final state asap. Not sure if I want to wait while single blind is going to position of another 2 blinds, before they all will going down. But visually it will better, I think.

Probably such movement strategy can be realized as option:

  1. Move all blinds ASAP.
  2. Align blinds and then move them only.

Someone will prefer first option, and someone second one. I can't promise you to implement that feature, but I'm always open for Pull request. You're welcome to prepare such changes in your fork and propose them as Pull request.

Just as workaround for current movement strategy: you can up all blinds and then move it down together.

Antikillerbm commented 2 years ago

Yeah, technically u get more light in less time, but total openning time will be equal. First i will update software without any changes in hardware (so i need to leave only one button for one device) because with my current firmware, access getting lost until reboot, after wifi down for a while. Btw does your OTA compatible with nidayand original OTA? Or i need wire it up for flashing?

eg321 commented 2 years ago

It's the same Arduino OTA protocol. So, most probably, yes, it should be compatible, but I've not checked such upgrades.

Antikillerbm commented 2 years ago

Ok, Thank you for quick replies, I will work on soon, let's see how it goes