Calling an external service and receiving the Response in a variable?

Hi all,

Sorry for this delayed response, but I had to find some time for it.
There are several ways to build the flows @Jef_van_Leeuwen requested.
Because he wants to map multiple values from the same HTTP response it’s best to make 2 flows with combine cards GET JSON trigger object (A24), JSON object (T81) and JSONpath Better Logic (A80).
(Native Homey logic support is in development, but for now we rely on BetterLogic for storing variables).

When in doubt validate your JSON values for flow cards with jsonlint.com. Check your JSONpath expressions with jsonpath.com. If you’re using JSONpath expressions on XML responses, be aware of the XML to JSON conversion. This conversion can be simulated on RunKit.com with the xml2js module.

The first flow will do a get request. The returned response will be available in the JSON token on the trigger of the second flow.
In the second flow this JSON token can be used in the action cards, where the desired value is queried by JSONpath and put in Better Logic variables.

Preparation - Define Better Logic variables:
image

Flow 1 - Request (poll every hour):
2019-04-30%2020_05_06-Homey%20Flow

Flow 2 - Extract values and map to Better Logic:
Flow 1 triggers this flow because of the matching trigger-name ‘MonitorUpdate’

1 Like