I used the Scrape platform to extract data from the website of a weather station.
With the “value_template” I cleaned most of the fields, but I was unable to cleanup the following:
22.5 km/h
19.2°C
10,2 °C
How can I remove the units ?
I used the Scrape platform to extract data from the website of a weather station.
With the “value_template” I cleaned most of the fields, but I was unable to cleanup the following:
22.5 km/h
19.2°C
10,2 °C
How can I remove the units ?
{{ value|replace(' km/h', '') }}
{{ value|replace(' °C', '') }}
Thanks @tom_l for the quick reply.
Surely I a m doing something wrong… with the following sintax I get an error message:
value_template: ‘{{ value|replace(’ °C’,’’) }}’
can not read an implicit mapping pair; a colon is missed at line 273, column 50:
… ‘{{ value|replace(’ °C’,’’) }}’
You need to use different type of quotation marks inside of the brackets vs outside.
value_template: "{{ value|replace(' °C', '') }}"
That works !!! Thanks All