Send data to Domoticz using HTTP

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Send data to Domoticz using HTTP

#1 Post by Wiki » 13 Aug 2020, 01:42

The last binaries for 1M devices don't include the Domoticz MQTT controller. So I am trying to submit my data using the http protocol.

Trying to send the data of a bmp280
WZSBMP.JPG
WZSBMP.JPG (26.43 KiB) Viewed 6710 times
using

Code: Select all

SendToHTTP 192.168.xxx.yyy,8090,'/json.htm?type=command&param=udevice&idx=46&nvalue=0&svalue=[WZTemp#C];[WZTemp#H};[WZTemp#hPa];0'
results in a log entry

Code: Select all

610620860: ACT : SendToHTTP 192.168.xxx.yyy,8090,'/json.htm?type=command¶m=udevice&idx=46&nvalue=0&svalue=26.9;;0'
and the data are not recognized by Domoticz.

eehm, did I miss something or is this a bug?

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: Send data to Domoticz using HTTP

#2 Post by Wiki » 13 Aug 2020, 01:57

Forget it, please, I've foung my typo by myself.

Sending has to be:

Code: Select all

SendToHTTP 192.168.xxx.yyy,8090,'/json.htm?type=command&param=udevice&idx=46&nvalue=0&svalue=[WZTemp#C];[WZTemp#H];1;[WZTemp#hPa];0'
But the protocol entry still looks a little bit weired:

Code: Select all

611880877: ACT : SendToHTTP 192.168.101.92,8090,'/json.htm?type=command¶m=udevice&idx=46&nvalue=0&svalue=27.0;50;1;1012.54;0'
with the entry between

Code: Select all

command
and

Code: Select all

udevice=

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Send data to Domoticz using HTTP

#3 Post by ThomasB » 13 Aug 2020, 03:19

But the protocol entry still looks a little bit weird:
Although not a serious bug, the mangled "param" string could create confusion when someone uses the log to debug http problems. So I would encourage you to report this bug in the Github issue tracker.

- Thomas

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

Re: Send data to Domoticz using HTTP

#4 Post by TD-er » 13 Aug 2020, 11:02

That's probably caused by &para being replaced by a paragraph symbol in html.
So we should encode the log lines as raw string literals.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: Send data to Domoticz using HTTP

#5 Post by Wiki » 13 Aug 2020, 12:29

Ah, OK, makes sense.

I'll put it on github.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

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

Re: Send data to Domoticz using HTTP

#6 Post by Ath » 13 Aug 2020, 13:16

Well, the bug is probably that "&para" is replaced, instead of the actual html code "¶".
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 51 guests