Tasmota script number input

525 views
Skip to first unread message

Stefan Lutz

unread,
Feb 5, 2021, 9:46:21 AM2/5/21
to TasmotaUsers

With the script code below, the value is displayed with 4 decimal places in the number input. I would like to display only 1 decimal place. Can someone help me with this?

Many thanks.

 Code extract:

 >D

nm1temp=11

nm2temp=12

>W

nm(1 50 0.1 nm1temp "Temp Min  ")

nm(1 50 0.1 nm2temp "Temp Max  ")

Philip Knowles

unread,
Feb 5, 2021, 10:22:45 AM2/5/21
to Stefan Lutz, TasmotaUsers

It depends on which sensor you are using  but if you check the Command>Sensors section you can set TempRes 1 but some sensors have their own specific settings

 

Phil K

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/dcfef34e-4b07-40e2-9d7a-4333545bcfedn%40googlegroups.com.

 

sfromis

unread,
Feb 5, 2021, 1:06:56 PM2/5/21
to TasmotaUsers
https://tasmota.github.io/docs/Scripting-Language/
Has two references to setting decimal places.

dpx sets decimal precision to x (0-9)

Variable replacement within commands is allowed using %varname%. Optionally, the decimal places precision for numeric values may be specified by placing a digit (%Nvarname%, N = 0..9) in front of the substitution variable

Read about, and see what you can make work :-) Don't ask me, I'm not using the scripting language.

Reply all
Reply to author
Forward
0 new messages