Page 1 of 1
ESPeasy - plugin for Shutters and Blinds
Posted: 11 Apr 2021, 16:47
by jgrad
Hi,
just asking if there is any plugin in ESPeasy to offer functionality for controlling Shutters and Blinds like such module in Tasmota.
BR.
Re: ESPeasy - plugin for Shutters and Blinds
Posted: 11 Apr 2021, 20:52
by TD-er
How are the shutters and blinds controlled?
Via a stepper motor? Or a servo? DC motor with limit switches?
Re: ESPeasy - plugin for Shutters and Blinds
Posted: 12 Apr 2021, 09:03
by jgrad
shutters are controlled by relay (one relay for UP, one for DOWN), motors are AC, motors have build in end switches.
Re: ESPeasy - plugin for Shutters and Blinds
Posted: 12 Apr 2021, 09:19
by TD-er
Sounds like something you can do in rules.
Something like an event to move up or down.
- Check variable to see if some action is already active (if active generate event as if the limit switch of that action was triggered)
- Set a variable to know we're waiting for the opposite limit switch
- Start monitoring on opposite limit switch
- Toggle GPIO to trigger relay for desired direction
On the event trigged by the opposite limit switch:
- Stop motor
- Stop monitoring the GPIO
- Clear variable
Re: ESPeasy - plugin for Shutters and Blinds
Posted: 12 Apr 2021, 13:59
by jgrad
limit switches are not "available" for ESPeasy - they just protect roller shutter to prevent physical damage if power supply on motor is connected to motor to long. Implementation shall be based on "roller shutter travel times".
I tried to implement logic in rules and actually implemented logic. It is basically functioning but there are drawbacks:
* it is impossible to store current position of shutter (for case of power supply outage) - recalibration is needed at every boot
* timings for tracking current position of shutter are not granular enough within rules (1000ms timer is not always 1000ms)
* implementation within rules takes a lot of code which consumes resources and this impact resources which impact that timer is not accutate (eventhough most criticalr routine for 1000ms timer is at the beginning of ruleset1)
Re: ESPeasy - plugin for Shutters and Blinds
Posted: 12 Apr 2021, 14:58
by TD-er
I do agree with the timing issues in rules parsing.
However even when you act on the GPIO pin directly you do not have a guaranteed response time on an action as some plugins temporary disable interrupts to get proper readings.
Also WiFi related code may operate on a higher interrupt level which also can cause issues where response time is critical.
So I guess you should have some logic in hardware to immediately stop the motor when a limit switch is reached.
You could (should) then still allow for activating the motor in the other direction to be able to get away from the limit switch again.
This can be done with a simple "AND" switch config, by setting a normal closed switch in series with the control pin of an H-bridge.
So you cannot rotate the motor in the direction where the limit switch would stop it, but you can use it in the other direction.
Really timing critical things cannot be done with an ESP, unless you create a really dedicated task for it and disable everything else (even WiFi).
Re: ESPeasy - plugin for Shutters and Blinds
Posted: 12 Apr 2021, 20:29
by Patou
Hello
I realise an application for shutter with limit switch shutter closed, limit switch windows open and 2 buttons up and down
Please had a look at this post
viewtopic.php?f=4&t=8145
Have a nice evening
Patou