Page 1 of 1
SendTo HTTP sends empty value
Posted: 04 Jul 2019, 07:38
by mackowiakp
I want to send values pf PPM (dust sensor) to Domoticz text sensor. It works properly when nodeMCU sends such values by itself, using build in feature. But when I use SendTo HTTP, empty values are sends. Below HTTP syntax and appropriate logs from nodeMCU:
Code: Select all
SendToHTTP 192.168.0.25,8080,/json.htm?type=command¶m=udevice&idx=64&nvalue=0&svalue=[Jakosc-powietrza#ppm1-0];[Jakosc-powietrza#ppm2-5];[Jakosc-powietrza#ppm10]
LOGS
EVENT: Jakosc-powietrza#pm1-0=2.00
EVENT: Jakosc-powietrza#pm2-5=2.00
EVENT: Jakosc-powietrza#pm10=4.00
Re: SendTo HOOT sends empty value
Posted: 04 Jul 2019, 07:59
by grovkillen
Is domoticz expecting ";" in the URL? If so please exchange them with "%3B" since that's the URL equivalent of ;
i.e.
See more here:
https://www.w3schools.com/tags/ref_urlencode.asp
Re: SendTo HOOT sends empty value
Posted: 04 Jul 2019, 08:19
by mackowiakp
I send values to text sensor so Domoticz expect any string. I use ";" sign in LUA script in Domoticz. But in other case I use such syntax:
Code: Select all
SendToHTTP 192.168.0.25,8080,/json.htm?type=command¶m=udevice&idx=60&nvalue=0&svalue=[Temperatura-i-Barometr#Temperatura];[Temperatura-i-Barometr#Cisnienie];0;0
EndIf
This is not text but baro/temp sensor. And such syntax work properly.
Using first presented syntax, only two ";" signs are send to Domoticz text sensor but variables are empty. Thats a problem
Re: SendTo HTTP sends empty value
Posted: 04 Jul 2019, 16:46
by grovkillen
From what I can tell you're not using the same names for the tasks and values in the rules.
Re: SendTo HTTP sends empty value
Posted: 04 Jul 2019, 17:06
by mackowiakp
Hmmm. Maybe I am blind. Be so kind to indicate where....
Code: Select all
SendToHTTP 192.168.0.25,8080,/json.htm?type=command¶m=udevice&idx=64&nvalue=0&svalue=[Jakosc-powietrza#ppm1-0];[Jakosc-powietrza#ppm2-5];[Jakosc-powietrza#ppm10]
LOGS
EVENT: Jakosc-powietrza#pm1-0=2.00
EVENT: Jakosc-powietrza#pm2-5=2.00
EVENT: Jakosc-powietrza#pm10=4.00
Re: SendTo HTTP sends empty value
Posted: 04 Jul 2019, 18:27
by grovkillen
ppm vs pm
Re: SendTo HTTP sends empty value
Posted: 04 Jul 2019, 18:56
by mackowiakp
Hmmm. So I am blind. THX for help. Sometimes looking at the code for the thousandth time, no obvious error is seen. thank you again