SendTo HTTP sends empty value

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

SendTo HTTP sends empty value

#1 Post by mackowiakp » 04 Jul 2019, 07:38

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&param=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
Last edited by mackowiakp on 04 Jul 2019, 09:17, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: SendTo HOOT sends empty value

#2 Post by grovkillen » 04 Jul 2019, 07:59

Is domoticz expecting ";" in the URL? If so please exchange them with "%3B" since that's the URL equivalent of ;

i.e.

Code: Select all

%3B
See more here: https://www.w3schools.com/tags/ref_urlencode.asp
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: SendTo HOOT sends empty value

#3 Post by mackowiakp » 04 Jul 2019, 08:19

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&param=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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: SendTo HTTP sends empty value

#4 Post by grovkillen » 04 Jul 2019, 16:46

From what I can tell you're not using the same names for the tasks and values in the rules.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: SendTo HTTP sends empty value

#5 Post by mackowiakp » 04 Jul 2019, 17:06

Hmmm. Maybe I am blind. Be so kind to indicate where....

Code: Select all

SendToHTTP 192.168.0.25,8080,/json.htm?type=command&param=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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: SendTo HTTP sends empty value

#6 Post by grovkillen » 04 Jul 2019, 18:27

ppm vs pm
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: SendTo HTTP sends empty value

#7 Post by mackowiakp » 04 Jul 2019, 18:56

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

Post Reply

Who is online

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