Change the precision of temperature sensor

I’m trying to get HA to report temperature to 1 decimal place (e.g. 17.6).

  • My aeotec Multisensor 6 sensors feed HA via ZWave, a Hubitat Hub and MQTT
  • The hub reports temps to 1 decimal place
  • MQTT Explorer shows the temps it is passing to HA to 1 decimal place
  • I’ve used Display Precision to set the temp sensor entities to 1 decimal place
  • The dashboard displays temps to 1 decimal place, but always ending with ‘.0’
  • History displays charts where the temp changes by whole degrees
  • DevTools States shows the temperatures as whole numbers
  • I have other temperature sensors that HA does report to 1 decimal place

I figure I’m missing something obvious here. Can anyone give me a clue?

How is the sensor defined in HA?
In a MQTT sensor in configuration.yaml? Then show it.

The sensor is defined to HA through the Hubitat integration. It is not referenced in configuration.yaml
Here is what MQTT is passing (from MQTT Explorer).
image
Here is what HA is reporting.
image
Seems to me that HA is picking up the temperature to 1 decimal place, but storing and reporting it using whole numbers.

Through the custom integration in HACS? There is no builtin one. Did you ask the dev about this peculiarity?

And then, how is MQTT relevant? That integration is using Hubitat API, not MQTT

Yes. Through the custom integration in HACS.

I think the Hubitat custom integration uses MQTT to transmit messages between the Hubitat Hub and HA. I can’t think of any other way to explain the sensor showing up in MQTT Explorer (in the Homie group - source of the graph already shared) or MQTT being mentioned on the HA device screen for the sensor, as shown here:
image

Well, no. Your screenshot shows it goes indeed through MQTT, not through a HA Hubitat integration.
As you seem unaware, you surely didn’t define the MQTT sensor manually in HA, so it comes from a discovery topic.

That topic is likely named homeassistant(ha_stream for me)/sensor/<name_of_sensor>/config
Please post its content.

I believe the sensor in HA was set up by the Hubitat integration. As you say, I didn’t do it manually.

Is this what you are looking for?

See above :wink:

Aaah. I see it now. Thank you. But how can / where do I change it?

That’s done in whatever’s creating that discovery information. I.e. the custom integration.

Your other option is to just manually add the entity yourself using MQTT yaml.

I don’t think there is a custom integration, at least not an HA one (what would be the point to go through MQTT?).
There is some confusion, here, and I suspect it is some sort of Hubitat addon.

1 Like

Yes, whatever it is (addon, integration), it’s creating the rounded discovery information. Once OP figures out what’s creating that discovery, he can move on to fix it.

1 Like

Thanks for your help guys. I will leave this open for now. Will investigate further and post an update once I have figured out how to change the precision.

I’m thinking it has to be something on the HA side of the MQTT Broker , since MQTT Explorer shows the broker is getting the temperature to one decimal place. Whatever it is was probably put there by the HACS Hubitat custom integration.

My man, it’s the discovery info being sent to HA. It’s not where you think it is. You already proved this by showing us the discovery info. You’re welcome to ignore the advice, but realize that you’re chasing something that’s not the problem.

Copy the discovery information using MQTT explorer, create a script that republishes is without the
| round(0)

OP, you installed a MQTT app on your hubitat hub, likely that one:

The error comes from there

It seems you might fix it by setting your tempUnits to Celsius x.x°C in the config.

1 Like

You were right! It’s been so long since I set these sensors up that I’d forgotten how they were working. Thank-you for your pointing me in the right direction. For the benefit of anyone else reading this, here’s what you need to do (using the Hubitat Hub app)

Step 1: Open the MQTT app

Step 2: Click on Configuration
image

Step 3: Click on the Temperature Units drop down and select the option shown in the picture below
image

That’s all there is to it! The change should have immediate effect.

Glad that it is solved, but for the future, try to understand and take note of how your setup works.
You were lucky that I like detective work, here :joy: