Report temp to temperatur.nu

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Report temp to temperatur.nu

#1 Post by Goktytan » 01 Feb 2019, 07:03

Hello
I have a working Wemos mini with ESP Easy Mega which works with a temperature but then I try to get my ESPeasy to report a temperature to temperature.nu but I do not know how to do it. Is there anyone here who can help me? I want to report to https://www.temperatur.nu/orter.html using a hach key.
Use a reporting url: http://www.temperatur.nu/rapportera.php ... 4e4&t=12.2. You get the hash code when you register your interest.

Regards Goktytan

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

Re: Report temp to temperatur.nu

#2 Post by grovkillen » 01 Feb 2019, 09:24

SendToHTTP,temperatur.nu,80,/rapportera.php?hash=123abc456&t=[temp2#out]
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:

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

Re: Report temp to temperatur.nu

#3 Post by grovkillen » 01 Feb 2019, 09:26

Use it within a rule. On temp2#out Do...
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#4 Post by Goktytan » 01 Feb 2019, 14:02

Ok so Easy I Will try tonight

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#5 Post by Goktytan » 01 Feb 2019, 16:02

Well that did not works. see my pictures.
Attachments
Skärmavbild 2019-02-01 kl. 15.54.24.png
Skärmavbild 2019-02-01 kl. 15.54.24.png (46.97 KiB) Viewed 1225 times
Skärmavbild 2019-02-01 kl. 15.53.35.png
Skärmavbild 2019-02-01 kl. 15.53.35.png (121.48 KiB) Viewed 1225 times

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

Re: Report temp to temperatur.nu

#6 Post by grovkillen » 01 Feb 2019, 19:01

You need to change the value and task names to comply with your naming convention. So based on your screenshot:
SendToHTTP,temperatur.nu,80,/rapportera.php?hash=123abc456&t=[temp2#Temperatur]
And your syntax is missing a &t for the temperature switch
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#7 Post by Goktytan » 02 Feb 2019, 10:16

Sorry to say it won't work, do I miss something?
Attachments
Skärmavbild 2019-02-02 kl. 10.15.17.png
Skärmavbild 2019-02-02 kl. 10.15.17.png (43.67 KiB) Viewed 1201 times
Skärmavbild 2019-02-02 kl. 10.14.55.png
Skärmavbild 2019-02-02 kl. 10.14.55.png (99.59 KiB) Viewed 1201 times

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

Re: Report temp to temperatur.nu

#8 Post by grovkillen » 02 Feb 2019, 14:05

First, "1" as a task name is not recommended. Second, what does the log say? Will that URL work if you use it in you browser? (If you use it in the browser you need to change the temperature syntax to a real number.
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#9 Post by Goktytan » 02 Feb 2019, 14:41

Ok change it to ute and the url works if i change adress to:
http://temperatur.nu/rapportera.php?hash=XXXXXXXXX&t=[0,5]


Code: Select all

6122717: WD : Uptime 102 ConnectFailures 0 FreeMem 15616
6123607: LoopStats: shortestLoop: 109 longestLoop: 2133048 avgLoopDuration: 130.69 loopCounterMax: 275229 loopCounterLast: 220883 countF
6123608: Scheduler stats: (called/tasks/max_length/idle%) 220883/2011/7/92.40
6136821: DS: SP: 8,0,4b,46,1f,ff,8,10,49,OK
6136829: DS : Temperature: 0.50 (28-f7-d9-34-5-0-0-37)
6136833: EVENT: ute#Temperatur=0.50
6136839: EVENT: ute#Temperatur=0.50 Processing time:6 milliSeconds
6152717: WD : Uptime 103 ConnectFailures 0 FreeMem 15616
6153607: LoopStats: shortestLoop: 109 longestLoop: 2133048 avgLoopDuration: 122.93 loopCounterMax: 275229 loopCounterLast: 234297 countF
6153608: Scheduler stats: (called/tasks/max_length/idle%) 234297/2132/7/92.00

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

Re: Report temp to temperatur.nu

#10 Post by grovkillen » 02 Feb 2019, 15:40

So the comma is the issue here. You need to ask temperatur.nu if it's possible to allow dot instead. Or else we need to fix it some other way.

PS. The square brackets around the temperature shouldn't be there, it's only use within the rules to replace it with the numbers.
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#11 Post by Goktytan » 02 Feb 2019, 17:04

Edit: no i was wrong it won't work.

FYI
It works now with following rule:

SendToHTTP,www.temperatur.nu/rapportera.php?hash=XXXXXXXXXXXXXX&t=[ute#Temp-I]


Tnx for all help @grovkillen

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

Re: Report temp to temperatur.nu

#12 Post by grovkillen » 02 Feb 2019, 17:52

Goktytan wrote:
02 Feb 2019, 17:04
Edit: no i was wrong it won't work.

FYI
It works now with following rule:

SendToHTTP,www.temperatur.nu/rapportera.php?hash=XXXXXXXXXXXXXX&t=[ute#Temp-I]


Tnx for all help @grovkillen
Ah! Great! Thanks for the update.
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#13 Post by Goktytan » 04 Feb 2019, 18:18

I was probably a little too quick when I said it worked.
It doesn't work yet but it feels like I'm on my way. I use the following in Rules:

On System # Boot do // When the ESP boots, do
  timerSet, 1,150 // Set Timer 1 for the next event in 150 seconds
endon

On Rules # Timer = 1 do // When Timer1 expires, do
  SendToHTTP www.temperatur.nu/rapportera.php?hash=X ... XXXXXXX&t=[DS1#Temp]
   timerSet, 1,150 sec
endon

Is there something I miss or do not see?
my log:

Code: Select all

295187: EVENT: Clock#Time=Mon,18:17
295202: EVENT: Clock#Time=Mon,18:17 Processing time:15 milliSeconds
300607: DS: SP: f8,ff,4b,46,1f,ff,8,10,68,OK
300615: DS : Temperature: -0.50 (28-f7-d9-34-5-0-0-37)
300618: EVENT: DS1#Temp=-0.50
300634: EVENT: DS1#Temp=-0.50 Processing time:15 milliSeconds
302742: WD : Uptime 5 ConnectFailures 0 FreeMem 16720
303187: EVENT: Rules#Timer=1
303204: ACT : SendToHTTP www.temperatur.nu/rapportera.php?hash=xxxxxxxxxxxxxxxxxx&t=-0.50
303213: Command: sendtohttp
303214: SendToHTTP www.temperatur.nu/rapportera.php?hash=xxxxxxxxxxxxxxxxxx&t=-0.50
303215: SendToHTTP: Host: www.temperatur.nu/rapportera.php?hash=xxxxxxxxxxxxxxxxxx&t=-0.50 port:
303219: ACT : timerSet,1,150 sec
303226: Command: timerset
303226: timerSet,1,150 sec
303231: EVENT: Rules#Timer=1 Processing time:43 milliSeconds

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

Re: Report temp to temperatur.nu

#14 Post by grovkillen » 04 Feb 2019, 19:34

Is this your rule?

Code: Select all

On System # Boot do // When the ESP boots, do
  timerSet, 1,150 // Set Timer 1 for the next event in 150 seconds
endon

On Rules # Timer = 1 do // When Timer1 expires, do
  SendToHTTP www.temperatur.nu/rapportera.php?hash=X ... XXXXXXX&t=[DS1#Temp]
   timerSet, 1,150 sec
endon
You must change to this

Code: Select all

On System#Boot do // When the ESP boots, do
  timerSet,1,150 // Set Timer 1 for the next event in 150 seconds
endon

On Rules#Timer=1 do // When Timer1 expires, do
  SendToHTTP,www.temperatur.nu/rapportera.php?hash=XXXXXX&t=[DS1#Temp]
   timerSet,1,150
endon
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#15 Post by Goktytan » 04 Feb 2019, 21:08

Hmm, I have no spaces in my Rule but on the other hand no come characters after Sendtohttp so it must have been so when I paste into the forum.
Anyway, I run with your example and with the right "key" and it doesn't work anyway.
when I paste http://www.temperatur.nu/rapportera.php ... xxx&t=0.50 into the browser it seems to work. I think I need to contact admin at temperatur.nu and ask what might be wrong.

This is my log:

Code: Select all

92741: WD : Uptime 2 ConnectFailures 0 FreeMem 16824
93630: LoopStats: shortestLoop: 108 longestLoop: 885489 avgLoopDuration: 126.58 loopCounterMax: 277777 loopCounterLast: 227181 countFi
93631: Scheduler stats: (called/tasks/max_length/idle%) 680014/6338/7/92.20
100186: EVENT: Clock#Time=Mon,20:54
100201: EVENT: Clock#Time=Mon,20:54 Processing time:14 milliSeconds
103186: EVENT: Rules#Timer=1
103207: ACT : SendToHTTP,www.temperatur.nu/rapportera.php?hash=582e26146e2e1d2c479d37d460a48bcb&t=0.50
103216: Command: sendtohttp
103216: SendToHTTP,www.temperatur.nu/rapportera.php?hash=xxxxxxxxxxxxxxxxxxx&t=0.50
103217: SendToHTTP: Host: www.temperatur.nu/rapportera.php?hash=xxxxxxxxxxxxxxxxxxx&t=0.50 port:
103221: ACT : timerSet,1,50 sec
103227: Command: timerset
103227: timerSet,1,50 sec
103231: EVENT: Rules#Timer=1 Processing time:45 milliSeconds

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

Re: Report temp to temperatur.nu

#16 Post by grovkillen » 04 Feb 2019, 21:29

Looks like you need to have that port number (80).

Code: Select all

SendToHTTP,http://www.temperatur.nu,80,/rapportera.php?hash=123abc456&t=[temp#out]
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#17 Post by Goktytan » 04 Feb 2019, 22:03

Now but it looks like it is a space at port: 80 but it may not have any significance.
Still nothing that works unfortunately.

Code: Select all

748: WD : Uptime 11 ConnectFailures 0 FreeMem 15904
658193: EVENT: Clock#Time=Mon,21:56
658208: EVENT: Clock#Time=Mon,21:56 Processing time:15 milliSeconds
718192: EVENT: Clock#Time=Mon,21:57
718208: EVENT: Clock#Time=Mon,21:57 Processing time:16 milliSeconds
722748: WD : Uptime 12 ConnectFailures 0 FreeMem 15904
723635: LoopStats: shortestLoop: 108 longestLoop: 1611745 avgLoopDuration: 123.64 loopCounterMax: 277777 loopCounterLast: 232564 countF
723636: Scheduler stats: (called/tasks/max_length/idle%) 232564/2132/7/91.70
752748: WD : Uptime 13 ConnectFailures 0 FreeMem 15904
756192: EVENT: Rules#Timer=1
756211: ACT : SendToHTTP,www.temperatur.nu,80/rapportera.php?hash=xxxxxxxxxxx&t=1.00
756220: Command: sendtohttp
756220: SendToHTTP,www.temperatur.nu,80/rapportera.php?hash=xxxxxxxxxxx&t=1.00
756221: SendToHTTP: Host: www.temperatur.nu port: 80/rapportera.php?hash=xxxxxxxxxxx&t=1.00
756224: ACT : timerSet,1,150
756234: Command: timerset
756234: timerSet,1,150
756240: EVENT: Rules#Timer=1 Processing time:48 milliSeconds
My Rule

Code: Select all

On System#Boot do // When the ESP boots, do
  timerSet,1,150 // Set Timer 1 for the next event in 150 seconds
endon

On Rules#Timer=1 do // When Timer1 expires, do
  SendToHTTP,www.temperatur.nu,80/rapportera.php?hash=xxxxxxxxxxxxxxxxxxx&t=[DS1#Temp]
   timerSet,1,150
endon

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

Re: Report temp to temperatur.nu

#18 Post by grovkillen » 05 Feb 2019, 06:52

Code: Select all

On System#Boot do // When the ESP boots, do
  timerSet,1,150 // Set Timer 1 for the next event in 150 seconds
endon

On Rules#Timer=1 do // When Timer1 expires, do
  SendToHTTP,www.temperatur.nu,80,/rapportera.php?hash=xxxxxxxxxxxxxxxxxxx&t=[DS1#Temp]
   timerSet,1,150
endon
A comma is missing after the port number, see my example above.
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:

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#19 Post by Goktytan » 05 Feb 2019, 09:12

grovkillen wrote:
05 Feb 2019, 06:52

Code: Select all

On System#Boot do // When the ESP boots, do
  timerSet,1,150 // Set Timer 1 for the next event in 150 seconds
endon

On Rules#Timer=1 do // When Timer1 expires, do
  SendToHTTP,www.temperatur.nu,80,/rapportera.php?hash=xxxxxxxxxxxxxxxxxxx&t=[DS1#Temp]
   timerSet,1,150
endon
A comma is missing after the port number, see my example above.
Oh, I have missed I will update during the day and we will see if there will be any difference.

Goktytan
Normal user
Posts: 11
Joined: 01 Feb 2019, 06:59

Re: Report temp to temperatur.nu

#20 Post by Goktytan » 05 Feb 2019, 16:43

Eureka, it works now !!

Code: Select all

On System#Boot do // When the ESP boots, do
  timerSet,1,150 // Set Timer 1 for the next event in 150 seconds
endon

On Rules#Timer=1 do // When Timer1 expires, do
  SendToHTTP,www.temperatur.nu,80,/rapportera.php?hash=XXXXXXXXXXXXXXXXXX&t=[DS1#Temp]
   timerSet,1,150
endon

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

Re: Report temp to temperatur.nu

#21 Post by grovkillen » 05 Feb 2019, 20:24

Great!
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:

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests