Any http request flow cards that work with a homey pro 2023?

I need to post a json file from my homey to a webhook… any ideas how to do this one a homey pro 2023? This one doesn’t seem to work on the new homey pro;

Use the built-in Logic card to make HTTP requests:

2 Likes

Ah haha so simple… thanks!

Is there. way to act on the result from a HTTP request?

With AdvancedFlow you get the result as token and you can parse it with JSON logic cards.

1 Like

Could you show me a simple example how to do that? I want to request data from the public API of aWattar (https://api.awattar.at/v1/marketdata) and then parse it. I have the advanced flows active, but can’t figure out how this works. (Got my Homey Pro yesterday, so still super-newbie)

1 Like

Hi,
you can add the JSON card after your http card (that return a JSON as result).

Examople JSON:

{ 
  "Time":"2023-07-13T09:05:42",
  "STROM":{
    "Total_inZ1":32931.5000
  }
}

Then add the path to your needes element to the JSON card (in thi sexample first element is “STROM” and next element is “Total_inZ1”. Concatenated with “.” use this as path in the JSON card. :
grafik

For the first input parameter you have to select the result from the connected http card result.

1 Like

How to add more than one header? Comma separate them?

Any chance this can be done without advanced flows?

This in an AdvancedFlow card :man_shrugging:
You only need to install HomeyScript app in addition.

Use line breaks (Shift + Enter in advanced flow)

1 Like

Hi all, is there any way, how to get temperature to for example virtual device from regulator of my tiled stove heater’s regulator? It does not have any other data output than http…
When i go to http://ipaddr/temp.xml i get this
xml

And i need temp1 and temp3 value to be periodicaly updated somewhere in homey, best i think will be virtual device, that i can use it in flows.

Thank you, Vitek

You can convert xml to json

Hi

embeddeddatasystems app only works for Embedded Data Systems xml.

@vikino but it should not be to difficult write a nother app or a homey script that converts your xml

1 Like

Yes, i found that it should be possible, but as im not a programmer, im lost… :frowning:

First create a virtual device, select the sensor class, and select that it has a temperature. Then create the following flow (sorry for the German label):

  • The leftmost card triggers this flow every 15 minutes. Use whatever time interval you need there.
  • The second card retrieves the content of your webpage: use GET as method, enter your URL and leave “header” and “body” empty
  • The third card use a small Homeyscript to get the temperature out of the content of your webpage. Use the Homeyscript card that takes an argument and returns a number-tag. Copy the following code into the card:
// Get TEMP1
return parseFloat(args[0].match("<TEMP1>(.+?)<\/TEMP1>")[1]);
  • The last card then sets the extracted temperature as sensor value of your virtual device.
1 Like

Thank you very much for your time!
Seems to be half-working, im stuck at third card where i dont know which argument to set, you have antwort, from my Czech-German-English translation should be Response, but cant find any such argument…

1 Like

It should be “result” - maybe you have to scroll down a bit. Did you click on the little symbol at the right end?
grafik

Then you should get a list of all available tags. The correct one should be in the category “Logic” and is the one where the symbol at the Homeyscript card lights up in blue like here:
grafik

I got it…there are two same Logics when adding card, but only one of them has got as output “Response”, the other not…
So it works! Thank you very much!

No luck with Logic…
When i created new variable, Logic group is now in list and i have chosen Response,
now im getting error: Not Found: FlowToken with ID homey:manager:logic:1afbaab9-faba-4da1-b475-0a108430e855

I got it…there are two same Logics when adding card, but only one of them has got as output “Response”, the other not…

Yes, I stumbled upon that too. You have to use the “HTTP” card.

No luck with Logic…
When i created new variable, Logic group is now in list and i have chosen Response,
now im getting error: Not Found: FlowToken with ID homey:manager:logic:1afbaab9-faba-4da1-b475-0a108430e855

What logic are you referring too?