Page 1 of 1

SendToHTTP usgae ?

Posted: 31 Jul 2017, 13:55
by cdx
hello all,

I'm new with espeasy and whould like to send a http message (DHT11 temperature) to my jeedom server.

The classic message in jeedom is something like this :

http://192.168.1.15/core/api/jeeApi.php ... emperature%

may i use the SendToHTTP function ?
like this ?

SendToHTTP 192.168.1.15,80,/json.htm?/core/api/jeeApi.php?apikey=y7pcfIMvcGffk0hNff1dLtvFJNjpSOff&type=virtual&id=48&value=%Temperature%

What is the correct syntax ?

In reality i just want to send this http message from the ESP !
I also tried a
on TEMP1 (using rules)

http://.... or SendToHTTP ?

EndOn


Thanks for your help

Re: SendToHTTP usgae ?

Posted: 05 Aug 2019, 01:22
by rudloffl
Did you find a solution @cdx ?

I have the same problem, I was hoping that a publish would do the job.

Re: SendToHTTP usgae ?

Posted: 05 Aug 2019, 15:21
by iron
This is my exact (api key changed) working syntax for posting temp and humidity values to thingspeak

On Thermometer#Temperature do
SendToHTTP,api.thingspeak.com,80,/update?api_key=XXXXXXXXXXXXXXXXXXXX&field1=[Thermometer#Temperature]&field2=[Thermometer#Humidity]
endon

https://thingspeak.com/channels/33034

-D

Re: SendToHTTP usgae ?

Posted: 05 Aug 2019, 20:45
by TD-er
You can include the [name#value] syntax in the URL also.
For example:
SendToHTTP example.com,80,api/add/single?id=%mac_int%&long=[gps#long]&lat=[gps#lat]&co2=[S8#co2]

So hostname,port,rest_of_url

See also the documentation: https://espeasy.readthedocs.io/en/lates ... sendtohttp

Please note that we currently do not support https url's

Re: SendToHTTP usgae ?

Posted: 06 Aug 2019, 05:55
by rudloffl
I'm not a big fan to hard code a API key in an espeasy (no offense to the team !).
I'm using Lunorak's plugin for espeasy (using http general). I prefer to avoid the usage of a different plugin on the jeedom side.
TD-er provided a solution with taskrun

Thanks again for the feed back