This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Maximum Value
#1
Hey ... I need another tip please.
I want to record the maximum value of the wind speed and then the date and time. That I can display it in visualization. tried FB Editor but couldn't do it.
The wind value comes every 10 seconds and is a 09.2 byte.
Does anyone have a tip on how I can do this?
Reply
#2
(13.03.2020, 20:10)Tee_Trinker Wrote: Hey ... I need another tip please.
I want to record the maximum value of the wind speed and then the date and time. That I can display it in visualization. tried FB Editor but couldn't do it.
The wind value comes every 10 seconds and is a 09.2 byte.
Does anyone have a tip on how I can do this?
You only want the maximum value and show this in visu. Is it just to see the maximum that has been before or whats the use?
Why not use trend?
Reply
#3
the Maximum ever...the fastest wind speed.
if i use the trend it is difficult to see the absolute maximum
Reply
#4
Hi,

Just.make 2 extra (virtual) objects (1x 2 byte and 1x 250 byte) and put this event script on your windspeed object.
Code:
if event.getvalue() > grp.getvalue('32/1/1') then
   grp.update('32/1/1', event.getvalue())
   grp.update('32/1/2', os.date('%A %d %B %H:%M'))
end
You should also be able to put these 2 object values to a widget with the widget creator in the Touch visu.

BR,

Erwin
Reply
#5
Hey it works.....Thank you!!!!!

Attached Files Thumbnail(s)
   
Reply
#6
Tried this, created 2 new virtual but getting this error?

   
Reply
#7
There is missing apostrophe after /3 on line 2, it should be '32/1/3'
Reply
#8
Hi, is this working with 09.001 Temperature type objects??

I added this example to my boiler's temperature group, and nothing going on...

Also added this code and manually changed temp value, but nothing changed, log was not written. Shoud I change something for 09.001 type??

if value then
value1 = grp.getvalue('20/2/2') -- this is 09.001 type
log(value1)
grp.update('40/1/1', value1)
end

Alex
Reply
#9
Copy the script as is and only change group addresses without changing anything else. Exact data type does not matter as long as it is numeric.
Reply
#10
If I add this script to other temperature group - it works. But I add this to my boiler's group - not working. To this group data is written from OneWire senesor connected to OneWire port.

If I manually trying change data in this group - and after this open OneWire setting - i see instead of group number 20/3/2 just number 41730 and invalid group address. Can it be linked somehow??
Reply
#11
Try clearing browser cache and check if you still see the 41730
------------------------------
Ctrl+F5
Reply
#12
The code inside "if" won't execute because value variable is never defined in your code:
Code:
if value then
value1 = grp.getvalue('20/2/2') -- this is 09.001 type
log(value1)
grp.update('40/1/1', value1)
end
Reply
#13
(17.03.2020, 09:03)admin Wrote: The code inside "if" won't execute because value variable is never defined in your code:
Code:
if value then
value1 = grp.getvalue('20/2/2') -- this is 09.001 type
log(value1)
grp.update('40/1/1', value1)
end


admin, yes now I know now mistake in my example, but I mean that for my group with 09.001 type your example not working. To this group I save data from 1-wire sensor.. Why it could be??

Code:
if event.getvalue() > grp.getvalue('40/1/1') then
   grp.update('40/1/1', event.getvalue())
   grp.update('40/1/2', os.date('%A %d %B %H:%M'))
end

Finally found problem - group was not created correctly - group number Smile Now all working Smile
Reply
#14
This script is different then the one you posted earlier, what are you trying to achieve?
------------------------------
Ctrl+F5
Reply
#15
Daniel,

thank you, all is working now. I thought that problem connected with temperature data type. But I simply mistaken in group creation. Now all is working, and I am also still learning myself.
Reply
#16
(17.03.2020, 16:49)AlexLV Wrote: Daniel,

thank you, all is working now. I thought that problem connected with temperature data type. But I simply mistaken in group creation. Now all is working, and I am also still learning myself.

Hey Guys,

I've done that for my outside temperature now. Works also great, but only the maximum temperatures.

What do I have to change in the script to get the minimum temperatures?

 I am also still learning myself  Angel
Reply
#17
Change comparison sign from > to <
Reply
#18
(24.03.2020, 16:51)admin Wrote: Change comparison sign from > to <

it doesnt work


if event.getvalue('0/2/3') < grp.getvalue('32/1/64') then
  grp.update('32/1/64', event.getvalue('0/2/3'))
  grp.update('32/1/65', os.date('%d.%m.%Y | %H:%M'))
end
Reply
#19
What is the current value of 32/1/64? If you have just created this object then it's probably 0 which is probably lower than the outside temperature. Write some large value like 100 there and check if script starts working.
Reply
#20
(24.03.2020, 18:44)admin Wrote: What is the current value of 32/1/64? If you have just created this object then it's probably 0 which is probably lower than the outside temperature. Write some large value like 100 there and check if script starts working.

now it works.
I manually set the outside temperature to 30 and then to -30.
After that I got the 32/1/64 (2byte virtual object) back to 0, and then it changed automatically.

Thanks!!!
Reply


Forum Jump: