Help needed setting an offset on Xiaomi Mija BLE Temperature and Humidity Sensor (mitemp_bt)

Does anyone know how to set an offset on the Xiaomi Mijia BLE Temperature and Humidity Sensor , through the mitemp_bt sensor?

https://www.home-assistant.io/integrations/mitemp_bt/

1 Like

Does no one know how or if this can be done? If it can’t be done directly, is there some way of adding a calculation in configuration?

You can do this with a template sensor as follows
If you need to calibrate the sensors you can do so by adding this to configuration.yaml (subtracting 0.8C from reading). Add to sensor: section in configuration.yaml

  - platform: template
    sensors:
      study_temp_calibrated:
        friendly_name: 'Study Temperature'  
        value_template: >-
          {{ (float(states.sensor.study_temperature.state) - 0.8) | round(1) }}
        icon_template: mdi:thermometer
        unit_of_measurement: '°C'
1 Like

murtoz, thanks for pointing me in the direction of templates. My final configuration looks like this and works:

  - platform: template
    sensors:
      stairs_temp_calibrated:
        friendly_name: 'Stairs Temperature'
        value_template: "{{ states('sensor.stairs_climate_temperature') | float -1.4 | round(1) }}"
        icon_template: mdi:thermometer
        unit_of_measurement: '°C'
1 Like