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

Daizuki heatpump is not quite compatible with Starlight config #276

Closed
presslab-us opened this issue Nov 17, 2022 · 13 comments
Closed

Daizuki heatpump is not quite compatible with Starlight config #276

presslab-us opened this issue Nov 17, 2022 · 13 comments

Comments

@presslab-us
Copy link

I have a Daizuki heat pump that works fine with the Tuya Android app. In tuya-local it is overall working with one small problem. It doesn't seem to be officially supported so I picked the "starlight" option.

The target temperature is incorrectly converted from C to F but it's already using F on the device. This causes the target temperature shown in Home Assistant to be very high. The target setpoint should be 68 F, which is the case if the conversion is undone: (154-32) / 9 * 5 = 67.8.

Diagnostic log and screenshot is attached below.
tuya_local-2922bd1d3d482813aa51d2c1de9ecd3f-Shed Heatpump-a92479c3b1ba163170f3a5d484ce3a6b.json.txt
image

@make-all make-all changed the title Climate target temperature is incorrectly converted from C to F Daizuki heatpump is not quite compatible with Starlight config Nov 17, 2022
@make-all make-all added the new device Unsupported device label Nov 17, 2022
@make-all
Copy link
Owner

It is possible that one of the unknown dps is a C/F indicator and/or selector. The cleanest fix if everything else is working correctly would be to identify it and implement unit switching for these devices.

If you have access to the Tuya portal, using the debugger method described in the zigbee2mqtt link in the README.md should be able to identify all the unknown dps. The API explorer is also worth checking, as it may contain more details on the possible values and which are read/write vs read-only for dps that were not available for the Starlight device.

@presslab-us
Copy link
Author

presslab-us commented Nov 17, 2022

Thanks a lot for your help! It looks like in the Tuya portal it's also showing deg C:
image

      {
        "code": "temp_set",
        "dp_id": 2,
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":160,\"max\":880,\"scale\":1,\"step\":5}"
      },

However there is an additional dp shown in the API, but it doesn't look like it's being used, even when I am using the Tuya Android app:

      {
        "code": "temp_set_f",
        "dp_id": 136,
        "type": "Integer",
        "values": "{\"unit\":\"℉\",\"min\":61,\"max\":88,\"scale\":0,\"step\":1}"
      }

There is dp 110 which shows as "标识位" which translates to "flag". The value is 2228796, maybe one of those bits is the one which indicates the set temperature unit.

Also there is dp 123 which shows as "布尔型" which translates to "boolean". The value is "0018".

I didn't see anything else that looked very interesting.

@make-all
Copy link
Owner

If you could send the full list from the Tuya portal it will help with ranges and identifying functions that are available.
Also the debug information for those which are not listed (like 123, 110 etc)

@make-all make-all added the awaiting feedback Needs more information label Nov 20, 2022
@make-all
Copy link
Owner

There is an unresolvable problem with the way this devices mixes units. Home Assistant climate API only has one method to inform which units the device uses, so you cannot specify temperature and current_temperature units separately. But the data seems to show that it is using Celsius for current temperature, even though it is using Fahrenheit for set temperature. Is there perhaps a firmware update available for the device, because this seems like a bug, and will most likely affect the Tuya app as well, since there is not generally specialised logic for individual devices I think.

@presslab-us
Copy link
Author

There is somehow the Android app knows the units are different for set temp, but like you say this is a strange problem with the units. It's not clear how the app knows about this, but I agree I doubt the app has specialized logic just for this device. I don't necessarily think this problem is specific to my Daizuki heat pump.

But it seems like there is not an easy answer to this problem, the Tuya API doesn't show any clear answer.

Is this the list that you are asking for?

{
  "result": {
    "category": "kt",
    "functions": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "temp_set",
        "dp_id": 2,
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":160,\"max\":880,\"scale\":1,\"step\":5}"
      },
      {
        "code": "mode",
        "dp_id": 4,
        "type": "Enum",
        "values": "{\"range\":[\"cold\",\"hot\",\"wet\",\"wind\",\"auto\"]}"
      },
      {
        "code": "temp_set_f",
        "dp_id": 136,
        "type": "Integer",
        "values": "{\"unit\":\"℉\",\"min\":61,\"max\":88,\"scale\":0,\"step\":1}"
      }
    ],
    "status": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "temp_set",
        "dp_id": 2,
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":160,\"max\":880,\"scale\":1,\"step\":5}"
      },
      {
        "code": "temp_current",
        "dp_id": 3,
        "type": "Integer",
        "values": "{\"unit\":\"℃\",\"min\":-20,\"max\":100,\"scale\":0,\"step\":1}"
      },
      {
        "code": "mode",
        "dp_id": 4,
        "type": "Enum",
        "values": "{\"range\":[\"cold\",\"hot\",\"wet\",\"wind\",\"auto\"]}"
      },
      {
        "code": "humidity_current",
        "dp_id": 18,
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
      },
      {
        "code": "temp_set_f",
        "dp_id": 136,
        "type": "Integer",
        "values": "{\"unit\":\"℉\",\"min\":61,\"max\":88,\"scale\":0,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": 1669042574534,
  "tid": "a529de6d69ac11ed954a6ebb44969c0f"
}

