-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interlock by software. Controling blinds, curtains or motors #1510
Comments
Finaly I can test it, fixed a bug in last proposal. I test this one and works well. Only one relay on and at lest 500 ms between relay "x" off an relay "y" on:
|
|
Yes I see now. Finaly I upgrade the proposal controling the case of FloodWindow delay "off", that could makes a two relay on.
I test a lot in sonoff T1 2ch without problem. |
Also, I wan't to ensure that no change in the sync mode occurs accidentaly, via web for example. I haven't fount a way to disable it in the setting or via flags, so I add to my code:
Then every time relay must chage verify if the RELAY_SYNC was initialy configured as NONE_OR_ONE, eventhougt it was changed via Web or other, reassing the original NONE_OR_ONE and save this Setting. I create two new env. for blinds:
|
@xoseperez Has anything happened regarding this issue? |
No, I'm planning to add it to |
Sort-of on topic. This line bothered me for some time, since "49 Days Later" current_time becomes 0. Logic-wise, it delays a bit and things sort of work anyways, but I think the struct needs a different way to manage delays: espurna/code/espurna/relay.ino Line 370 in 2f6d3ec
This should be fixed by storing current_time on the struct instead of required change_time and comparing applied delay (ON, OFF, flood) as would any other timestam would be compared:
ATM I am just playing with this approach, but it should be trivial to add additional delays for sync mode. As I understood it, the thing we want is to make relays switch sequentially instead of operating on a single timer for ON / OFF. |
@oscarsan1 looking at your requirements again, wouldn't just adding DELAY_ON=500 for each relay force this to happen? Per #1962 (will push update, nvm current offsets for change_delay when syncing), only issue is uncertainty that loop() timeouts for synchronous ntp, mqtt etc. will force both to happen simultaneously when relay loop function finally starts again. Rough solution is to recalculate change_start time after relayProcess function finishes, making delays relative to each other instead of depending on when relayStatus(N, true) + relaySync had happened. Another problem is that while we only want this delay to happen if any other relay is ON, user probably expects no delay when both are off. In case of sub-second delays, perhaps it is overly precious, but #161 (comment) noted one of such use-cases |
Hi. |
If you have comments regarding the PR, feel free to use inline review tool right there in the code (see blue plus sign near the line numbers, when hovering over it) And yes, right now delay time will be updated after each relayStatus call if target status stays the same or cancelled if current_status == status of the function. e.g. you can send ON via mqtt, delay on kicks in for 10000 ms as an example, and while it happens you can send OFF to cancel. So does this mean we need to have a single constant delay value? Or should delayOn and delayOff change meaning depending on sync mode? |
Going on with issue:
Interlock by software on Sonoff T1 2 gang, or Sonoff Dual
#491
When control curtains or motors with T1 2 gang I'm afraid of this ms that two realys are on. Is safer to take some time to switch off before switch on the new relay. This time is also good for the motor to stop moving before start in the other direction. Also relays offen takes more time to switch off (15ms) than to switch on (5 ms).
I propose to modify "void relaySync(unsigned char id)" in the case of RELAY_SYNC_ANY
This will work?
The text was updated successfully, but these errors were encountered: