Tasshack / dreame-vacuum

Home Assistant integration for Dreame robot vacuums with map support
https://community.home-assistant.io/t/custom-component-dreame-vacuum
MIT License
888 stars 111 forks source link

Any way to chance area units from m^2 to ft^2 #634

Closed knobunc closed 4 months ago

knobunc commented 4 months ago

Thanks for the amazing integration!

I have changed the unit in my app (X40 Ultra) to sqft, but can't work out how to make the integration use sqft rather than m^2. Is there something obvious I have overlooked? I couldn't find it in the docs or the integration configuration.

Thanks

Tasshack commented 4 months ago

Vacuum always returns units as m2 and app handles the conversion on clientside also stores the setting inside your phone. I have considered adding it to the configuration options but it is too much efford for me for now, maybe I can add it to the to do list.

You can create a template sensor and make conversion in your HA. This is an example for converting C output of a sensor to F;

sensor:
  - platform: template
    sensors:
      temperature_livingroom:
        friendly_name: Living Room Temperature
        unit_of_measurement: 'f'
        value_template: >-
            {{ ((states('sensor.temp_1_temperature') | float) * 1.8) + 32 }}