Sendtohttp - domoticz json
Moderators: grovkillen, Stuntteam, TD-er
Sendtohttp - domoticz json
I'm trying to use a PIR connected to my esp to make a switch connected to domoticz (esp12e with 108 running)
Using the sendtohttp I added the following rule
on Landing_PIR#Switch=1 do
sendtohttp,192.168.0.93,8080,/json.htm? type=command¶m=switchlight&idx=42&switchcmd=On
endon
However when I press submit the text is changed as below
on Landing_PIR#Switch=1 do
sendtohttp,192.168.0.93,8080,/json.htm?
type=command¶m=switchlight&idx=42&switchcmd=On
endon
Can anyone make any suggestions? As it replaces '¶' to ¶
Also if I remove the 2nd a within param it submits ok without changing anything but this obviously doesn't work??
Many thanks
Using the sendtohttp I added the following rule
on Landing_PIR#Switch=1 do
sendtohttp,192.168.0.93,8080,/json.htm? type=command¶m=switchlight&idx=42&switchcmd=On
endon
However when I press submit the text is changed as below
on Landing_PIR#Switch=1 do
sendtohttp,192.168.0.93,8080,/json.htm?
type=command¶m=switchlight&idx=42&switchcmd=On
endon
Can anyone make any suggestions? As it replaces '¶' to ¶
Also if I remove the 2nd a within param it submits ok without changing anything but this obviously doesn't work??
Many thanks
Re: Sendtohttp - domoticz json
instead of using sendtohttp I found 'publish' works brilliantly
on Landing_PIR#Switch=1 do
if [lux#lux]<2
Publish domoticz/in,{"idx":42,"command":"switchlight","switchcmd":"On"}
timerSet,2,20
endon
On Rules#Timer=2 do
Publish domoticz/in,{"idx":42,"command":"switchlight","switchcmd":"Off"}
endon

on Landing_PIR#Switch=1 do
if [lux#lux]<2
Publish domoticz/in,{"idx":42,"command":"switchlight","switchcmd":"On"}
timerSet,2,20
endon
On Rules#Timer=2 do
Publish domoticz/in,{"idx":42,"command":"switchlight","switchcmd":"Off"}
endon
Re: Sendtohttp - domoticz json
I have exactly the same problem.
The publish doesn't work for me, I can not do it
When i do this an i push "submit"
I get this
Version R147
The publish doesn't work for me, I can not do it
When i do this an i push "submit"
Code: Select all
On BP#Switch=1 do
SendToHTTP 192.168.1.12,8080,/json.htm?type=command¶mm=switchlight&idx=46&switchcmd=On
endon
Code: Select all
On BP#Switch=1 do
SendToHTTP 192.168.1.12,8080,/json.htm?type=command¶mm=switchlight&idx=46&switchcmd=On
endon
Re: Sendtohttp - domoticz json
hamster wrote:instead of using sendtohttp I found 'publish' works brilliantly![]()
on Landing_PIR#Switch=1 do
if [lux#lux]<2
Publish domoticz/in,{"idx":42,"command":"switchlight","switchcmd":"On"}
timerSet,2,20
endon
On Rules#Timer=2 do
Publish domoticz/in,{"idx":42,"command":"switchlight","switchcmd":"Off"}
endon
Hello
Can you give a help how to activate mqtt in domoticz
It's just that I can not do this.
Re: Sendtohttp - domoticz json
Hi Jeff,
I think you have an extra character, perhaps by using copy&paste from Windows?
SendToHTTP 192.168.1.12,8080,/json.htm?type=command¶mm=switchlight&idx=46&switchcmd=On
Perhaps edit the rule to delete a couple of chars back from the '=', and re-add the '¶m'.
EDIT!!!
Sorry, I spoke too soon. Ignore the above.
For some reason the exact string "¶m" is displayed as "¶m"
Delete one of the two "m" and it seems to work OK
I think you have an extra character, perhaps by using copy&paste from Windows?
SendToHTTP 192.168.1.12,8080,/json.htm?type=command¶mm=switchlight&idx=46&switchcmd=On
Perhaps edit the rule to delete a couple of chars back from the '=', and re-add the '¶m'.
EDIT!!!
Sorry, I spoke too soon. Ignore the above.
For some reason the exact string "¶m" is displayed as "¶m"
Delete one of the two "m" and it seems to work OK
Last edited by Westcott on 13 Jan 2017, 17:57, edited 1 time in total.
Domoticz, Sonoff, ESP32
-
- Normal user
- Posts: 35
- Joined: 11 Nov 2015, 13:52
Re: Sendtohttp - domoticz json
I also have the same problem running R147
On RFID#Tag do
if [RFID#Tag]=9235734
SendToHTTP
192.168.1.2:8080/json.htm?type=command¶m=switchlight&idx=89&switchcmd=On
Endon
Becomes
On RFID#Tag do
if [RFID#Tag]=9235734
SendToHTTP
192.168.1.2:8080/json.htm?type=command¶m=switchlight&idx=89&switchcmd=On
Endon
When I push enter. And nothing happens In domoticz.
The rule works when is use Gpio,13,1 instead of SendToHTTP. Gpio 13 goes high.
Is this a bug?
Greetings Dennis
On RFID#Tag do
if [RFID#Tag]=9235734
SendToHTTP
192.168.1.2:8080/json.htm?type=command¶m=switchlight&idx=89&switchcmd=On
Endon
Becomes
On RFID#Tag do
if [RFID#Tag]=9235734
SendToHTTP
192.168.1.2:8080/json.htm?type=command¶m=switchlight&idx=89&switchcmd=On
Endon
When I push enter. And nothing happens In domoticz.
The rule works when is use Gpio,13,1 instead of SendToHTTP. Gpio 13 goes high.
Is this a bug?
Greetings Dennis
-
- Normal user
- Posts: 39
- Joined: 09 Aug 2016, 09:45
Re: Sendtohttp - domoticz json
What is the solution?
I want rise http commands with several parameters but i am having the same problem
I want rise http commands with several parameters but i am having the same problem
-
- Normal user
- Posts: 20
- Joined: 09 Jan 2017, 20:20
- Location: Porto Alegre / Brazil
Re: Sendtohttp - domoticz json
No solution yet for the "¶m" replacement problem?
And the Publish domoticz/in doesn't work for me either. I'd like to use mqtt to update a contact switch (it's a read only switch, used for reed sensors, and only updates with the "udevice" command on json/domoticz)
And the Publish domoticz/in doesn't work for me either. I'd like to use mqtt to update a contact switch (it's a read only switch, used for reed sensors, and only updates with the "udevice" command on json/domoticz)
Re: Sendtohttp - domoticz json
Mine has the same problem but when I see it in the Log it is ok
and all lights switch ok.
Version 147
Sonoff 16A Switch
and all lights switch ok.
Version 147
Sonoff 16A Switch
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.
And a HackRF One, as a present to myself.
-
- Normal user
- Posts: 20
- Joined: 09 Jan 2017, 20:20
- Location: Porto Alegre / Brazil
Re: Sendtohttp - domoticz json
I updated to 147, and still have the same problem (¶m gets replaced by a symbol) and the command doesnt work.
-
- Normal user
- Posts: 20
- Joined: 09 Jan 2017, 20:20
- Location: Porto Alegre / Brazil
Re: Sendtohttp - domoticz json
I tried something, and it worked fine.
Just invert the commands, and put "param" as the first item, without the "&".
Normal way ("¶m" gets replaced):
/json.htm?type=command¶m=switchlight&idx=174&switchcmd=On
Inverted way (working fine):
/json.htm?param=switchlight&type=command&idx=96&switchcmd=On
Just invert the commands, and put "param" as the first item, without the "&".
Normal way ("¶m" gets replaced):
/json.htm?type=command¶m=switchlight&idx=174&switchcmd=On
Inverted way (working fine):
/json.htm?param=switchlight&type=command&idx=96&switchcmd=On
Re: Sendtohttp - domoticz json
Hi guys,
could you please advise If I can use that in situation related to my post below
https://www.letscontrolit.com/forum/vie ... 687#p15687
I'm newbie in using scripts so any help more than appreciated.
Thanks
V.
could you please advise If I can use that in situation related to my post below
https://www.letscontrolit.com/forum/vie ... 687#p15687
I'm newbie in using scripts so any help more than appreciated.
Thanks
V.
-
- Normal user
- Posts: 20
- Joined: 09 Jan 2017, 20:20
- Location: Porto Alegre / Brazil
Re: Sendtohttp - domoticz json
Ok, replied there.vojtishek wrote: ↑07 May 2017, 22:03 Hi guys,
could you please advise If I can use that in situation related to my post below
https://www.letscontrolit.com/forum/vie ... 687#p15687
I'm newbie in using scripts so any help more than appreciated.
Thanks
V.
-
- Normal user
- Posts: 13
- Joined: 08 May 2017, 22:50
Re: Sendtohttp - domoticz json
Thank you very much!!!danielchagasrs wrote: ↑29 Jan 2017, 01:35 I tried something, and it worked fine.
Just invert the commands, and put "param" as the first item, without the "&".
Normal way ("¶m" gets replaced):
/json.htm?type=command¶m=switchlight&idx=174&switchcmd=On
Inverted way (working fine):
/json.htm?param=switchlight&type=command&idx=96&switchcmd=On
Who is online
Users browsing this forum: Ahrefs [Bot] and 14 guests