-
Notifications
You must be signed in to change notification settings - Fork 333
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
Flip-Flop Implementation? #694
Comments
Currently the rules engine shows properties for web thing types, but not the ability to track or trigger an "action". The onOffSwitch thing type definition has an "action" called "toggle" which changes its "on" property to the alternate state. The onOffLight does not have such an action in its definition. Maybe it should? It seems that the type of rule you describe wanting would work if the toggle action of one device was tied to the toggle action of another device. If a pushbutton is attached to GPIO 18, then instead of defining it as an onOffSwitch, I would rather see a new thing type defined that better describes how a pushbutton works. A pushbutton "toggle" event would be triggered by "off-on-off" (low high low) changes in voltage on the pin, not a simple off-on or on-off (low to high, or high to low). Even without a pushbutton thing type, you could detect the pushbutton off-on transition (by detecting the "on" state becoming true). What's missing is an onOffLight action of "toggle", and the rules engine allowing you to select an action as the triggered event. |
Thank you for the explanations. I know Rules are at an early stage of beta. An action is just a change of state. The priority of state over action should be clearly documented to avoid any misunderstanding, as On the screen-shot below, the rule says So adding How do those explanations match with the example provided in #693? |
@mrstegeman The ticket has been changed to closed then done.
Thank you! |
I do this exact thing with some lights in my house, using a Flic button.
|
Exactly! Apologies for the lack of comments. |
No problem, I posted the screen-shots so other users can share the solution. Actually, the solution is provided by the rule engine that accepts multiple conditions. I didn't know the rule engine offered that feature. I discovered it today. Maybe room for a pointer to the rule engine documentation? |
For coming visitors: look at section IV. Rules: Automate Your Home
|
Note that this approach can lead to infinite loops if both conditions are properties. So it is important that one of them is an event (and I think that I infact had a ticket open for events being able to still cause momentary loops) |
Yes, I am not fully happy with this solution.
This is similar to issue #693 Question: Do Rules Transfer State or Action and thread
|
@rei-vilo All of that is entirely dependent on the device and add-on. |
I have the following configuration:
I would like to toggle the LED with the push button acting as a "flip-flop", e.g.
How to achieve that? How many rules, and which ones, do I need to define?
This question might be related to #693.
The text was updated successfully, but these errors were encountered: