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

Bug(CD): Temperatures Displayed in Fahrenheit Instead of Celsius #420

Open
hexCut opened this issue Dec 15, 2024 · 9 comments
Open

Bug(CD): Temperatures Displayed in Fahrenheit Instead of Celsius #420

hexCut opened this issue Dec 15, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@hexCut
Copy link

hexCut commented Dec 15, 2024

HA core version

No response

Current integration version

0.4.3

Last known working integration version

0.4.3

Device type and model

Heat Pump Water Heater RSJ000CB (9749) by Midea

Working mobile app

SmartHome

The detail description of bug/problem

Description

The integration for the Swan 2 Water Pump appears to assume that the device’s temperature readings are provided in Celsius. However, the device actually returns temperatures in Fahrenheit, which are displayed incorrectly in Home Assistant without conversion.

This discrepancy affects both:
• The current temperature (current_temperature property)
• The target temperature (target_temperature property)

Expected Behavior

Temperatures should be displayed in Celsius, as assumed by the integration.

Observed Behavior

Temperatures are displayed in Fahrenheit but treated as if they were Celsius, resulting in incorrect readings and user confusion.

Steps to Reproduce
1. Integrate the Swan 2 Water Pump using the current version of the integration.
2. Observe the current_temperature and target_temperature values in Home Assistant.
3. Compare with the actual Fahrenheit readings from the device.

The logs

2024-12-15 13:01:37.830 DEBUG (Clivet Swan 2) [midealocal.device] [153931628204291] refresh_status with cmds: [<midealocal.devices.cd.message.MessageQuery object at 0xffff700a70e0>], check_protocol False
2024-12-15 13:01:37.831 DEBUG (Clivet Swan 2) [midealocal.device] [153931628204291] Sending: {'_device_type': <DeviceType.CD: 205>, '_message_type': <MessageType.query: 3>, '_body_type': <ListTypes.X01: 1>, '_message_protocol_version': 0, 'header': 'aa0ccd00000000000003', 'body': '0101', 'message_type': 'query', 'body_type': '01', 'self': <midealocal.devices.cd.message.MessageQuery object at 0xffff700a70e0>}, query is True
2024-12-15 13:01:38.505 DEBUG (Clivet Swan 2) [midealocal.devices.cd] [153931628204291] Received: {'_device_type': <DeviceType.CD: 205>, '_message_type': <MessageType.query: 3>, '_body_type': <ListTypes.X01: 1>, '_message_protocol_version': 0, '_header': 'aa3ecd00000000000003', '_body': <midealocal.devices.cd.message.CDGeneralMessageBody object at 0xffff74af8050>, '_data': '01010534307f7f2a441f4626090511001105083200340000000000000703000000000400000000000000000000060b000000b300', 'parser_list': [], 'power': True, 'target_temperature': 11, 'mode': 1, 'current_temperature': 9, 'condenser_temperature': 6.0, 'outdoor_temperature': 19.0, 'compressor_temperature': 0.5, 'max_temperature': 20, 'min_temperature': 4, 'compressor_status': False, 'header': 'aa3ecd00000000000003', 'body': '01010534307f7f2a441f4626090511001105083200340000000000000703000000000400000000000000000000060b000000b300', 'message_type': 'query', 'body_type': '01', 'self': <midealocal.devices.cd.message.MessageCDResponse object at 0xffff7042b3e0>}
2024-12-15 13:01:38.506 DEBUG (Clivet Swan 2) [midealocal.device] [153931628204291] Status update: {'power': True, 'mode': 'Standard', 'max_temperature': 20, 'min_temperature': 4, 'target_temperature': 11, 'current_temperature': 9, 'outdoor_temperature': 19.0, 'condenser_temperature': 6.0, 'compressor_temperature': 0.5, 'compressor_status': False}
Uploading Screenshot 2024-12-15 at 13.02.10.png…

@hexCut hexCut added the bug Something isn't working label Dec 15, 2024
@wuwentao
Copy link
Owner

@hexCut all the temperature is Celsius in current midea_ac_lan.
please don't compare it with Fahrenheit, it's a error action.
if you want to display Celsius to Fahrenheit, just update your HA setting. it's not midea_ac_lan feature.
so I will close current issue. and you can check how to update your HA setting from Celsius to Fahrenheit in HA web UI.

in addtion, if your device result is error, please description the detail error and attach debug log and app screenshot or device screenshot. and reopen current issue as it still have bug.
but you should use the same unit, and not do this compare.
thanks

@hexCut
Copy link
Author

hexCut commented Dec 16, 2024

Thank you for your earlier response. However, I have conducted additional testing and gathered logs that clearly show the device (Clivet Swan 2) with the integration reports temperature values in Fahrenheit, not Celsius.

Below is an excerpt from the debug log:

