Templates and Celsius to Fahrenheit conversions

For some reason both my ecobee thermostat and my dark sky weather component both return data in celsius. I am using the metric system in settings but it’s ignored, so I’m trying to fix it with a template

  - platform: template
    sensors:
      dark_sky_temperature:
        value_template: '{{ ((float(states.sensor.dark_sky_temperature.state) * 9) / 5) + 32 }}'
        friendly_name: 'Temp1'
        unit_of_measurement: 'F'

I think I am selecting the current temperature incorrectly, so my formula dies

logs

17-01-15 09:40:48 homeassistant.components.sensor.template: UndefinedError: 'None' has no attribute 'state' 
....
TypeError: unsupported operand type(s) for /: 'str' and 'int' 

Metric is Celsius. Imperial is Fahrenheit. Are you sure you want Metric?

1 Like

Wow, I’m an idiot. Thank you brmo