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

Thanks. Think I was trying that, but came to think now that the string maybe is too long for being saved as a better logic string, and that causes the error. Will have another go when the json isn’t empty.

(The emergency message I am trying to catchwas withdrawn, hehe.)

Hi Rindler, next time you can check your jsonpath online with jsonpath.com

Yes, I did, and I got the string working there but not with the flow card.

Ah, then it could be a Better Logic string length constraint indeed, or maybe some excentric character messing around.

I am 99% sure it’s the Swedish letters ÅÄÖ, which causes the errors. From this json, http://opendata-download-metobs.smhi.se/api/version/1.0/parameter/5/station/95160/period/latest-day/data.json, I can set better logic strings from different titles which do not include some of these letters, but if I try to catch a phrase which includes ÅÄÄ I get an error.

When adding better logic strings manually from the better logic app settings view there are no issues with ÅÄÖ, and I can set really long strings, so that shouldn’t be the issue.

Do you think this could be fixed? Can’t catch strings which contains these strange letters ÅÄÖ, hehe.

I don’t know if I’m just stupid :slight_smile: but i’m not to much into https authentication.

So i’m trying to call an api function via a HTTPS GET

here is my json formatted request (as per advanced instruction) - so an A20 GET with the below in the URL field.

{
	"hostname": "192.168.1.11",
	"port": "55756",
	"method": "GET",
	"protocol": "https:",
	"auth": "theusername:thepassword",
	"path": "/Acs/Api/TriggerFacade/ActivateDeactivateTrigger?{triggerName:Record_6115,deactivateAfterSeconds:5}",
	"headers": {
		"user-agent": "Node.js http.min"
	}
}

But I can not get it to work. Any help / pointers appreciated.
It is to call Axis Camera Station Web Api. It works fine as browser command.

I have tried PORT with and without quotes.

But homey discards with “Promise was rejected with a falsy value”

According to the documentation that I can find, the query string part of path needs to contain valid JSON, which it doesn’t in your case.

Try this:

"path" : "/Acs/Api/TriggerFacade/ActivateDeactivateTrigger?{\"triggerName\":\"Record_6115\",\"deactivateAfterSeconds\":5}"

Hi Robert,

thanks. I tried multiple variations and none of them worked.

I’ll continue my quest - if anyone else have ideas let me know please.


Anyone who could help how to write a valid condition? Want to sort out the values which are above 500.

Have you tried > 500 as condition?

Actually I want the value to be less than 500, but yes I have tried < 500, “< 500”, {{< 500}} and similar, and I just get a red exclamation mark (even though the value in my test is really low).

In the browser version (http://flow.athom.com/) you should be able to hover over the exclamation mark and see the error.

1 Like

Hm. Tried to hover, but it didn’t say anything. Found this site, http://jsonlogic.com/operations.html#---and-, but still don’t manage to get it right.

Hello, I’m trying to send a POST request using the A22 card. I tested this successfully with the following command:

curl -v -X POST -d ‘{“slid_token”: “f6e706e17d41ce781b5166f09e782fd0: 1663”}’ https://developer.starline.ru/json/v2/auth.slid

Is there a way to build this into an homey action card A22?
I believe, I got stuck because requires a plain text type.

Tell me how to get cookies?

So it happened {“method”:“post”,“protocol”:“https:”,“hostname”:“developer.starline.ru”,“path”:"/json/v2/auth.slid",“json”:{“slid_token”:“f6e706e17d41ce781b5166f09e782fd0: 1663”}

I’m trying something and since I’m no programmer this is a bit out of my league.

My router has OpenWRT and adblock, but … I want to suspend adblock temporarily with Homey. I had this in the past for PiHole with a GET command. But PiHole is running in docker on my NAS and when datascrubbing is taking place, the performance of docker becomes so bad my DNS fails and my wife has no internet. Big problem for me. So, I turned to adblock on OpenWRT. Works good to, but no easy way to disable it. It works from the commandline on my computer, but now to get it working in Homey.

First, I have to get a token:

curl https://router-ip/cgi-bin/luci/rpc/auth --insecure --data '{“id”: 1, “method”: “login”, “params”: [“username>”, “password”]}

This gives me a result like:
{“id”:1,“result”:“token”,“error”:null}

Those are my first two problems. I need to get the token stored in a variable and I need to make an insecure call (router is running a self signed certificate).

Then, to get it running in Homey, I need to translate this command into something Homey will understand:

curl -X POST https://router-ip/cgi-bin/luci/rpc/sys?auth=token --insecure --data ‘{“id”: “1”, “method”: “exec”, “params”: ["/etc/init.d/adblock suspend"]}’

I tried a POST JSON card with these options:

  • https:///cgi-bin/luci/rpc/sys?auth=
  • {“id”: “1”, “method”: “exec”, “params”: ["/etc/init.d/adblock suspend"]}

But that gives me an error: Unexpected Token E in JSON at position 0

The maker of adblock pointed me to a different, simpler solution. A simple web request that executes a custom command on the router. This works, but how to trigger that from Homey.

So I have two working solutions, but now to get either in them in a Homey flow. Any ideas?

There’s a flow action card called “Maak een webverzoek” (Make a web request):
image

The custom command is something like this: https://router-ip/cgi-bin/luci/command/cfg099944s, which suspends adblock on the router. I have another one for resume. The url opens a website that informs me that the command has run succesfully:

customcommand

I don’t understand how to use this in Homey, the webrequest card asks has four input fields:

This looks to me like the json based curl command for the ‘complex’ solution.