Decimal places for command line sensors

Hi everyone,

I am trying to use the command line sensor with an external python script to log road surface temperatures on my daily bike route. I added the following sensor to my config file

sensor 3: platform: command_sensor name: Bike road temperature command: "python3 /home/pi/roadConditions.py road" unit_of_measurement: "\u2103" value_template: '{{ round(2) }}'

The script returns a single number like so,
8.67
but home assistant logs the temperature as 9.0. I would like the full number or at least 8.7.

I tried a couple of different options with the templates.

No template. value_template: '{{ value | round(2) }}' value_template: '{{ value }}'

but nothing works. Anyone got any ideas?

value_template is something that is currently only available in the development version. We expect to release it soon.

In the development version, given a template like “{{ value | round(2) }}” should work

Great. Then I will wait for the stable :slight_smile:

Thanks!

Just updated to the recent release of version 0.10.1 which included the fix for decimal places. Everything worked our of the box. Thanks!