-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amazon Thermostat reports incorrect temperature #1890
Comments
I have observed this as well. It looks like it is converting the temperature from Celcius to Fahrenheit even though it is already in Fahrenheit. |
I have the same problem. i got aqara thermostat and alexa covert my Celcius temperature in Fahrenheit . I dont know why. With old thermostat worked all well. |
Thanks, looks like we'll need a PR to address this use case. It can't be tied to a locale setting or I think HA may have changed the default temperature scale. |
Hello,
Thanks for an answer. Do you need something from me ? Protocols or something else ?
Thanks
…________________________________
From: Alan Tse ***@***.***>
Sent: Sunday, April 9, 2023 10:43:58 AM
To: custom-components/alexa_media_player ***@***.***>
Cc: AlexEr89 ***@***.***>; Comment ***@***.***>
Subject: Re: [custom-components/alexa_media_player] Amazon Thermostat reports incorrect temperature (Issue #1890)
Thanks, looks like we'll need a PR to address this use case. It can't be tied to a locale setting or I think HA may have changed the default temperature scale.
—
Reply to this email directly, view it on GitHub<#1890 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AYDICPMFOPVBZ7TY4YZ5CI3XAJZE5ANCNFSM6AAAAAAWF4CJPI>.
You are receiving this because you commented.Message ID: ***@***.***>
|
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed automatically. |
This issue is still present. Any fix please? |
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed automatically. |
The integration still reports the incorrect temperature for Amazon thermostats. It reports kelvin when Fahrenheit is checked. |
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed automatically. |
Issue is still present |
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed automatically. |
The issue has received no activity for 60 days and will be closed in a week. |
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed automatically. |
The issue has received no activity for 60 days and will be closed in a week. |
Last night while working on something else, I happened to notice what I believe to be the reason for Fahrenheit not working correctly for you. The sensor's native unit of measurement appears to be hardcoded to CELSIUS in
What I don't know at this point is whether the sensor's native unit of measurement is provided by Amazon in the JSON data they send to AMP when it's being initialized... |
@inger147 , @Angelos59 Can you scan your alexa_media DEBUG logs looking for any info regarding that device? Specifically |
Or perhaps a
homeassistant/util/const.py:
We need something in a JSON string from Amazon for that device for us to be able to determine if it's reported value is in "°C" or "°F" so we can correctly set the native unit of measurement... |
How do I access the Debug logs? also, I don't see a homeassistant/util/const.py file, only homeassistant/const.py (no util folder that I can see in the Studio Code Server navigation bar). I do see the line in alexa_media/sensor.py/TemperatureSensor where the self._attr_native_unit_of_measurement value is being hardcoded to UnitOfTemperature.CELSIUS. |
After quite a bit of research and digging, I've just finished modifying code which looks promising.
Can you replace these two files in `config/custom_components/alexa_media/ fix_temperature_sensor_unit_of_measurement.zip alexa_entity.py previously was only returning the value but my code change now returns the value and the scale:
Then in
So if your temp sensor is returning for example:
|
I replaced those two files with the ones in your zip, and it looks like your changes worked! Thanks for this! The displayed unit of measurement is displaying correctly for me now, but the Fahrenheit value is still being rounded to the nearest whole number in Home Assistant, i.e. it's only showing all zeroes after the value regardless of what I change the precision to in the Thermostat value settings in HA. I'm not sure if anything can be done about that from within HA, or if that fix would need to be made on Amazon's end. |
There should be log entries from
Then there are log entries from
Followed later by data refresh from Amazon:
And these are from the
By adjusting your
If the value is already rounded from Amazon then there's nothing we can do. |
When I checked my debug log (I figured out how), all of the values you mentioned above showed 80.0, so those are all pre-rounded from Amazon.... however, in that same log I did find the below data as part of the "get_entity_state response" line, along with a lot of other details that are also specific to the thermostat:
Since this value is unrounded, it does seem that Amazon is sending it to HA in some form - is there a way that this "preciseTemperature" value might possibly be used as the value that shows up in HA, instead of the pre-rounded value that's currently displayed for Fahrenheit temperatures? |
Very interesting! BTW, I wish we still had temps of |
What do you see in logs for
In alexa_entity.py ~line 438, can you add the following _LOGGER.debug command, restart and check your logs for the debug logs for "parse_value_from_coordinator"?
|
You can try adding
|
Sure, this morning after I added that debug line here's what I'm getting:
And here's the preciseTemperature value from the same log this morning:
|
I made this change, but after restarting HA the UI still shows 74.0, and in a new debug log, the preciseTemperature entry is still the only "74." value that isn't 74.0.
|
That code change I posted actually generated a weird error (
|
I didn't get any errors the first time, but I did add the quotes around the "1", restarted with debug logging on, and there looks to be no change - the UI and all entries in the log still show 75.0 Fahrenheit, except for the preciseTemperature reading in the log which shows 75.34375. |
Did you simply edit that one line ( |
In my Alexa Echo, I changed the temperature unit from °C to °F and in the Alexa app I see the temp in Fahrenheit in the app but Amazon is still sending the Celsius value to AMP. But I just had another idea on how I can test Fahrenheit on my end.
to:
and see what HA does with it... |
I can also try faking the Fahrenheit value... |
Sorry, yes, I just replaced that line. This time I replaced the whole TemperatureSensor class with your code, but I still got the same result; everything ends in .0 except preciseTemperature. |
So, I overrode my value and scale yet I still saw Celsius in the UI with one decimal precision. and I now see the temperature in Fahrenheit:
First, doublecheck that you do not have legacy settings in your
Then as per this post, Then change it back from Metric to US Customary selecting Update all and see what the logs and the frontend show then. |
I checked my Note that before doing the above steps, I had updated to the latest AMP version, but after I updated it, I re-copied your TemperatureSensor class from a few posts back into my sensor.py file. |
Damn! I'm not sure where to look now... |
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed automatically. |
I am able to see echo temperature entities correctly. In the process of updating the integration to do this via checking the box to include devices connected via echo, I also got entity temperatures for the amazon thermostats. This was unexpected but good, the issue is that the temperature is reported incorrectly. I have five of these thermostats and they all do the same. All the echos, I have four report temperature correctly.
Is your feature request related to a problem? Please describe.
This is not a request to report a problem but if possible to enhance the integration to report the correct temperature for the amazon thermostats.
Describe alternatives you've considered
I have multiple temperature sensors zigbee, echo, etc.
If you are able to do this also consider exposing the humidity reading on the amazon thermostat, if possible.
Thanks very much
The text was updated successfully, but these errors were encountered: