Http get request

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ryanjennings
New user
Posts: 9
Joined: 25 Jan 2017, 03:57

Http get request

#1 Post by ryanjennings » 05 Feb 2017, 02:06

I would like to generate a http get request to submit a temperature to weather underground.

http://wiki.wunderground.com/index.php/ ... d_Protocol

I searched around a bit but couldn't find an example of sending a get request. Is this possible?

Thanks for the help,
Ryan

ryanjennings
New user
Posts: 9
Joined: 25 Jan 2017, 03:57

Re: Http get request

#2 Post by ryanjennings » 06 Feb 2017, 16:15

I have made some progress so I wanted to post my solution for others.

I am using esp mega so I have the option of 3 controllers in the controllers tab. I added a controller using the generic http protocol. I selected use hostname. The thing to watch for there is this is just the hostname. I had first included the https:// that doesn't work and shows an error in the log trying to connect to 0.0.0.0 I set hostname to weatherstation.wunderground.com

The second issue I ran into was in the publish field. I misunderstood how that worked. In the devices tab and the specific task you must select which controller the data is sent to. Then in the controller publish field I used this. (might show as two lines in a narrow browser window, but this is all on one line)

Code: Select all

/weatherstation/updateweatherstation.php?ID=STATIONID&PASSWORD=STATIONKEY&dateutc=now&tempf=%value%
Those are the most important. Port is set to 80
User pass and subscribe are all blank.
Enabled is of course checked.

nightshark
Normal user
Posts: 25
Joined: 29 Apr 2016, 06:54

Re: Http get request

#3 Post by nightshark » 25 Mar 2017, 00:45

Thanks for posting this. There usually isn't much help here or at least I've had no luck...

iot
New user
Posts: 1
Joined: 25 Apr 2017, 17:41

Re: Http get request

#4 Post by iot » 25 Apr 2017, 17:51

If i use DHT11 in %value% i get temperature (tempf) and humidity (humidity)
How can I fix it?

Thanks for the help,

Umberto

krikk
Normal user
Posts: 118
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

Re: Http get request

#5 Post by krikk » 26 Apr 2017, 19:39

you should use http advanced controller in newest build: see here for more info: https://www.letscontrolit.com/wiki/inde ... P_Advanced

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#6 Post by mr-varga » 29 Jan 2018, 18:50

Dear All,

i have this problem:

I have instal the EspEasy on a ESP8266. This board is a weather station with connected DHT22 Temperature and Humidity sensor and BMP180 for a Pressure.
I'am trying for a long time to pubblist this three vale to weather underground site, but without success.
Can someone help me?
This is my device page, I want to use only Temperature Humidity and Pressure value and send this to WU.

Thanks in advance....
Attachments
zzz.PNG
zzz.PNG (43.01 KiB) Viewed 19041 times

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

Re: Http get request

#7 Post by grovkillen » 29 Jan 2018, 19:22

You can do that using rules and the command "SendToHTTP"

Please study the wiki. Get back here once you have done that.
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:

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#8 Post by mr-varga » 29 Jan 2018, 19:53

