Creating conditional AND triggers is currently a bit complex since Automate is so low-level.
I'am still trying to come up with an easier solution, but here are some examples on how you can currently make them:
Time AND place
This example is using the “Nested Fork” method, it’s using the Time window and Location at blocks, but it could be any conditional blocks. The most battery consuming condition should be the most nested.
If the [time AND place] blocks are performing any length operations you may need to Fork it since it could otherwise be aborted by the Fiber stop block at any time.
:
+-----------+-----------------------+
| | |
| When in time window? -----+ |
| | | |
| Fork -----+ Fiber stop |
| childURI | childURI |
| | | | |
+-----------+ | +------+
|
Is at location? ---+
| |
+----------+ |
| | |
| [time AND place] |
| | |
| +-----------+
| | |
| When at location? --+
| |
+----------+
Using the Variable give & take blocks
Coming soon.
Creating conditional AND triggers is currently a bit complex since Automate is so low-level.
I'am still trying to come up with an easier solution, but here are some examples on how you can currently make them:
Nested Fork method
This example is using the “Nested Fork” method, it’s using the Time window and Location at blocks, but it could be any conditional blocks. The most battery consuming condition should be the most nested.
If the [time AND place] blocks are performing any length operations you may need to Fork it since it could otherwise be aborted by the Fiber stop block at any time.
:
+-----------+-----------------------+
| | |
| When in time window? -----+ |
| | | |
| Fork -----+ Fiber stop |
| childURI | childURI |
| | | | |
+-----------+ | +------+
|
Is at location? ---+
| |
+----------+ |
| | |
| [time AND place] |
| | |
| +-----------+
| | |
| When at location? --+
| |
+----------+
Queue method using the Variable give & take blocks
Example coming soon.
* Create a flow with a "flow begin" block and one or more "result" blocks
* Turn that flow into a block
* Place that block in other flows
* The "begin" and "result" blocks become connectors
Then you can build complex logic into simple blocks and reuse them.
As for waiting for multiple events, a "join" block would be useful; it proceeds once another (specified) fibre finishes or is stopped. Or you can test whether the other fibre is still running.
start
|
fork
/ \
/ fork
A / \
B C
A: check place and set global variable place, repeat
B: check time and set global variable time, repeat
C: if Gvar_time and Gvar_place ....
The concurrency method seems more complicated.
?