The Android app displays the set temperature correctly, and it shows the firmware is up to date.
image
image

The debug logs for 110:

2022-11-16 13:39:58 | Report | 标识位 | 2228796 | device itself |  
-- | -- | -- | -- | -- | --
2022-11-15 10:10:48 | Report | 标识位 | 2228796 | device itself |  
2022-11-15 10:10:47 | Report | 标识位 | 2228796 | device itself

And 123:

2022-11-16 13:39:58 | Report | 布尔型 | 0018 | device itself |  
2022-11-15 10:10:48 | Report | 布尔型 | 0018 | device itself |  
2022-11-15 10:10:47 | Report | 布尔型 | 0018 | device itself

@make-all make-all removed the awaiting feedback Needs more information label Nov 21, 2022
@make-all
Copy link
Owner

It looks like the Tuya app is ignoring the current temperature, so it doesn't have to deal with the difference in units. The solution may be to ignore current temperature in the climate entity, and use a separate sensor entity for it instead.

@presslab-us
Copy link
Author

Yes the Tuya app doesn't seem to ever show the actual temperature. It varies quite a lot when it's running so maybe they thought it was not so useful. But it is very good to have, for example to have an automation that starts the unit when the room temp falls too low.

There could be also be a unit conversion in tyua-local I think (allowing for the mixed units), but I do wonder how the Tuya app knows to display with the F unit; I didn't set that anywhere.

make-all added a commit that referenced this issue Nov 26, 2022
Almost compatible with Starlight, but temperature for this model is in
F, while current_temperature remains in C.

Identified dp 18 as humidity sensor (applied also to Starlight model).

Still many unidentified dps on these two models.

Issue #276
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed new device Unsupported device unreleased Will be in next release labels Nov 26, 2022
@make-all make-all removed the awaiting confirmation Wating for confirmation the issue is solved label Dec 11, 2022
@presslab-us
Copy link
Author

presslab-us commented Dec 11, 2022

Thanks for implementing the changes! I didn't see any notification until this issue was closed.

I just tested it, and I'm not sure how to select the Daizuki heat pump when installing the device. Here are the options shown:
image

I did confirm that the devices\daizuki_heatpump.yaml file was there.

@make-all make-all reopened this Dec 11, 2022
@make-all make-all added the bug Something isn't working label Dec 11, 2022
@make-all
Copy link
Owner

Can you download the diagnostics again? Or if you haven't added it, the log messages from when the above device selection dialog appears would be enough. There seems to be a discrepancy with the dps captured by the previous diagnostic log, and whatever it is when the detection fails.

@presslab-us
Copy link
Author

Yes I had added it anyway. Attached are the diagnostics, thanks!
tuya_local-276de74f743b98e27addc73eea9228b9-Daizuki heatpump-a92479c3b1ba163170f3a5d484ce3a6b.json.txt

make-all added a commit that referenced this issue Dec 14, 2022
These were captured in the first diagnostics captured from the device, and
since they are not in the starlight config appeared to be a way to differentiate
these two heatpumps.  However, later attempts were missing both, so they appear
to be optional (likely for the starlight too).  First attempt was in auto mode,
second in hot mode, so maybe these are limited to auto mode somehow.

Issue #276
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Dec 14, 2022
@presslab-us
Copy link
Author

Ok great, now I can select the correct device! The target temperature is showing correctly. But now the current temperature is not displayed in the climate entry, it has created a separate entry. I'm not sure if that is an intentional change or not? I would prefer the current_temperature to be in the same climate entity like before.
image

tuya_local-954ea2ab1a5d1553eeb5f03d30732537-Shed Heatpump-a92479c3b1ba163170f3a5d484ce3a6b.json.txt
I have attached the diagnostics showing that.

@make-all make-all removed the awaiting confirmation Wating for confirmation the issue is solved label Dec 17, 2022
@make-all
Copy link
Owner

make-all commented Dec 17, 2022

The separation of current temperature is intentional, as there is no way to handle the mismatched units without separating it.

You may be able to find a custom thermostat card that allows them to be recombined in the UI.

@make-all make-all removed the bug Something isn't working label Dec 18, 2022
@make-all make-all removed the unreleased Will be in next release label Dec 22, 2022
@presslab-us
Copy link
Author

Ok, I see how it works now. Thanks again for your help!

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