-
Notifications
You must be signed in to change notification settings - Fork 336
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
Rule chaining #2190
Comments
What you're asking for isn't super clear to me. Can you tell me if I have the idea right?
|
Well the exact use case I'd like to cover right now would be
The color could be set regardless. I just want to prevent lightY turning on if no light was on in the first place (e.g. we aren't home or in another room) |
There's no need to set the color if the light won't be turning on. I think my rule above should actually handle your case. lightY will only be turned on if lightX was already on. Your rule ends up doing the exact same thing as mine, since the |
well. my logic failed me. thanks for that solution (still, i'm sure there are use-cases where nesting would be useful) |
Sorry, I just remembered something: If lightX is off and lightY is on, the color should still be changed,
|
I think what you really want is:
Either way, you're right that you'd currently need multiple rules to handle it, or write an external script using the Web Thing REST API to do this for you. |
@mrstegeman In theory, from version 0.10 onwards, could someone write an add-on that adds a more complex rule system? For example, one in which people could code or use blockly? Not volunteering, just curious :-) |
Yes, in theory. You'd still have to use the manual OAuth token process, but otherwise, it should work fine. |
I'm sure version 0.11 will remove that obstacle ;-) |
Hi so the Gateway rule engine wont be enhanced to support these types of use cases in the future and rule processing should be triggered outside the gateway? |
In most cases, these complex rules can be broken down into a set of simpler rules, so the functionality is already available, albeit in an inconvenient fashion. |
Got it thanks.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Michael Stegeman <notifications@github.com>
Sent: Thursday, October 10, 2019 9:32:38 PM
To: mozilla-iot/gateway <gateway@noreply.github.com>
Cc: Damian <dyoung81@hotmail.co.uk>; Comment <comment@noreply.github.com>
Subject: Re: [mozilla-iot/gateway] Rule chaining (#2190)
In most cases, these complex rules can be broken down into a set of simpler rules, so the functionality is already available, albeit in an inconvenient fashion.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#2190>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAKDYDXQ3W2X6NMFFKHC2FLQN6GONANCNFSM4I3NAVKA>.
|
Hello @mrstegeman, the inconvenience is the problem, actually, as it makes the rules page very cluttered. Simple rules would be fine if we had a way to visually group or link them, but they are just listed one after the other so it quickly becomes difficult to keep track of which rules are associated with which other ones. Regarding #2216 and this issue the inability to use more complex logic means that we have no choice but to use simple rules. So, we need either:
|
@benfrancis considering your comment on #2337 I think my suggested option 2 may be your preferred option: |
Hi @madb1lly, A long-running feature request is groups for things, so I think we should probably tackle that first. I'm not so sure about grouping rules, but a first step could be to allow users to re-order rules in the same way that you can already re-order things. That way you can at least put related rules next to each other. Again, I want to be careful about getting the right balance between simplicity and flexibility for the default rules engine UI. But there's nothing to stop you creating an add-on which provides a more sophisticated view for rules or allows more complex rules to be created. |
@benfrancis being able to reorder rules will help. Grouping things will be very useful but won't help this issue, will it? |
I want to be able to create a rule similar to this:
At 8PM turn off light X and set light Y to color . And if light X was on, turn on light Y.
I haven't found a way to do this in one rule. Two rules could be possible, but with that approach the rules view would become very full and cluttered very fast and it's not easily visible which rules belong to the same "routine"
The text was updated successfully, but these errors were encountered: