Send data to Emomcms from rules
Moderators: grovkillen, Stuntteam, TD-er
Send data to Emomcms from rules
hi, i am trying to send data from rules to emocms, and i not want to use controlers
after wasting a lot of time with this I ask for help,
in browser this works fine:
http://192.168.1.109/input/post?node=ES ... 68d01d9454
even this
http://192.168.1.109/emoncms/input/post ... 68d01d9454
http://192.168.1.109/input/post?node=ES ... 68d01d9454
but in rules I have tried many combinations and have not been able to make it works
examples i tried
SendToHTTP 192.168.1.109,/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109/input/post?node=ESP_9&fulljson='{"temperatura":77.7}'&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109,emoncms,input,post?node=ESP_9&fulljson='{"temperatura":77.7}'&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109,/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234664c68d01d9454
please, i need help
thanks
after wasting a lot of time with this I ask for help,
in browser this works fine:
http://192.168.1.109/input/post?node=ES ... 68d01d9454
even this
http://192.168.1.109/emoncms/input/post ... 68d01d9454
http://192.168.1.109/input/post?node=ES ... 68d01d9454
but in rules I have tried many combinations and have not been able to make it works
examples i tried
SendToHTTP 192.168.1.109,/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109/input/post?node=ESP_9&fulljson='{"temperatura":77.7}'&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109,emoncms,input,post?node=ESP_9&fulljson='{"temperatura":77.7}'&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109,/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234664c68d01d9454
please, i need help
thanks
Re: Send data to Emomcms from rules
See for more info: https://github.com/letscontrolit/ESPEasy/issues/2724
So for example first the line you tried and next the line how I think it should be:
The last parameter of "SendToHttp" is the URL and since it has both a comma and quotes, you should wrap the entire parameter in quotes which are not used in the parameter.
So for example first the line you tried and next the line how I think it should be:
Code: Select all
SendToHTTP 192.168.1.109,emoncms,input,post?node=ESP_9&fulljson='{"temperatura":77.7}'&apikey=f9a6bad9744c5b7234664c68d01d9454
SendToHTTP 192.168.1.109,`emoncms,input,post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234664c68d01d9454`
Re: Send data to Emomcms from rules
thanks TD-er for you answer but no way
i tried in rules
in rules
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109,'/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, '/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109,`/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
SendToHTTP 192.168.1.109, `/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109, /input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
SendToHTTP 192.168.1.109, '/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, "/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,"/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
in log
31553: ACT : SendToHTTP 192.168.1.109,'/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
31565: SendToHTTP connection failed
31571: ACT : SendToHTTP 192.168.1.109, '/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d
31583: SendToHTTP connection failed
31589: ACT : SendToHTTP 192.168.1.109,`/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
31605: SendToHTTP connection failed
31611: ACT : SendToHTTP 192.168.1.109, `/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d
31627: SendToHTTP connection failed
31654: ACT : SendToHTTP 192.168.1.109, /input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
31666: SendToHTTP connection failed
31670: ACT : SendToHTTP 192.168.1.109, '/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
31682: SendToHTTP connection failed
31685: ACT : SendToHTTP 192.168.1.109, '/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
31696: SendToHTTP connection failed
31700: ACT : SendToHTTP 192.168.1.109,'/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
31708: SendToHTTP connection failed
31713: ACT : SendToHTTP 192.168.1.109,/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
31723: SendToHTTP connection failed
in rules
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109,'emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, 'emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109,`emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
SendToHTTP 192.168.1.109, `emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109, input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
SendToHTTP 192.168.1.109, 'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, "input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,"input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
in log
88983: ACT : SendToHTTP 192.168.1.109,'emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d01
88995: SendToHTTP connection failed
89001: ACT : SendToHTTP 192.168.1.109, 'emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
89015: SendToHTTP connection failed
89021: ACT : SendToHTTP 192.168.1.109,`emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d01
89033: SendToHTTP connection failed
89038: ACT : SendToHTTP 192.168.1.109, `emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
89050: SendToHTTP connection failed
89054: ACT : SendToHTTP 192.168.1.109, input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
89067: SendToHTTP connection failed
89072: ACT : SendToHTTP 192.168.1.109, 'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
89083: SendToHTTP connection failed
89114: ACT : SendToHTTP 192.168.1.109, 'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
89126: SendToHTTP connection failed
89132: ACT : SendToHTTP 192.168.1.109,'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
89141: SendToHTTP connection failed
89145: ACT : SendToHTTP 192.168.1.109,input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
89159: SendToHTTP connection failed
no way
any idea?
i tried in rules
in rules
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109,'/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, '/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109,`/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
SendToHTTP 192.168.1.109, `/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109, /input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
SendToHTTP 192.168.1.109, '/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, "/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,"/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
in log
31553: ACT : SendToHTTP 192.168.1.109,'/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
31565: SendToHTTP connection failed
31571: ACT : SendToHTTP 192.168.1.109, '/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d
31583: SendToHTTP connection failed
31589: ACT : SendToHTTP 192.168.1.109,`/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
31605: SendToHTTP connection failed
31611: ACT : SendToHTTP 192.168.1.109, `/emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d
31627: SendToHTTP connection failed
31654: ACT : SendToHTTP 192.168.1.109, /input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
31666: SendToHTTP connection failed
31670: ACT : SendToHTTP 192.168.1.109, '/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
31682: SendToHTTP connection failed
31685: ACT : SendToHTTP 192.168.1.109, '/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
31696: SendToHTTP connection failed
31700: ACT : SendToHTTP 192.168.1.109,'/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
31708: SendToHTTP connection failed
31713: ACT : SendToHTTP 192.168.1.109,/input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
31723: SendToHTTP connection failed
in rules
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109,'emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, 'emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109,`emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
SendToHTTP 192.168.1.109, `emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454`
// this work on brouser http://192.168.1.109/input/post?node=ES ... 68d01d9454
SendToHTTP 192.168.1.109, input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
SendToHTTP 192.168.1.109, 'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
SendToHTTP 192.168.1.109, "input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,"input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454"
SendToHTTP 192.168.1.109,input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
in log
88983: ACT : SendToHTTP 192.168.1.109,'emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d01
88995: SendToHTTP connection failed
89001: ACT : SendToHTTP 192.168.1.109, 'emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
89015: SendToHTTP connection failed
89021: ACT : SendToHTTP 192.168.1.109,`emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d01
89033: SendToHTTP connection failed
89038: ACT : SendToHTTP 192.168.1.109, `emoncms/input/post?node=ESP_9&fulljson={'temperatura':77.7}&apikey=f9a6bad9744c5b7234774c68d0
89050: SendToHTTP connection failed
89054: ACT : SendToHTTP 192.168.1.109, input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
89067: SendToHTTP connection failed
89072: ACT : SendToHTTP 192.168.1.109, 'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
89083: SendToHTTP connection failed
89114: ACT : SendToHTTP 192.168.1.109, 'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
89126: SendToHTTP connection failed
89132: ACT : SendToHTTP 192.168.1.109,'input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454'
89141: SendToHTTP connection failed
89145: ACT : SendToHTTP 192.168.1.109,input/post?node=ESP_9&csv=77.7&apikey=f9a6bad9744c5b7234774c68d01d9454
89159: SendToHTTP connection failed
no way
any idea?
Re: Send data to Emomcms from rules
You forgot the port number in the sendtohttp command
host,port,URL
host,port,URL
Re: Send data to Emomcms from rules
Emoncms input don´t have ports
this work if you put it in a brouser like crome and there is no port
http://192.168.1.109/input/post?node=ES ... 68d01d9454
docu:
https://emoncms.org/site/api#input
this work if you put it in a brouser like crome and there is no port
http://192.168.1.109/input/post?node=ES ... 68d01d9454
docu:
https://emoncms.org/site/api#input
Last edited by jvm1000 on 18 Jan 2021, 21:58, edited 1 time in total.
Re: Send data to Emomcms from rules
Default http port is port 80.
Thus:
Thus:
Code: Select all
SendToHTTP 192.168.1.109,80,'/emoncms/input/post?node=ESP_9&fulljson={"temperatura":77.7}&apikey=f9a6bad9744c5b7234774c68d01d9454'
Re: Send data to Emomcms from rules
it is working TD-er
thanks a lot
thanks a lot

Re: Send data to Emomcms from rules
You're welcome...
I will try to add a hint in the log if the port was missed as that's something that's easy to overlook.
I will try to add a hint in the log if the port was missed as that's something that's easy to overlook.
Re: Send data to Emomcms from rules
Hi. A similar situation. I'm trying to send data from the rules to open-monitoring.online.
In the browser, this works fine: http://open-monitoring.online/get?cid=1 ... 3&p4=44444.
But the rules I tried, it doesn't work.
SendToHTTP open-monitoring.online/get?cid=1288&key=io16e4&p1=11111&p2=22222&p3=33333&p4=44444
Or use the site's IP address 109.174.31.9
SendToHTTP 109.174.31.9,80,'/get?cid=1288&key=io16e4&p1=11111&p2=22222&p3=33333&p4=44444'
I need help.
In the browser, this works fine: http://open-monitoring.online/get?cid=1 ... 3&p4=44444.
But the rules I tried, it doesn't work.
SendToHTTP open-monitoring.online/get?cid=1288&key=io16e4&p1=11111&p2=22222&p3=33333&p4=44444
Or use the site's IP address 109.174.31.9
SendToHTTP 109.174.31.9,80,'/get?cid=1288&key=io16e4&p1=11111&p2=22222&p3=33333&p4=44444'
I need help.
Re: Send data to Emomcms from rules
Does that site actually accept http protocol or does it forward to https?
Nb: your second SendTHTTP example is correct the first one is incorrect
Nb: your second SendTHTTP example is correct the first one is incorrect
/Ton (PayPal.me)
Re: Send data to Emomcms from rules
The site accepts the http protocol.
The rules are written correctly, but they don't work with this site.
I will try to configure another service. Can ESPEasy work with beebotte.com?, have you any experience of its setting up?
The rules are written correctly, but they don't work with this site.
I will try to configure another service. Can ESPEasy work with beebotte.com?, have you any experience of its setting up?
Re: Send data to Emomcms from rules
Here's a syntax error, the SendToHTTP command needs 3 arguments, not 1
If I separate the site and the rest of the url, inserting ",80," just as below it gets sent.
Code: Select all
SendToHTTP open-monitoring.online,80,/get?cid=1288&key=io16e4&p1=11111&p2=22222&p3=33333&p4=44444
/Ton (PayPal.me)
Re: Send data to Emomcms from rules
Beebotte redirects to https immediately, and ESPEasy doesn't support https by default, so I don't think that'll work.
/Ton (PayPal.me)
Re: Send data to Emomcms from rules
Hi guys.
but: it looks like the content-MD5 header is required to get a valid signature and this might be an issue. ref.-> https://beebotte.com/docs/auth
This is what i'm struggeling with and wonder also if somebody has it running already properly and how exactly ??
any hint's are welcome.
thx & regards
sm0k0
@Ath : Thats not correct, beebotte is also using non-ssl via port 1883 and ssl on port 8883. ref-> https://beebotte.com/docs/mqtt#auth
but: it looks like the content-MD5 header is required to get a valid signature and this might be an issue. ref.-> https://beebotte.com/docs/auth
This is what i'm struggeling with and wonder also if somebody has it running already properly and how exactly ??
any hint's are welcome.
thx & regards
sm0k0
Who is online
Users browsing this forum: Ahrefs [Bot] and 19 guests