Help with sensor offset

Hi, this is what I have in configuration.yaml.

  - platform: template
    sensors:
      garage_temperature_offset:
      value_template: '{{ states.sensor.aeotec_zw074_multisensor_gen5_temperature.state | float + 4 }}'
      friendly_name: 'garagetemp'

Hass is complaining that the code is invalid.

Testing configuration at /config
ERROR:homeassistant.config:Invalid config for [sensor.template]: expected a dictionary for dictionary value @ data['sensors']['friendly_name']. Got 'garagetemp'
expected a dictionary for dictionary value @ data['sensors']['garage_temperature_offset']. Got None
expected a dictionary for dictionary value @ data['sensors']['value_template']. Got '{{ states.sensor.aeotec_zw074_multisensor_gen5_temperature.state | float + 4 }}'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.template/
Failed config
  sensor.template: 
    platform: template
    sensors: [source /config/configuration.yaml:43]
      friendly_name: garagetemp
      garage_temperature_offset: None
      value_template: {{ states.sensor.aeotec_zw074_multisensor_gen5_temperature.state | float + 4 }}

Successful config (partial)
  sensor.template:

Any idea what I am doing wrong?

Thanks

You need to indent the properties of the garage_sensor_offset sensor like this:

- platform: template
    sensors:
      garage_temperature_offset:
        value_template: '{{ states.sensor.aeotec_zw074_multisensor_gen5_temperature.state | float + 4 }}'
        friendly_name: 'garagetemp'
2 Likes

Brilliant! That gets rid of the error.

But I am having trouble displaying the value.

I tried this in my group.yaml

garage:
  name: Garage
  entities:
    - light.garage 
    - zwave.aeotec_zw074_multisensor_gen5
    - sensor.temperature
    - sensor.garage_temperature_offset
    - sensor.aeotec_zw074_multisensor_gen5_relative_humidity
    - sensor.luminance
    - binary_sensor.sensor

The "sensor.temperature’ entry above is the temperature value as reported by the aeotec sensor and the sensor.garage_temperature_offset should be the value after offset correction.

While Hass is not complaining of code error, it does not display the temperature after offset.

Did I get the code wrong?

your sensor is PROBABLY called sensor.garagetemp.
You can use the states developer tool to find the actual name of your sensor.
When you find the name, add it to your group.

Thanks. Tried sensor.garagetemp. still not showing the value.

There is no compile error however.

Also in states developer there is no sensor.garagetemp listed. Would I be expected to find this there? I can find the original Aeotec sensor there just not garagetemp.

Any ideas?

Sorry to revive a REALLY old thread, but this seems to be a common problem for people. I have created a feature request so if you end up here from Google please vote on this:

2 Likes