localtuya
localtuya copied to clipboard
HA 2022.4.1 Unit of Measurement Feature needs native_unit_of_measurement
The problem
With the introduction of the Unit of Measurement feature in HA 2022.4.1 it appears that native_unit_of_measurement
needs to be added.
https://developers.home-assistant.io/docs/core/entity/sensor/ suggests this is optional, what behaviours are you seeing that suggest it is required?
https://developers.home-assistant.io/docs/core/entity/sensor/ suggests this is optional, what behaviours are you seeing that suggest it is required?
It appears without it you cannot use the new Unit Of Measurement feature.

My particular use-case would allow me to convert a manual added food thermometer from Celsius to Fahrenheit.
Hi, I appear to have a similar issue. I can't work out how to get my Inkbird IBBQ-4T to give me degrees celsius using localtuya. As per the forum discussion, it used to work if I set the unit to °F (using the exact ° symbol) and HA would auto-convert to C since that's my general setting: https://community.home-assistant.io/t/cannot-get-tuya-integration-to-work/226356/19 Now, no matter what I set in localtuya, I can't get my temperatures to convert - they always report in Fahrenheit with whatever unit I enter next to the value. Can this be updated now please? Thank you!
Hi, I appear to have a similar issue. I can't work out how to get my Inkbird IBBQ-4T to give me degrees celsius using localtuya. As per the forum discussion, it used to work if I set the unit to °F (using the exact ° symbol) and HA would auto-convert to C since that's my general setting: https://community.home-assistant.io/t/cannot-get-tuya-integration-to-work/226356/19 Now, no matter what I set in localtuya, I can't get my temperatures to convert - they always report in Fahrenheit with whatever unit I enter next to the value. Can this be updated now please? Thank you!
Same for me. Quite annoying.
Now, no matter what I set in localtuya, I can't get my temperatures to convert - they always report in Fahrenheit with whatever unit I enter next to the value.
Can this be updated now please?
Thank you!
Hi, same for me. Also using a Inkbird IBBQ-4T.
Just created a Tenplate Sensor to covert for now.
Now, no matter what I set in localtuya, I can't get my temperatures to convert - they always report in Fahrenheit with whatever unit I enter next to the value. Can this be updated now please? Thank you!
Hi, same for me. Also using a Inkbird IBBQ-4T.
Just created a Tenplate Sensor to covert for now.
Could you share the sensor please? I don't have any hopes for this repository to be honest, looking at all the open pull requests and issues.
Will do, currently I'm on vacation. Back home I'll share my Sensor
@barrymossel
Here is my Sensor Config for convert °F to °C:
- platform: template
sensors:
ibbq_sensor1_c:
friendly_name: "iBBQ Sensor 1"
unit_of_measurement: '°C'
value_template: >-
{{ (((states.sensor.ibbq_sensor1.state | float - 32 )) * 5/9) | round(1) }}
ibbq_sensor2_c:
friendly_name: "iBBQ Sensor 2"
unit_of_measurement: '°C'
value_template: >-
{{ (((states.sensor.ibbq_sensor2.state | float - 32 )) * 5/9) | round(1) }}
ibbq_sensor3_c:
friendly_name: "iBBQ Sensor 3"
unit_of_measurement: '°C'
value_template: >-
{{ (((states.sensor.ibbq_sensor3.state | float - 32 )) * 5/9) | round(1) }}
ibbq_garraum_c:
friendly_name: "iBBQ Garraum"
unit_of_measurement: '°C'
value_template: >-
{{ (((states.sensor.ibbq_sensor4.state | float - 32 )) * 5/9) | round(1) }}
@barrymossel
Here is my Sensor Config for convert °F to °C:
- platform: template sensors: ibbq_sensor1_c: friendly_name: "iBBQ Sensor 1" unit_of_measurement: '°C' value_template: >- {{ (((states.sensor.ibbq_sensor1.state | float - 32 )) * 5/9) | round(1) }} ibbq_sensor2_c: friendly_name: "iBBQ Sensor 2" unit_of_measurement: '°C' value_template: >- {{ (((states.sensor.ibbq_sensor2.state | float - 32 )) * 5/9) | round(1) }} ibbq_sensor3_c: friendly_name: "iBBQ Sensor 3" unit_of_measurement: '°C' value_template: >- {{ (((states.sensor.ibbq_sensor3.state | float - 32 )) * 5/9) | round(1) }} ibbq_garraum_c: friendly_name: "iBBQ Garraum" unit_of_measurement: '°C' value_template: >- {{ (((states.sensor.ibbq_sensor4.state | float - 32 )) * 5/9) | round(1) }}
Thanks!
Please add the unit_of_measurement parameter. https://github.com/rospogrigio/localtuya/issues/1074
Also ran into this issue
Yup, I have the same issue as well.
Same, this would be a very useful feature for anyone using the metric system.