In Home Assistant, I have a heating temperature reading that includes a decimal place. However, Homey rounds this figure to a whole number. How can I use a conversion function to adjust this to show one or more decimal places?
Unfortunately it’s not possible to edit an entity in order to change the decimal option.
I suggest to add the sensors to that device again to be able to set the number of decimal places.
Next, remove the “old” sensors with the rounded values.
Maybe @RonnyW can tell us more about the (default) rounding to integers (rounded numbers) for entities with one or more digits.
Hi, currently these options are only present in “add entity” view. I can check later if I can add it also to the change view. Should also be possible because it’s just a change of capability options.
For now, just add the entities again with decimal places like @Peter_Kawa suggested.
Thank you for the suggestion, @Peter_Kawa. I tried this as a sensor. And it is still changing as a whole number. Only when i place a second identity i can change it to 2 decimals. So i’m closer, but it makes it more messy.
Thanks for looking into it @RonnyW. I hope that this can be implented. I keep my fingers crossed.
The sensor is added dependent on HA device class or (if no class is defined) based on unit of measurement.
Based on this check, a Homey capability is used and this capability defines, how the value is displayed.
Can you please copy/paste the entity details from HA developer tools? Which device class or mneasurement is used in HA?
What capability is used in your Homey sensor device? You can check it in developer tools.
PS:
If it’s about the pressure entity, then it seems the app used measure_pressure capability based on device class “pressure”. And measure_pressure has no decimals. See capability documentation:
At the end, using sensor device is the easy way. If you want to customize the device, it’s better to use the “custom device” and the add the entity with all needed parameters.
PPS: I can check next week if I can use the range/decimals attributes from HA when adding the device…
@Pieter_Pessers@Peter_Kawa FYI and test. In device settings od “sensor deviice”, you can now change the unit and decimals settings.
I haven’t seen decimals attributes in HA sensor entities. So best way is to set is yourself in device settings.