Template not resolving data just off

Hi, need some template help. I’m trying to create a template that extracts the tire pressure from a set of attributes. Here’s what I used:

      car_tire_pressure_rear_left:
        friendly_name: Tire pressure Rear Left
        value_template: '{{ (states.binary_sensor.mycar_tire_warning.attributes.tirepressureRearLeft  / 6.89) | round (1) }}'

The problem is that the result is just showing off. This has happened to me elsewhere as well, like when trying to retrieve data from the last text message, I just get off, which is of no use to me. What am I doing wrong. The odd thing is it works perfectly when I use the template generator/tester but when I implement it in yaml it doesn’t work. Any help is appreciated!

Where are you putting this in your configuration.yaml?

it needs to go under

sensor:
  - platform: template
    sensors:
      ar_tire_pressure_rear_left:
        friendly_name: Tire pressure Rear Left
        value_template: '{{ (states.binary_sensor.mycar_tire_warning.attributes.tirepressureRearLeft  / 6.89) | round (1) }}'

Man, I feel like an idiot. I’ve spent almost an entire day on this and I had it in the wrong section. I had it under binary_sensor. Thank you so much for saving me anymore wasted time! It’s working fine now.

1 Like