How to use Sendtohttp

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jvm1000
Normal user
Posts: 11
Joined: 11 Feb 2017, 14:23

How to use Sendtohttp

#1 Post by jvm1000 » 21 Feb 2023, 01:05

Dear all,

After pulling my hair for hours and doing research on this forum and externally, I'm finally writing you this message.

I'm trying to use SendToHTTP in rules to send a message (temperature) to my Hubitat, but I can;t seem to get it working.

If I paste my URL in a browser and hit enter, it works, the virtual sensor id=9 gets 29.02 degrees
http://192.168.1.90/apps/api/31/devices ... 5ac976af9a

i have tried this and many variation and nothing works
SendToHTTP 192.168.1.90/apps/api/31/devices/9/setTemperature/[temp1#temperature]?access_token=ee5e1db1-6a96-4157-bf4e-335ac976af9a


Anyone who's able to help me with this issue?
Thanks!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How to use Sendtohttp

#2 Post by TD-er » 21 Feb 2023, 07:42

Usually when I see users post their security tokens in an URL, I edit their posts.
But this is just a local IP, so hardly exploitable by anyone.
However, keep this in mind when posting anything online, that some URLs may have tokens in them you don't want people to have.

About your issue.

The syntax for SendToHTTP is described here: https://espeasy.readthedocs.io/en/lates ... sendtohttp

Thus the 2nd argument needs to be a port nr.

Code: Select all

SendToHTTP 192.168.1.90,80,/apps/api/31/devices/9/setTemperature/[temp1#temperature]?access_token=ee5e1db1-6a96-4157-bf4e-335ac976af9a
                        ^^
Or if you are using a more recent build, you can use it like this:

Code: Select all

SendToHTTP http://192.168.1.90/apps/api/31/devices/9/setTemperature/[temp1#temperature]?access_token=ee5e1db1-6a96-4157-bf4e-335ac976af9a

jvm1000
Normal user
Posts: 11
Joined: 11 Feb 2017, 14:23

Re: How to use Sendtohttp

#3 Post by jvm1000 » 21 Feb 2023, 12:02

Thank you very much TD-er for your help and all the firmware

i am one of yours patreon

thanks for the advice of the security tokens, but I was careful and I modified it before, it is not the real one ;).

the first syntax works fine.

Now I see it written and I swear I had already tried it.

I am able to send to domoticz and emoncms but I don't know why Hubitat resisted me

again thank a lot

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How to use Sendtohttp

#4 Post by TD-er » 21 Feb 2023, 14:04

Maybe Hubitat requires HTTPS?
Or you could enable "SendToHTTP wait for ack" on the Tools->Advanced page?

bidrohini
Normal user
Posts: 101
Joined: 03 Nov 2022, 16:24

Re: How to use Sendtohttp

#5 Post by bidrohini » 22 Feb 2023, 09:59

Did you try the following?

Code: Select all

  SendToHTTP http://192.168.1.90/apps/api/31/devices/9/setTemperature/[temp1#temperature]?access_token=ee5e1db1-6a96-4157-bf4e-335ac976af9a  

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: How to use Sendtohttp

#6 Post by Ath » 22 Feb 2023, 10:24

bidrohini wrote: 22 Feb 2023, 09:59 Did you try the following?

Code: Select all

  SendToHTTP http://192.168.1.90/apps/api/31/devices/9/setTemperature/[temp1#temperature]?access_token=ee5e1db1-6a96-4157-bf4e-335ac976af9a  
It's not nice (read: rude) to pass an answer suggested by someone else as your suggestion, please avoid that.
/Ton (PayPal.me)

jvm1000
Normal user
Posts: 11
Joined: 11 Feb 2017, 14:23

Re: How to use Sendtohttp

#7 Post by jvm1000 » 22 Feb 2023, 14:25

Hello

As I said the problem is already solved.

The first line has worked for me

SendToHTTP 192.168.1.90,80,/apps/api/31/devices/9/setTemperature/[temp1#temperature]?access_token=ee5e1db1-6a96-4157-bf4e-335ac976af9a

Thank you all so much for helping me so quickly.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests