Page 1 of 1

LCD: right-aligned values ???

Posted: 05 Jul 2019, 19:25
by M*I*B
Hi there again,

on a 07S I use a BM280, a lightsensor BH1750FUI and a 4x20 LCD. Temp. and Humity are well formed and takes 5 digits (when the temperature reaches 100 ° C, nobody will be there to read it :lol: ). Pressure are most also takes 7 Digits, somtetimes 6.
But the Lightsensor gives values from 0.00 up to more then 40000.00 LUX. Ok... In nature more then 9000 I don't await but then it jump's arround between 5.00 and 9000.00 ...

At the LCD there is no option to align values on the right side... So if there a way by formulas inside the Options of the Sensor itselfe to say i.e. "If one character before the comma fill with 3 spaces, if 2 before fill with 2 spaces....) ???

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 19:27
by grovkillen
I use percent instead of the actual value since 4768 lux doesn't do it for me. I like 1...100% better. But that's me I guess.

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 19:30
by grovkillen
That being said. You can do left of right align, can't remember the syntax just now but you need to use rules.

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 19:36
by grovkillen
I haven't been able to add it to the docs but here's the PR describing it:

https://github.com/letscontrolit/ESPEasy/pull/1289

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 19:52
by M*I*B
... ok, I have read it but I just understand... nothing :cry:

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 20:24
by grovkillen
Lets say your task is called "sun" and its value is named "lux" you could do this (in rules)

[sun#lux#R#P2]

To justify the value to the right and add two spaces on the left of the value.

Just as one example.

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 20:28
by M*I*B
AHHHH! Ty a lot! Now I get it (I hope)

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 20:44
by grovkillen
Enjoy!

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 20:58
by M*I*B
.. nope ... I'm too dumb for that :cry:

Where I have to insert it? In the Formula-field at the sensor or in the line-field at the display?

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 21:01
by grovkillen
If it's not working to add that to those [....] Inside the settings of the LCD task you need to use the LCD command inside rules.

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 21:22
by M*I*B
... ok, I'm sorry but I'm realy too dumb to handle that...
I have searching arround the forum and other but don't find an exsample for that how I can see howto ...

Not so important... It's ok what I have now. The little bad thing is accepted ...

Re: LCD: right-aligned values ???

Posted: 05 Jul 2019, 22:12
by grovkillen
Sleep on it and give it another try another day. Never give up.