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.

Reduce 0-100% to 10-100%
#1
Hi!

What is the easiest way in the LM to reduce a 1 byte in percent from 0-100 to 10-100? I got a group address I want to send throug a "filter" and the result have to be from 10 to 100%.

Any ideas?  Smile
Reply
#2
So minimum neds to be 10? Scaled so that 0=10 or that 10=10 but the output does not go lower?

Sent fra min SM-G980F via Tapatalk
Reply
#3
(10.03.2021, 19:43)tomnord Wrote: So minimum neds to be 10? Scaled so that 0=10 or that 10=10 but the output does not go lower?

Sent fra min SM-G980F via Tapatalk

Yes, minimum 10%. 0 - 10 is equal 10, 11 = 11 %.
Reply
#4
(10.03.2021, 19:48)Rune Wrote:
(10.03.2021, 19:43)tomnord Wrote: So minimum neds to be 10? Scaled so that 0=10 or that 10=10 but the output does not go lower?

Sent fra min SM-G980F via Tapatalk

Yes, minimum 10%. 0 - 10 is equal 10, 11 = 11 %.
Event based script:

value = event.getvalue()



if value < 10 then
output = 10
else
output = value
end


grp.write('1/1/1', output)

Sent fra min SM-G980F via Tapatalk

Event based script with the 0-100 value GA as trigger.

Sent fra min SM-G980F via Tapatalk

At output you can use "grp.update('1/1/1', output) also...

Sent fra min SM-G980F via Tapatalk
Reply


Forum Jump: