Help needed with Template Sensor

Hi all, I am fairly new in HA and need some help setting up some template sensors. I have 3 Sonoff temperature/humidity sensors that are slightly off and would like to set an offset to them. Sensors are connected to HA through a Sonoff ZigBee Bridge and Sonoff LAN Integration. From what I understand the best option to add an offset is to create a template sensor for each of them. If that is correct where should I start? I’ve read the HA guide but I really suck in coding so nothing worked. Is there anyone kind enough to help a noobie? :slight_smile:

Check this
Compensation - Home Assistant (

I get the concept of compensation but I am confused when I get to data points, if I understand right, I need to define 2 datapoints for each sensor, if so is the following correct?



    source: sensor.sonoff_a480041241_temperature

    attribute: temperature

    unit_of_measurement: C


      - [20, 19]

      - [25, 24]

The more datapoints the better so it seems, the doc is not too clear except for stating that linear needing 2. My temp sensors are horrible as they never seem to align to the same diff with my reference, gave up.

Solved it adding the following at the end of my configuration.yaml file

  - sensor:
      - name: "lounge_temp_offset"
        unit_of_measurement: "°C"
        state: "{{ states('sensor.sonoff_a480041241_temperature')|float +1 }}"