Extracting outside temperature doesn't work

Hello, in configuration.yaml I hve the following plateform.
weather:

  • platform: environment_canada
    latitude: 47.039822
    longitude: -70.276841
    name: l_islet

This work as expected.
I want to ad on my front end a curve of the outside temperature.

I lock on the platform using developpment tool and see many attribute from the weather.l_islet sensor.

So I add the followin line in the configuration.yaml for having a new sensor:

    outside_temperature:
       entity_id:
       -  weather.l_islet
       value_template: "{{ state_attr(' weather.l_islet', 'temperature') }}"
       unit_of_measurement: 'C'

I restarted the host, check with developpment tool.
Effectively, there is a new sensor: sensor.outside_temperature but the state remain in “non” state.

Can you help me to have the corresponding value ?

Many thanks in advance.

- platform: template
  sensors:
    outside_temp:
      friendly_name: “Outside Temperature”
      unit_of_measurement: “°C”
      value_template: “{{ state_attr(‘weather.l_islet’, ‘temperature’) }}”

try this…

Those are the wrong sort of quotes. “ vs ". Both double and single.

Thanks for your help.
The value appears in quotes, for exemple “7,4”
The history graphe is not able to trace the curve.
Is that possible to cast it ?

Thanks for your help

value_template: >
  {{ state_attr('weather.l_islet', 'temperature')|replace('"', '') }}

I try it but the result is the same…

Go to the developer tools states menu and take a screenshot of the attributes of weather.l_islet and paste it here. You can drag and drop the image file into a forum post.

oh sorry it was a mistike for myself.
Sorry !

So my template worked?

Yes thanks a lot for your help and patience !!

It’s rather rude to mark your own post as the answer. Mark the post that helped.

1 Like