Skip to content
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

Ability to link relays ([de]activation of a relay will [de]activate another) #11

Closed
kizniche opened this issue Sep 9, 2015 · 3 comments

Comments

@kizniche
Copy link
Owner

kizniche commented Sep 9, 2015

Feature request: When one relay is activated, one or more other relays are activated. This permits the PID controller or a conditional statement could activate more than one relay.

Consider the following simple relay configuration to illustrate the utility:

Relay 1 (Fan), GPIO 10, Link Relay 2 (when Relay 1 turns on, Relay 2 does also)
Relay 2 (Heater), GPIO 15

Relay 3 (Fan), GPIO 10, Link Relay 4 (when Relay 3 turns on, Relay 4 does also)
Relay 4 (Cooler), GPIO 20

Notice that the same GPIO can be set for multiple relays, which can produce a number of conflicts.

What if the same GPIO is trying to be turned on for different durations?
How do the threaded functions to turn on the relays communicate with each other and select the longest duration?

@kizniche
Copy link
Owner Author

Added in v3.5.73, commit 9eecb09

@kizniche kizniche changed the title Ability to link relays (activation of one relay will activate one or more other relays) Ability to link relays ([de]activation of a relay will [de]activate another) Sep 11, 2015
@kizniche
Copy link
Owner Author

What if the same GPIO is trying to be turned on for different durations?

I'll leave it to the user to not create conflicting conditional statements (i.e. I'm not putting in checks for all the possible crazy combinations).

How do the threaded functions to turn on the relays communicate with each other and select the longest duration?

With this iteration, they don't. It's whichever gets to the function first.

Consider this scenario:
Send first command: relay 3 on for 20 seconds.
relay 3 turns on for 20 seconds
Send second command (5 seconds after the first command): relay 3 on for 60 seconds.
Second command returns error that relay 3 is already on and does not extend the time on to 60 seconds.

I'm reopening this issue because this should be a high priority to fix. The solution is to extend the on duration.

Before activating any conditional statements or PID controllers, it's advised to thoroughly explore all possible scenarios and plan a configuration that eliminates relay conflicts. Then, trial run your configuration before connecting devices to the relays. Some devices or relays may respond atypically or fail when switched many times in rapid succession. Therefore, avoid creating a condition for a relay to switch on and off in an infinite loop.

@kizniche kizniche reopened this Sep 11, 2015
@kizniche kizniche added the bug label Sep 11, 2015
@kizniche
Copy link
Owner Author

Issue fixed in commit 6e4a793

kizniche pushed a commit that referenced this issue Nov 18, 2015
Update from kizniche/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant