Issue in Rules and sendtohttp

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
thegoldeneagleCT
Normal user
Posts: 4
Joined: 13 Apr 2019, 03:12

Issue in Rules and sendtohttp

#1 Post by thegoldeneagleCT » 13 Apr 2019, 03:33

Hi all first post! I just got into esp and 8366 programming. I plan on using them to report temperature and humidity to my vera controller. i got 2 working with a DHT22 and that part is working fine, but i cant seem to get the rules working. It looks like the request is being truncated into multiple parts. in the rules section i have the following:

Code: Select all

on System#Boot do
	timerSet,1,10
endon

On Rules#Timer=1 do
	SendToHTTP 192.168.3.109,3480,/data_request?id=variableset&DeviceNum=64&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value=[LRmedia#Temperature]
	timerSet,1,60
endon

but it adds a few extra line breaks in the sendhttp seen here (this is in the rules editor)
on System#Boot do
	timerSet,1,10
endon

On Rules#Timer=1 do
	SendToHTTP 192.168.3.109,3480,/data_request?
id=variableset&DeviceNum=64&serviceId=urn:upnp-
org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value=[LRmedia#Temperature]
	timerSet,1,60
endon

Code: Select all

log shows as :
86983000 : EVENT: Rules#Timer=1
86983004 : ACT : SendToHTTP 192.168.3.109,3480,/data_request?
86983221 : ACT : id=variableset&DeviceNum=64&serviceId=urn:upnp-
86983230 : ACT : org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value=71.24
86983253 : ACT : timerSet,1,60
Does anyone have an idea as to what this is? i tried to google it but i am not really sure why the extra line breaks are being added, is it something i am doing wrong?

Thanks
Last edited by thegoldeneagleCT on 13 Apr 2019, 18:51, edited 2 times in total.

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

Re: Issue in Rules and sendhttp

#2 Post by Wiki » 13 Apr 2019, 12:31

I don’t know if it works, but you can try.the following:
Download your rule to a.file
Open it using an editor
Put the SendToHTTP into one line without line wrap, save it
Goto http://<your ip>/upload and save the textfile to your device

thegoldeneagleCT
Normal user
Posts: 4
Joined: 13 Apr 2019, 03:12

Re: Issue in Rules and sendhttp

#3 Post by thegoldeneagleCT » 13 Apr 2019, 18:49

That's the thing, I am not putting in the line wrap (new line). It is getting added, actually a few,. I think it is the length.

I tried the file upload but no luck

Anyone have experience with this?
Thanks.

ThomasB
Normal user
Posts: 222
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Issue in Rules and sendtohttp

#4 Post by ThomasB » 13 Apr 2019, 19:36

I entered your text on a couple different ESPEasy versions and did not experience the rule mangling that you see. I did not test the rule, I only confirmed that it could be successfully saved and remain intact.

What ESPEasy release version are you using? What browser are you using? Perhaps one of these things is involved in your issue.

- Thomas

thegoldeneagleCT
Normal user
Posts: 4
Joined: 13 Apr 2019, 03:12

Re: Issue in Rules and sendtohttp

#5 Post by thegoldeneagleCT » 13 Apr 2019, 19:41

R120. Chrome. Good point on the browser. I'll try a different one when I get home.

Just curious can you post up your sendtohttp?


Thanks

ThomasB
Normal user
Posts: 222
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Issue in Rules and sendtohttp

#6 Post by ThomasB » 13 Apr 2019, 20:04

Tried Chrome, works fine. R120 is quite old and I don't have an installation with it anymore. Try a recent Mega release -- that should solve the problem.

- Thomas

User avatar
schnurzel59
Normal user
Posts: 28
Joined: 18 Feb 2019, 12:41
Location: Germany
Contact:

Re: Issue in Rules and sendtohttp

#7 Post by schnurzel59 » 13 Apr 2019, 21:29

obviously the "-" in "upnp-org" is a problem. I have replaced it for testing by the ASCII character in percentage representation "%2D". I do not know if that works, because I do not have a vera controller.
Then the string is not shared at this point.
SendToHTTP 192.168.3.109,3480,/data_request?id=variableset&DeviceNum=64&serviceId=urn:upnp%2Dorg:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value=[LRmedia#Temperature]
Greetings Martin

Oh God, my English is horrible.

thegoldeneagleCT
Normal user
Posts: 4
Joined: 13 Apr 2019, 03:12

Re: Issue in Rules and sendtohttp

#8 Post by thegoldeneagleCT » 14 Apr 2019, 03:43

Ok thanks everyone for the help, I uploaded the latest ESP easy 2.0, and it looks like works great, I thought the mega build was more beta than it was, since there really was no documentation on it on the main site. Looks like it is now publishing to my vera. will upload more info once i have more, right now it is bare wires and only 1 sensor working

ThomasB
Normal user
Posts: 222
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Issue in Rules and sendtohttp

#9 Post by ThomasB » 14 Apr 2019, 07:45

Glad to hear you sorted it out. Mega isn't perfect, but has more functionality than the legacy R120 release.

- Thomas

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest