Skip to content
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

Target Temperature in HA does not match unit target temp in F #58

Open
joekislo opened this issue Jan 13, 2025 · 3 comments
Open

Target Temperature in HA does not match unit target temp in F #58

joekislo opened this issue Jan 13, 2025 · 3 comments

Comments

@joekislo
Copy link

TBH I'm surprised I didn't notice this before now, but in heat mode if I set a temperature via the the fujitsu android app, HA will be report the target temperature 0-2 degrees off reality. A similar issue happens if I set a target temp via the HA climate UI, the temp set on the unit will be off by 0-2 degrees. I also tried setting the temp via IR remote control, same issue with HA.

I'm running v1.2.3 of the integration, on 2025.1.2. I did try rebooting HA, but not the fujitsu unit. I am wondering if this is a C->F conversion issue. There is a band where the temp is reported low, then correct, then high.

Here's what I got by looking at the climate UI. I confirmed state_attr('climate.ac_living_room', 'temperature') returns the same wrong # as the UI.

Unit: 60 HA Shows: 61 - Bad off by 1
Unit: 61 HA shows 62 - Bad off by 1
Unit: 62 HA shows 63 - Bad off by 1
Unit: 63 HA shows 64 - Bad off by 1

Unit: 64 HA shows 64 - Good
Unit: 65 HA shows 65 - Good
...
Unit: 70 HA shows 70 - Good
Unit: 71 HA shows 71 - Good
Unit: 72 HA shows 72 - Good
Unit: 73 HA shows 72 - Bad off by 1
Unit: 74 HA shows 73 - Bad off by 1
...
Unit: 79 HA shows 78 - Bad off by 1
Unit: 80 HA shows 79 - Bad off by 1
Unit: 81 HA shows 80 - Bad off by 1
Unit: 82 HA shows 81 - Bad off by 1
Unit: 83 HA shows 82 - Bad off by 1
Unit: 84 HA shows 82 - Bad off by 2
Unit: 85 HA shows 83 - Bad off by 2

@ohshazbot
Copy link
Collaborator

ohshazbot commented Jan 13, 2025

That's a bit odd, for the retrieval path the only math we do is handling the offset for what the devices work in (they report celsius temperature * 10, for a system that's fully integer based and supports half-degree C increments).

For the write path, there is this logic (danielkaldheim/pyairstage@862cf11d) which does transform the value, but it does it to ensure that the values hit in half Centigrade, so I'm not convinced this is the root of your issue (though if your purely using HA to write your values in your testing it could be corrupting your test).

Unfortunately everything else when it comes to temperature unit conversion is provided via HA itself, and so that's where it seems to be happening?

For my own clarity, when you refer to Unit temperature, are you reporting what the fujitsu app is reporting or do your head units have built in displays?

@joekislo
Copy link
Author

Ok, well I cycled the breaker on the A/C unit and rebooted HA. No change. Atleast I tried turning it off and turning it back on :)

These are minisplit units, and the wall unit's model # is ASUH09LPAS. There is no readout on the unit itself to see the set temp. I am able to set temp via the AIRSTAGE Wifi app (which is via a cloud connection, not local) and via the IR remote. Both seem to have the same issue. E.G Set temp on wifi to 73, and HA will read 72. I'm reading that value by looking at the Climate UI and also dumping state_attr('climate.ac_living_room', 'temperature') to a persistent notification. I've tried atleast 3 of my head end units, and they all exhibit the same behavior.

Note that I'm operating in Fahrenheit, there's no C anywhere in my HA.

I'm also running these units in 'high insulation mode', which is function 95-01. I doubt that's a factor.

These devices have an IP address on my network, if you want to give me a curl command or some way to poll the raw data coming off the endpoint I can poll it and paste in here. Or let me know how to activate a debug mode on the integration so we can see the raw unit response.

I turned on debug logging but I mostly see:
DEBUG (MainThread) [custom_components.fujitsu_airstage] Finished fetching Fujitsu Airstage data in 3.845 seconds (success: True)

Not any of the raw response from the unit.

but I also see this, which does seem to get triggered when I update the temp on one of the units (although I can't tell in realtime):

2025-01-13 22:31:26.017 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 267, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 478, in _async_refresh
self.async_update_listeners()
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 177, in async_update_listeners
update_callback()
~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 558, in _handle_coordinator_update
self.async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
self._async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
self.__async_calculate_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1029, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 520, in state
value = self.native_value
^^^^^^^^^^^^^^^^^
File "/config/custom_components/fujitsu_airstage/sensor.py", line 89, in native_value
return Decimal(value)
TypeError: conversion from NoneType to Decimal is not supported

@ohshazbot
Copy link
Collaborator

I think this may just be a pecularity between how fujitsu is doing it's celsius conversion vs. home assistant. For instance, when you have the unit at 60F, it's actually being set to 16C under the covers. But when you convert that to F, you get 60.8.

Similarly:
Unit: 61 HA shows 62 - Bad off by 1: The unit is actually set to 16.5C, which converts to 61.7F
Unit: 62 HA shows 63 - Bad off by 1: The unit is actually set to 17C, which converts to 62.6F
Unit: 63 HA shows 64 - Bad off by 1: The unit is actually set to 17.5C which converts to 63.5F
...
Unit: 73 HA shows 72 - Bad off by 1: Unit is actually set to 22.5C, which is 72.5F (I'm presuming it's rounding to even digits)
Unit: 74 HA shows 73 - Bad off by 1: Unit is actually set to 23C, which is 73.4F
...
Unit: 79 HA shows 78 - Bad off by 1: Unit is actually set to 25.5C which is 77.9C
Unit: 80 HA shows 79 - Bad off by 1: Unit is actually set to 26C, which is 78.8F
...
Unit: 84 HA shows 82 - Bad off by 2: Unit is actually set to 28C which is 82.4F
Unit: 85 HA shows 83 - Bad off by 2: Unit is actually set to 28.5C which is 83.3F

So it seems like all in all they're just mapping 1 degree F to .5 degrees C and it's mostly not noticable sinc ehte temperature range is fairly small.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants