Link to the topic regarding the climate sensor and this symbol error, may provide some context as to why im needing to use this symbol - Thermostat Trouble
I run this as a command in an SSH terminal yes? Where you have put <your_encoding> how do I found out what the current encoding is to know what to put here?
Yes, this is run from the command line.
You can try “file <your_config>”, it should return something like “ASCII text” or “ISO-8859 text” or something like that - it depends on your system language settings.
So if you get ISO-8859 you run “iconv -f iso-8859 -t utf-8 <configuration.yaml >configuration_new.yaml” and you should be good to go.
Alternatively you can use an editor that produces valid utf-8 encoded files - I think there’s a thread here somewhere.
one last question, does this have to be done on the configuration.yaml file? My configuration is spread over multiple yaml files. So the one where im trying to insert the character is in climate.yaml so im guessing id run it against that file containing the character rather than the main configuration.yaml file?
Aparently you can run this command without specifying the original encoding.
I get the following error
platform: mqtt
name: Bedroom Temperature
state_topic: “homeassistant/sensors/DHT22/temperature”
unit_of_measurement: "iconv: illegal input sequence at position 4486
So it seems it dosent like the degree symbol inside the sensor.yaml file. Any ideas why it dosent like it?
I think iconv tries to guess the original encoding when you don’t specify a source encoding.
It may be that you’d need to be more specific specifying an iso8859 encoding, like iso-8859-1.
When iconv is complaining, there’s probably a mismatch in the specified source encoding.
It’s probably best to redo the file with the correct encoding from scratch.
I think many members are using SublimeText or Atom for editing their config files.
I created in an SSH session a new empty sensor.yaml file after backing up the old one.
I then converted it using your command above to UTF8, although when I did that and then re checked the file it said it was ASCII. Ignored that.
I opened my sensor.yaml backup file and copied all of the data inside it and pasted it using an SSH terminal into the new one and then added the “line unit_of_measurement: “°C”” and saved it. I then ran a “file sensor.yaml” and it came back as UTF-8 woohoo!
Re ran HA and it ran successfully and now my climate module is now picking up the temperature from the temperature sensor