Solving Sensor Decimal Issues in Home Assistant

Hey everyone, I wanted to share my recent experience with a sensor issue I encountered in Home Assistant. I’ve been exploring the platform and have managed to set up some cool stuff, but I hit a snag with a sensor from Nibe Pi via MQTT. The sensor uses degree minutes, which is a dimensionless number, but it’s formatted with a period instead of a comma. Since I’m Dutch, my locale settings use commas for decimals, which caused some confusion.I reached out to the community for help, and with some guidance, I managed to convert the period to a comma using the replace filter in a template. Here’s how I did it:markdown{{ states(‘sensor.nibe_degree_minutes_16_bit’) | replace(‘.’, ‘,’, 1) }}This change made the sensor display correctly, but I noticed that the value was still being treated as text rather than an actual number. This led to incorrect history data, which was a bit frustrating. After some research and experimentation, I realized that the issue was with how the sensor’s device class was set. By adjusting the device class to recognize the value as a number, I was able to resolve the issue and ensure accurate data logging.I thought I’d share this experience in case anyone else runs into similar problems. It’s a small tweak, but it makes a big difference in maintaining reliable data within Home Assistant. If you’ve encountered similar sensor issues, feel free to reach out—I’d be happy to help!