Tweaking temperature on Sonoff temp sensor

Hello
Is it possible to tweak the driver code so that my Sonoff SNZB-02 sensors report temperature to one significant figure, rather than two, e.g 21.4 degC instead of 21.36 degC. Even just losing the last digit would suffice!

You would need to start with a user- created driver. Most built in drivers are not editable. But I would think there is a generic temp driver that could be easily modified. Perhaps start here...

I have been using @kkossev 's great driver with these sensors. They are displaying only one decimal place in Fahrenheit. Don't know if it would be any different with Celsius, but definitely worth a try.
2024-03-07 10.51.18 192.168.1.5 828139123212

1 Like

There was recent discussion about the general concept of decimal places for another device - in many ways you actually do want the depth, and then use the tile tools your using to adjust what is displayed.
I do agree there are no standardization between the various drivers. I do recall one driver that offered a decimal place setting in the preferences but I can't find/dont see it to offer it as a possible model...

Myself, I'm a devout HD+ and Tile Builder fanatic. Within my tile settings, (my office floor heater thermostat as one example, EG;) - note 'precision'.

Tile Builder also lets you control the data - here's a tabled tile I use for my house temp reporting device (including a couple of Sonoff units)
image

I also rely on grafana to output values in the form I'd like - my humidity sensors report tenths but as you can see, I'm rounded (correctly!)
image

I recognize you're speaking about the ability of the driver to control the value - what you could do is take control of it by creating your 'custom' version of the driver - then modifying it to meet your needs - @bravenel once described a way to adjust decimal position as well.
You could also use a variable to output your value and store it in the format you wish... I've used all of the above!