https://github.com/robertklep/name.klep.flow-event-bus
Homey app to implement a flow event bus
https://github.com/robertklep/name.klep.flow-event-bus
Last synced: 9 months ago
JSON representation
Homey app to implement a flow event bus
- Host: GitHub
- URL: https://github.com/robertklep/name.klep.flow-event-bus
- Owner: robertklep
- Created: 2018-03-12T10:48:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T13:23:52.000Z (over 2 years ago)
- Last Synced: 2025-02-15T02:43:05.469Z (over 1 year ago)
- Language: JavaScript
- Size: 79.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flow Event Bus
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"_?
Because using events makes decoupling easier.
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.
With events, you can also filter on specific event values, something that's not possible with _"Start a flow"_.
### Changelog
1.0.0 (2018-03-12):
- Initial release