2024-12-15 13:01:38.506 DEBUG (Clivet Swan 2) [midealocal.device] [153931628204291] Status update: {
'power': True,
'mode': 'Standard',
'max_temperature': 20,
'min_temperature': 4,
'target_temperature': 11,
'current_temperature': 9,
'outdoor_temperature': 19.0,
'condenser_temperature': 6.0,
'compressor_temperature': 0.5,
'compressor_status': False
}

•	The device’s current_temperature is reported as 9°F, which corresponds to approximately -12.8°C.

(This is clearly not in Celsius, as 9°C would be a normal room temperature, not suitable for the device’s function.)
• Similarly, the target_temperature of 11°F corresponds to approximately -11.7°C, which is also not realistic in Celsius.

The integration should detect that the device reports temperatures in Fahrenheit and convert them to Celsius before displaying them in Home Assistant.

@wuwentao
Copy link
Owner

wuwentao commented Dec 16, 2024

@hexCut
thanks, there is a bug for CD device, also reported in this github issue:
#347

could you help to confirm with it ?
in addtion, is possible for you to share your device SN to me ?

I will try to add a solution with a switch for #347, and want to confirm with your device SN.
but for #347, they have confirmed the result is not Fahrenheit.
anyway, I will try to add a switch for us to confirm with it.

in addtion, if you can show your device json config, also provide it to me, just want to confirm the device model and subtype.
please refer to #347 for the command and detail info, per my understand, both issue should be the same one.

@wuwentao wuwentao reopened this Dec 16, 2024
@wuwentao wuwentao changed the title Temperatures Displayed in Fahrenheit Instead of Celsius Bug(CD): Temperatures Displayed in Fahrenheit Instead of Celsius Dec 16, 2024
@hexCut
Copy link
Author

hexCut commented Dec 16, 2024

The issue you mentioned does seem similar. I also observe this behavior with intermittent ON/OFF states.

However, after reviewing the debug logs, it appears that this might be due to the water heater sending invalid messages. Specifically:
• The temperatures reported are invalid.
• Some states also appear to be inconsistent.

That said, by applying a conversion from Fahrenheit to Celsius on the reported temperatures, I am able to obtain reliable and consistent values. These values align perfectly with what is shown on the device’s display.

I suspect that the water heater is configured to operate in Fahrenheit, and this setting might be defined at the ModBus protocol level. The payload sent over Ethernet may simply replicate the raw ModBus data, without any additional conversion.

Switching from Fahrenheit to Celsius likely requires configuring the device via ModBus. However, connecting to the system through ModBus is not feasible for me.

Additional Information
• Serial Number (SN): AASENU2I2948

{
  "name": "Clivet Swan 2",
  "device_id": 153931628204291,
  "type": 205,
  "protocol": 3,
  "ip_address": "192.168.20.167",
  "port": 6444,
  "model": "RSJ000CB",
  "subtype": 186,
  "token": "269212f12ffa62063e9fc8ecf2a1c53c448b2d8338589732135ce18884b************",
  "key": "56987b5dc3294d3f801b2862c5*****************"
}#

I hope this information helps clarify the issue. If you need further details or logs, feel free to ask.

Thank you for your support!

@wuwentao
Copy link
Owner

I'm not sure with this SN.
it should be a along Str.

@hexCut
Copy link
Author

hexCut commented Dec 16, 2024

No, actually that serial number is taken directly from a label on the water heater itself. Where should I retrieve the correct serial number from? I couldn’t find anything related to it in the app. Could you clarify?

Thank you!

@wuwentao
Copy link
Owner

@hexCut yes, I can understand it, midea have more differnt types SN, used for different purpose.

  1. below is a simple step:
    just backup your device xxx.json or rename it.
    remove your device, enable debug log, add it with discovery, you can found the SN info in debug log.
    for example:
2024-12-15 00:26:55.828 DEBUG (MainThread) [midealocal.discover] Found a supported device: {'device_id': xxx, 'type': 172, 'ip_address': '192.168.1.22', 'port': 6444, 'model': 'xxx', 'sn': 'xxx', 'protocol': 3}

this SN is what we expected.

method 3: in addition, if you can login to HAOS and start docker.
also can be do below manual steps:

  1. ssh login to HAOS
  2. run docker with docker exec -it homeassistant /bin/bash
  3. run discover debug command: python3 -m midealocal.cli discover -d --host x.x.x.x (x.x.x.x is your device IP)

you can also found the same output as debug log.

we can use your device SN to confirm your device protocol details.

@hexCut
Copy link
Author

hexCut commented Dec 17, 2024

Ok, can it be this one? 153931628204291 (Heat Pump Water Heater)

@wuwentao
Copy link
Owner

this should be a device ID ? you can check the full debug log and refer to the log that I pasted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants