Send data to Domoticz using HTTP

Moderators: grovkillen, Stuntteam, TD-er

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

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 1245 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
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

Wiki
Normal user
Posts: 282
Joined: 23 Apr 2018, 17:55

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
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

User avatar
ThomasB
Normal user
Posts: 716
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: 3167
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: 282
Joined: 23 Apr 2018, 17:55

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
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

User avatar
Ath
Normal user
Posts: 187
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 "¶".

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 17 guests