Formatting integers as float

i use a sensor card to show the analog output of a Tasmota device. This is an integer say 500. I like to show it as 5.00. I have searched and tried but nada. in delphi you canuse the format() function to get output as you want. does something exist or is there some solution? it seems like a very basic thing but i might miss something.

I don’t belive you can do it on the card but you could easily do it with a value_template:

thanks for the reply. i do not know how yet but i will google it :slight_smile:

Your sensor value is wrong, if it shows 500 and should be 5.
You would need to make a template sensor to correct that with division of 100.
Once that is done, then you can use the display precision in the entity’s settings page to set the number of decimals wanted in a display.

thanks. i have been reading about templates but i have a hard time to understand it. i think i will try a different solution. maybe i watch some YT videos but a lot is unclear mostly because i do not understand some concepts. maybe using node red will solve the problem for me. the 500 is not wrong since it is a scaled value because i used a resistor divider. anyway thanks for pointing to the right direction.

A little change of the first example there.

template:
  - sensor:
      - name: "corrected_output"
        state: >
          {{ (states('sensor.with_scaled_output') | float)/100 }}

Wally, super thanks. Thanks to you i have it working now. I finally understood i had to edit the config.yaml and add the sample code with my own sensor name of course. then i had problems to get this value in the template. only after a restart of HAS it showed up. there is probably a simpler method for that. but one of my problems is that for me it is not intuitive where to find all settings and things i want to do. but i learned something. i now understand it a bit better :slight_smile:

It is a steep learning curve, but you are hanging on for now. :slight_smile:

And restarting HA core is required when you want to apply changes made to the configuration.yaml file.

thanks. i appreciate you took the time to help me. usually i read help pages, or watch YT. but once it is working there is no need to change things. and with my age i foget things done some years ago. and while a super great platform it is not intuitive for me. but i decided to keep busy with it so i will remember it better. i see a lot is possible.

Be careful! HA can a lot and the possibilities will pull you in and bug you down.
I see MANY addicts on the forums that are locked in an unhealthy relation to their HA installation. :rofl: :rofl: :rofl: