http send being truncated in rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
maninblack_30
New user
Posts: 5
Joined: 11 Feb 2017, 02:16

http send being truncated in rules

#1 Post by maninblack_30 » 11 Feb 2017, 02:23

Hello everyone, I'm just starting with ESPEasy and Domoticz, and I can't seem to put a http send in the rules to send a change in local output state when I use a local input to change it to Dometicz:
This is what I put in:

on local#switch do
if [lightstate#switch]=0
gpio,2,1
SendToHTTP 192.168.0.243,8080,/json.htm?type=command&paramm=switchlight&idx=10&switchcmd=On
else

gpio,2,0
SendToHTTP 192.168.0.243,8080,/json.htm?type=command&paramm=switchlight&idx=10&switchcmd=Off
endif
endon

But once I hit submit, this is what happens:

on local#switch do
if [lightstate#switch]=0
gpio,2,1
SendToHTTP 192.168.0.243,8080,/json.htm?type=command¶mm=switchlight&idx=10&switchcmd=On
else

gpio,2,0
SendToHTTP 192.168.0.243,8080,/json.htm?type=command¶mm=switchlight&idx=10&switchcmd=Off
endif
endon


I'm guessing I'm doing something whrong, but I have no idea what !! :-)

Anyone have any suggestions?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: http send being truncated in rules

#2 Post by toffel969 » 11 Feb 2017, 12:58

try using a different browser
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: http send being truncated in rules

#3 Post by costo » 11 Feb 2017, 17:59

Try to change the format of the rules line

SendToHTTP 192.168.0.243,8080,/json.htm?type=command&paramm=switchlight&idx=10&switchcmd=On

changing it into

SendToHTTP 192.168.0.243,8080,/json.htm?type=command&idx=10&switchcmd=On&paramm=switchlight

that might help.

User avatar
Westcott
Normal user
Posts: 24
Joined: 05 Sep 2016, 18:14
Location: Gloucester
Contact:

Re: http send being truncated in rules

#4 Post by Westcott » 12 Feb 2017, 17:53

The problem seems to be that '&para' is replaced by '¶' when the rules are saved.
This has been noted many times before!
Domoticz, Sonoff, ESP32

maninblack_30
New user
Posts: 5
Joined: 11 Feb 2017, 02:16

Re: http send being truncated in rules

#5 Post by maninblack_30 » 13 Feb 2017, 00:36

Westcott wrote:The problem seems to be that '&para' is replaced by '¶' when the rules are saved.
This has been noted many times before!

Is anyone aware of a workaround/fix?

Magnus
New user
Posts: 3
Joined: 17 Apr 2017, 20:41

Re: http send being truncated in rules

#6 Post by Magnus » 17 Apr 2017, 20:56

I have the same issue, works the same way with both Chrome and IE
Any info or feedback on this would be appreciated.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: http send being truncated in rules

#7 Post by toffel969 » 17 Apr 2017, 23:22

Magnus wrote: 17 Apr 2017, 20:56 I have the same issue, works the same way with both Chrome and IE
Any info or feedback on this would be appreciated.
+1
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Martinus

Re: http send being truncated in rules

#8 Post by Martinus » 18 Apr 2017, 20:28

Workaround: Make sure that the "param" valuepair is the first in the list.

I use it like this:

Code: Select all

sendtohttp 192.168.0.8,8080,/json.htm?param=udevice&type=command&idx=229&svalue=%eventvalue%

psy0rz
Normal user
Posts: 232
Joined: 02 Feb 2017, 12:12

Re: http send being truncated in rules

#9 Post by psy0rz » 24 Apr 2017, 00:53

this issue should now be fixed in the latest git-version. https://github.com/letscontrolit/ESPEasy/issues/231
Please support ESPEasy development via Patreon or buy us a coffee.

Magnus
New user
Posts: 3
Joined: 17 Apr 2017, 20:41

Re: http send being truncated in rules

#10 Post by Magnus » 27 Apr 2017, 18:19

Yes now it works. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 107 guests