-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Allow trigger conditions evaulated with more boolean logic, and allow actions to be performed when condition evaluates to false as well as true #2770
Comments
Right. Most simple usecase is mapping of a simple tally input (boolean feedback or variable from mixer etc.) to a tally output (camera tally input, lamp etc.). Today this simple operation is surprisingly complicated and needs at least two triggers for each tally channel for "on" and "off" without any further logic as already mentioned. What is still missing (or is not obvious how it should work) is a simple direct mapping of a boolean state from feedback or boolean variable to true and false actions in one operation. |
Both Companion and Tally Arbiter are amazing projects. It would be really good if they could be combined together to get the Logic from TA to be added to the all switchers and camera modules in Companion. Like Feedback to the devices over connections. This could make tally very easy and make Companion even better. Could there be a wizard for trigger to auto create the Tally stats. IE List all switchers and list all cameras and there numbers. So in the triggers is auto does tally Red / Green on ATEM 1 and Green only Tally on Panasonic RP150 (PTZ Camera controller) |
@Julusian I think there is some cross-over, and sorry I didn't find them, I was searching for things related to triggers. There are some differences, which I think are as follows:
|
With the condition You can compare and check as many variables as you want and tie all the evaluations with boolean logic. I admit that the only boolean operators are AND, OR and NOT. NAND and XOR would have to be expressed with them. |
Unfortunately, this does not really help in terms of complexity, as it does not reduce the number of entries. A single "Evaluate input condition" with two output branches is missing here: "If value (becomes) true, do this" and "If value (becomes) false, do this". It would also be very useful to be able to use Boolean feedback directly as input instead of always having to use comparatively complicated variables. The actual data type or value range is often not clearly recognizable for the user and differs from module to module. Of course, all of this is currently possible, but it is surprisingly complicated and not intuitive to realize, for example, a very simple direct tally assignment of a mixer input to a camera. |
My thinking for this (and more generally for #372 and #1052) is based around home-asssitant: Which basically needs us to implement some building blocks such including:
An argument could be made for also adding some 'when condition is false' actions to triggers, but the same can be achieved by using the if/else instead. Perhaps something else to think about is a way to use a feedback in an expression, through some temporary local variable. |
For reference the #1 thing I use XORs for in that kind of system is turning momentary inputs (ie GPIs) into latching states; which is a common task for me. |
+1 for an "Else Action" Event is true -> |
Is this a feature relevant to companion itself, and not a module?
Is there an existing issue for this?
Describe the feature
At the moment all Trigger conditions are combined with Boolean ands. We could create more sophisticated triggers by allowing other Boolean operations (OR, XOR, NAND, NOR, XNOR).
Similarly actions are only performed when the conditions evaluate to true, allowing a separate set of actions to be performed when they evaluate to false allows more efficient programming of two-state operational conditions.
An example of this is in the Stagetec Nexus routers I use. While the UI looks old, it allows using up to 4 input conditions combined with 3 Boolean operators, and the four actions can be either on true or on false. The evaluated logic can then be an input condition for other logic allowing for more complex or efficient programming.
I have attached a screen shot for reference.
Usecases
More efficiently create complex actions, state machines etc. Especially for things that need to toggle, or where behavior similar to a radio button (XOR) is required.
The text was updated successfully, but these errors were encountered: