Thermostat Trouble

Hi,
the only thing I see is the unit of measurement in your temperature sensor; try putting °C instead of C

gl

Hi MrMep

I put °C in before but when i restart HA I get the following error. Im not sure if i need to enter the special character in another way rather than copy and pasting it as I have done into the code. Any ideas?

Yeah, there are two different characters for the degree symbol… Did you copy&paste it? try entering it directly…
See here too: Climate Generic Thermostat with MQTT Temperature sensor

Thanks for that link

I did the first part by removing the unit_of_measurement: “ºC” on my sensor. Although before I did that I did try typing it as you suggested by holding down Alt and typing 0176 or Alt+248 - Neither of these worked and HA still threw up a hissy fit when restarting it.

I’m struggling with the next part. He says he created a custom component by copying the existing thermostat component and altering the code slightly. I cant find where my components are located to copy the code from the original to make a custom one as per this users instructions. A page i found says the components are located in a folder called components in your homeassistant directory, I dont have a components folder in my HA root folder… :-/

Ok I found the Python for the component on the github page and created a custom component as per the link you provided MrMep

My thermostat isnt showing under developer states any more and has gone completely…

Anyone got any more ideas?

Hi, is the temperature sensor showing in developer tools -> states?

It is yes, its reporting to HA just fine.

But the climate is still showing Null.

Ive tried adjusting my Python script on the PI to output as a number by changing “str” to “int”. Ive even spoken with some developers at work who understand python a little but arent experts on it and say if i use “int” that will be outputing as a number rather than a string. So not sure if this is now a HA problem rather than a python coding problem.

Ok, I don’t see unit_of_measurement under friendly_name, so I’m still thinking the problem is there.
As for the python script, actually an MQTT payload is always a byte array, and the publish function takes a string as argument, and in any case the value is showing in HA, so I guess the problem is not there…
You’d really need to figure out the right unit of measurement in the sensor declaration.
Try copying and pasting this (I hope it doesn’t get translated here in the forum):

    unit_of_measurement: "°C"

and put it in the sensor declaration.

gl

Copy and pasted it as you said, still getting that error upon restarting HA

If you can explain to me how you type the Degree symbol maybe I can give that a go? Ive tried doing the Holding Alt Key plus the number combination on the keypad to type the symbol but again I get the same error as above when restarting HA.

And you get this error only when you put the ° symbol?

Correct! If I just type in “C” its fine but as you say the climate probably isnt working because its not reporting in the way its wants it to be.

So I think the solution is going to be finding out why it wont accept the symbol…

Yeah, the little ° is the key, but frankly I have no idea why it throws that error…

Ill create another topic in the forum relating to this error and link it back to here. Hopefully someone will jump on it that knows the answer to this riddle.

Thanks for all your help so far! Hopefully this fixes my issue once we get to the bottom of this symbol!

Ok!
It might be something related to your text editor though, have a look at that…

gl

Im using the default text editor on WinSCP

no quotes around °C ?

There are quotes around it yes, shouldn’t there be?

Removed quotes, still the same issue

For anyone else struggling with this issue

It was the Degree symbol causing the climate module to report Current_Temperature as Null as suggested by MRMEP

Getting the symbol working took a bit of work and threw up UTF-8 errors when restarting HA. I resolved the issue in this thread here - UTF-8 Error

2 Likes