Event bus for flows
Event bus for flows. Allows flows to: * send events as an action * trigger on events
What are events?
Events are messages to indicate that something has happened. Events have a (user-definable) name, and optionally a value.
Why not use Logic’s “a variable has changed”?
Logic’s “a variable has changed” works well for switches, but not for buttons: buttons are unary (it only has one state, “pressed”), whereas switches are binary (typically two states, “on” or “off”).
If you have a device that has buttons, and you are triggering on a button press, there is no specific value that you can set a variable to to indicate that the button is pressed. You either have to set the variable to some random value or use Better Logic’s “increment a variable’s value” action (or something similar).
Why not use “Start a flow”?
I have a bunch of cheap 433Mhz remote controls, for which I have created some simple “trigger” flows: “If button 1 of remote A is pressed, emit event trigger-remote-a-1”.
Whenever I want to assign an action to a particular button, I create a new flow: “If event trigger-remote-a-1 is received, turn on coffee machine”.
This decouples a specific remote from a specific device, making it easy to re-assign remotes and devices (or be more flexible in general).
1.0.0 (2018-03-12): - Initial release