I have studied this guide but unfortunately I don't understand so much.
The firs think I have to do, is to create a Dummy Device who convert a °C in Fahrenheit, because the wu strung need Fahrenheit.
I create a Single DummyDevice with value called TemperatureF. In the rules I wrote this:
TaskValueSet 4,1,[T6H#Temperature]*9+32
But this doesn't work :cry:

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

Re: Http get request

#9 Post by grovkillen » 29 Jan 2018, 20:37

But you don't have any dummy device on task number 4?
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:

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#10 Post by mr-varga » 29 Jan 2018, 20:42

Now Yes....
Attachments
sds.PNG
sds.PNG (56.58 KiB) Viewed 19021 times

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

Re: Http get request

#11 Post by grovkillen » 29 Jan 2018, 20:51

And your rule?
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:

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#12 Post by mr-varga » 29 Jan 2018, 20:53

Is the one I have write before.
Attachments
sss.PNG
sss.PNG (26.51 KiB) Viewed 18869 times

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

Re: Http get request

#13 Post by grovkillen » 29 Jan 2018, 21:02

Have you really studied the wiki?

Especially this section :
https://www.letscontrolit.com/wiki/inde ... rial_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:

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#14 Post by mr-varga » 29 Jan 2018, 21:09

I try tom re read all the guide and try to understand...

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#15 Post by mr-varga » 30 Jan 2018, 15:26

I have partialy solved, but I still have one problem, on the dummy device I'am not able to assign name to the 3 an 4 value. Why??
Attachments
dddd.PNG
dddd.PNG (60.94 KiB) Viewed 18839 times

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

Re: Http get request

#16 Post by toffel969 » 30 Jan 2018, 16:45

mr-varga wrote: 30 Jan 2018, 15:26 I have partialy solved, but I still have one problem, on the dummy device I'am not able to assign name to the 3 an 4 value. Why??
There are different types of dummy device. You must chose something with quadruple value.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#17 Post by mr-varga » 30 Jan 2018, 18:02

toffel969 wrote: 30 Jan 2018, 16:45
mr-varga wrote: 30 Jan 2018, 15:26 I have partialy solved, but I still have one problem, on the dummy device I'am not able to assign name to the 3 an 4 value. Why??
There are different types of dummy device. You must chose something with quadruple value.
I have tried also with quad or triple bus the last two is no way to name it... Also if I create a new Dummy no one of the 4 value is nominable...

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#18 Post by mr-varga » 31 Jan 2018, 19:21

I have solve the issue with the firmware update. ;)

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

Re: Http get request

#19 Post by toffel969 » 01 Feb 2018, 12:38

mr-varga wrote: 29 Jan 2018, 20:42Now Yes....
Please post your entire rules
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Marko91
New user
Posts: 2
Joined: 24 Mar 2018, 19:17

Re: Http get request

#20 Post by Marko91 » 24 Mar 2018, 19:20

mr-varga wrote: 31 Jan 2018, 19:21 I have solve the issue with the firmware update. ;)
Hello, I've been trying to connect easayesp with WU for a long time ...
Please, could you publish your solution?

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Http get request

#21 Post by mr-varga » 18 Apr 2018, 19:18

Dear all, sorry for the delay but I not have received the notification for the new post....
By the way, now all working correctly and this is my complete situation:
meteo.PNG
meteo.PNG (64.6 KiB) Viewed 18377 times
And this is the two rules I use to converting the value and send all to wu:
Rule 1
on T6H#Temperature do
TaskValueSet 4,1,[T6H#Temperature]*1.8+32
TaskValueSet,4,3,[T6H#Temperature]-(100-[T6H#Humidity])/5
TaskValueSet,4,4,([T6H#Temperature]-(100-[T6H#Humidity])/5)*1.8+32
endon

Rule2
on PR#Pressure do
if [PR#Pressure]>800
if [PR#Pressure]<1100
Publish %sysname%/PR/Pressure,[PR#Pressure]
TaskValueSet 4,2,[PR#Pressure]*0.0295301
SendToHTTP weatherstation.wunderground.com,80,/weatherstation/updateweatherstation.php?ID=XXXXX&PASSWORD=XXXXX&dateutc=now&tempf=[TF#TemperatureF]&humidity=[T6H#Humidity]&baromin=[TF#PressureI]&dewptf=[TF#Dewptf]&action=updateraw
endif
endif
endon

Now I have another problem, but I have to made a new post for this.... See you in next post...

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: Http get request

#22 Post by danmero » 06 May 2018, 01:09

mr-varga wrote: 29 Jan 2018, 19:53 The firs think I have to do, is to create a Dummy Device who convert a °C in Fahrenheit, because the wu strung need Fahrenheit.
I create a Single DummyDevice with value called TemperatureF. In the rules I wrote this:
TaskValueSet 4,1,[T6H#Temperature]*9+32
No dummy or conversion required , just use the formula ( %value%*1.8+32 )on value to convert from C to F.
Next just post the value of device as is.

Regards,

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests