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.

Average temperatur
#1
Hi 

I have a big room with 3 thermostats. Could there the some logic to compare in the logic module to compare the three temperatures to get an average temp. Then use this to control the room?
Reply
#2
Hi,

Try this:
Code:
T1 = grp.getvalue('1/1/1')
T2 = grp.getvalue('1/1/2')
T3 = grp.getvalue('1/1/3')
AV = math.round((T1 + T2 + T3) / 3, 2)
grp.write('1/1/4', AV)
BR,

Erwin
Reply
#3
Is rounding needed?  I normally just sent the value to the knx driver and let it deal with the formatting.  (Though thinking about it I have not checked if its rounding or just chopping off the decimal places...)
Reply
#4
Scripts is hard learning for me. So i try but really not my best side. 

Ok so i put a new script in event based. Then i pushed the run script button on the bottom. 

But then it flooded my knx group monitor writing the value every milli second. 
What did i do wrong?
Reply
#5
Hi,

You probably have the event on the output, this will retrigger the event every time the output is written.

For the correct avarage like sample above you need to put a tag on the 3 input values and set the event script to the same tag. Make sure the output is NOT tagged like the inputs.

BR,

Erwin
Reply
#6
(02.06.2018, 07:23)Erwin van der Zwart Wrote: Hi,

You probably have the event on the output, this will retrigger the event every time the output is written.

For the correct avarage like sample above you need to put a tag on the 3 input values and set the event script to the same tag. Make sure the output is NOT tagged like the inputs.

BR,

Erwin
Yes that was the case. Thanks alot. The scripting is a whole New game for see. So much to learn, and dont really dont know where to start. 

Thanks again.
Reply
#7
Hi,

If script is to hard for you at the moment you can always use the FBeditor app, there should be a average graphic block.

Basic functions are fine to do with it..

BR,

Erwin
Reply
#8
(02.06.2018, 17:00)Erwin van der Zwart Wrote: Hi,

If script is to hard for you at the moment you can always use the FBeditor app, there should be a average graphic block.

Basic functions are fine to do with it..

BR,

Erwin

I have used the FBeditor for functions. And looked but could not find something to measure analog values. But i will have another look. But thanks for all the help..
Reply


Forum Jump: