[APP][Pro] HTTP request flow cards - HTTP request triggers, conditions and actions for flows

You only need to set the Method (to GET) and the URL. Leave the other fields empty.

1 Like

Doesn’t work unfortunately, but I do love these errors :joy:

falsy

If I just run the url with curl it works fine (curl -k ‘https://router-ip/cgi-bin/luci/command/cfg099944s’).
Enables and disables my adblock just fine. It does mention javascript in the output, can Homey run javascript?

Oh hang on, you’re using -k so I assume that your router is using a self-signed certificate. That’s probably the reason the flow card doesn’t work. Isn’t it possible to access the URL through http://?

Otherwise it’s going to be difficult to get it working. You can sort-of run JS through Homeyscript, but it very likely it will not accept a self-signed certificate either. Another possible solution might be the HTTP request flow cards app, but again, not sure how that will deal with self-signed certs.

Yes I am. I have a signed certificate for my WAN interface, but exposing my router to the internet just to be able to toggle my adblock is madness. But … you may have given me an idea. I could do a port forward to my router and set a firewall rule to only allow access to Homey. Or I can set my router back to http of course.

A port forward would only work if your router supports hairpinning, and if it does, it probably won’t be able to differentiate if the request was made from Homey or any other device on your local network (but perhaps that’s acceptable).

Perhaps the router can run both HTTP and HTTPS at the same time?

Yeah, that’s the way easier solution :rofl:

Did that, works fine now. Thank you for your quick and extensive help.

Hello,
I want to using the openHAB REST-API for control my shutter.

This statement is my mission to rebuilt with homey:

curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "DOWN" "http://openhab:8080/rest/items/RaffstoresAlle"

I tried it with the following:

URL:
{"method":"post","protocol":"http:","hostname":"openhab:8080","path":"/rest/items/RaffstoresAlle","headers":{"Content-Type":"text/plain","Accept":"application/json"}}

Data: I tried the following:

"DOWN"
["DOWN"]
{"DOWN"}

I always get the following error message:

Promise was rejected with falsy value

Can someone help me? :slight_smile:

At the moment I setup a small lighttpd server with a php script on my pi which sends this commands and only use http flow cards to issue simple get_requests, which works.

But nevertheless I’m interested how it works directly from homey :slight_smile:.

That should be "hostname":"openhab","port":8080

As for the data, perhaps just DOWN (no quotes).

1 Like

Thank you! But when I try:

{"method":"post","protocol":"http:","hostname":"openhab","port":8080,"path":"/rest/items/RaffstoresAlle","headers":{"Content-Type":"text/plain","Accept":"application/json"}}

I get an error message:

Flow Card Error: 400

grafik

Do you know why?

Perhaps use POST instead of post. Or do try quotes around the text ("DOWN").

Also doesn’t work :frowning:. Tested it with POST and:

DOWN
“DOWN”
(“DOWN”)
{“DOWN”}
[“DOWN”]

I tried a few things as well, and it looks like the app doesn’t allow you to send raw POST data (it has to be a valid JSON object).

Instead of using the HTTP Request Flow Cards app, it might be possible to get it working using the “Make a web request” card from Logic, which would look something like this:

However, I’m not sure if it will accept any response data, so if you rely on that, it may not be a workable solution.

Yes that works great! Thank you very much and have a nice evening :slight_smile:.

Just a quick question. What’s the benefit of using the app instead of built-in webhook feature?

Cheers, Tom

None, unless you need the geek functions like json extraction and http options.

Hi there, I encouter problems with the Body request parameter ‘’‘grant_type’’. Can HTTP request flows work with Body request parameters / URLSeachParam? What is the syntax in a flow for this?

This works on a Advance Rest Client:

curl “https://oauth.cleargrass.com/oauth2/token”
-X POST
-d “grant_type=client_credentials”
-H “Authorization: Basic el92ZzI4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxDZlZDY5”
-H “Content-Type: application/x-www-form-urlencoded”

Result 200ok
{“access_token”:“EuSlSPvfxxxxxxxxxxxnnMqcdiDbP16rQU7ft1QTRss5BR1M”,“expires_in”:7199,“scope”:"",“token_type”:“bearer”}

This is probably the best thread to ask…

I’m trying to find a way for Homey to return a JSON on GET request. Is it possible at all (by using this app or via Homey native functionality)?

To clarify: I have a third party voice assistant which may be integrated in various smart home projects via webhooks. For certain use cases it can generate a GET requests on voice command and waits back for numeric value with one decimal in JSON format {“value”=.} which is then read back to the user (e.g. read out AC target temp when asked by the user). I’m able to trigger a flow in Homey with a GET request, but I’m unsure if it’s possible to make Homey respond with JSON containing the relevant temp value.

Hi.
How do I add an intermediate and root certificate to connect to the API? Does not find the value of kata A22, because there is no intermediate and root certificate. Similar error [APP] Simple HTTP Connector For Flows (2.0.0) - Page 14 — Athom Forum Archive

HTTP Request Flow Cards v2.0.11
Athome Homey v.4.1.0

HI

Im trying to send 2 variables at once to my homey.
I have used A20 to send one value via GET.

I think its A30 i should use.
Is there an example on how to do this?
how should the URL look?
How do i get the variables via A80 so i cold use them?

/Rikard