Further to this posting: viewtopic.php?f=6&t=8616 I played around a bit with the b4a tool and am able to send and receive data to Automagic flows via broadcast intents + extras.
Here is the Automagic flow I setup to receive a broadcast, then send a response:
The flow trigger type is: "General Broadcast", and it receives the extras data into the AM variable "param1":
After it receives a broadcast it pops up a message dialog with the extra info received.
Finally, it sends a broadcast intent with data:
Demo Automagic <-> b4a data exchange
Moderator: Martin
Re: Demo Automagic <-> b4a data exchange
Part II...
Using the b4a "designer" + IDE I created an app that has buttons to call Automagic Flows (i.e. to run the turn on/off light flows), a slider who's value is sent when the "Send" button is pressed.
When you press "Send" it sends a broadcast intent to Automagic with the value of the slider. The Automagic flow is triggered and a message dialog is displayed with the value of the extras:
When you dismiss that dialog, the flow then sends a broadcast intent which gets picked up by b4a and is displayed in a msgbox:
The code for the b4a app can be viewed/downloaded here: https://pastebin.com/ZFadNCUw
Hope someone finds this useful!
Using the b4a "designer" + IDE I created an app that has buttons to call Automagic Flows (i.e. to run the turn on/off light flows), a slider who's value is sent when the "Send" button is pressed.
When you press "Send" it sends a broadcast intent to Automagic with the value of the slider. The Automagic flow is triggered and a message dialog is displayed with the value of the extras:
When you dismiss that dialog, the flow then sends a broadcast intent which gets picked up by b4a and is displayed in a msgbox:
The code for the b4a app can be viewed/downloaded here: https://pastebin.com/ZFadNCUw
Hope someone finds this useful!
Re: Demo Automagic <-> b4a data exchange
This is AMAZING :thumbup: Thx for sharing it.