How to use £ as unit of measurement instead of $

Can anyone help I’m trying to use £ instead of $ in my configuration but has will not let me do that very new to this so if anybody can point me in the right direction that would be great

- platform: template

friendly_name: “Today’s Cost”
unit_of_measurement: ‘£’
value_template: “{{ (states(‘’)|float * 0.13)| round(2) }}”

It just won’t have it if I use £ but OK if I use $

Can’t tell because the YAML didn’t get formatted properly. What are the quote characters around £? If they’re what they look like, then that’s the problem. They must be either simple single or double quote characters, not the fancy “word processor” curly quote characters.

unit_of_measurement: '£'

Single quotes that are around it

Hmm. Well, FWIW, I just tried this:

  - platform: template
        unit_of_measurement: '£'
        value_template: "{{ 5 }}"

Works fine for me.


Configuration validation just keeps throwing me out it just doesn’t like £ for some strange reason that’s why I’m thinking it’s not a valid unit of measurement and I can’t find anything about it in the official documentation but might have my man eyes on ha ha ha

I’m guessing it has more to do with your text editor and what you have the encoding set to. Do you have it set to UTF-8?

Not sure how do you find that out


What editor are you using?

Using note pad

I do have note pad++ also but did not use it for this

I think the issue is that Notepad uses UTF-16 encoding, which is what most Windows programs use (at least by default.)

You should find an editor that uses, or can be made to use, UTF-8. E.g., I use kate, both on Windows and Linux.

Ah, just discovered. In Notepad, you can use File -> Save As…, then at the bottom you can pick UTF-8 for Encoding.

1 Like