localtuya icon indicating copy to clipboard operation
localtuya copied to clipboard

HA 2022.4.1 Unit of Measurement Feature needs native_unit_of_measurement

Open RJ-Make opened this issue 2 years ago • 10 comments

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.

RJ-Make avatar Apr 09 '22 13:04 RJ-Make

https://developers.home-assistant.io/docs/core/entity/sensor/ suggests this is optional, what behaviours are you seeing that suggest it is required?

CloCkWeRX avatar Apr 10 '22 04:04 CloCkWeRX

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.

2022-04-10_10-05-27

My particular use-case would allow me to convert a manual added food thermometer from Celsius to Fahrenheit.

RJ-Make avatar Apr 10 '22 14:04 RJ-Make

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!

lindsaymarkward avatar Jul 07 '22 03:07 lindsaymarkward

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.

barrymossel avatar Jul 08 '22 16:07 barrymossel

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.

outrun0506 avatar Aug 02 '22 08:08 outrun0506

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.

barrymossel avatar Aug 09 '22 08:08 barrymossel

Will do, currently I'm on vacation. Back home I'll share my Sensor

outrun0506 avatar Aug 09 '22 20:08 outrun0506

@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) }}

outrun0506 avatar Aug 20 '22 14:08 outrun0506

@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!

barrymossel avatar Sep 07 '22 11:09 barrymossel

Please add the unit_of_measurement parameter. https://github.com/rospogrigio/localtuya/issues/1074

garry0garry avatar Oct 08 '22 13:10 garry0garry

Also ran into this issue

brentk7 avatar Jan 07 '23 04:01 brentk7

Yup, I have the same issue as well.

polskikrol avatar Jan 11 '23 18:01 polskikrol

Same, this would be a very useful feature for anyone using the metric system.

wildekek avatar Nov 20 '23 18:11 wildekek