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

Thermostat (WK) HomeKit Cool setting not mapped to "cold" mode #241

Closed
KiwiBlueSpring opened this issue Feb 22, 2023 · 8 comments · Fixed by #242
Closed

Thermostat (WK) HomeKit Cool setting not mapped to "cold" mode #241

KiwiBlueSpring opened this issue Feb 22, 2023 · 8 comments · Fixed by #242
Labels
bug Something isn't working
Milestone

Comments

@KiwiBlueSpring
Copy link

KiwiBlueSpring commented Feb 22, 2023

Ive got a tuya thermostat device which has four different values for the "mode" dp ["cold", "hot", "wind," "dry"]

In homekit, Off & Heat work correctly, however Auto & Cool dont work. Looking at HB-Debug logs, the plugin sends the command "eco" when pressing cool instead of "cold" for my use case. I did see this thread; #2 but I interpreted it as cool would work if the device had either "eco" or "cold" just encase.

Pressing Auto in homekit does nothing, no logs in homebridge.

On another note, my thermostat has fan speeds, ("low", "middle", "high", "auto") im not sure if the homekit thermostat service supports this or not, or if I should try setting it to an air-conditioner that uses the heaterCooler service and mapping the data points. (not sure if thats possible or not)

Homebridge Logs

Pressing Cool on HomeKit:

[@0x5e/homebridge-tuya-platform] [TuyaOpenAPI] Request:
method = post
endpoint = https://openapi.tuyaus.com
path = /v1.0/devices/ebe271f6f7ab3699a19vhs/commands
query = null
headers = {
"t": "1677063073776",
"client_id": "r993gagtar6qw1586vcb",
"nonce": "42d42522-641b-4c08-8fca-a68c807f20c7",
"Signature-Headers": "client_id",
"sign": "9CFBF89A2FD1450AA2C658F2476FFED89FF2A96EF65682C5796B36C1A1362F87",
"sign_method": "HMAC-SHA256",
"access_token": "f5587988051137f2c5025663d767d756",
"lang": "en",
"dev_lang": "javascript",
"dev_channel": "homebridge",
"devVersion": "1.7.0-beta.28"
}
body = {
"commands": [
{
"code": "mode",
"value": "eco"
}
]
}
[@0x5e/homebridge-tuya-platform] [TuyaOpenAPI] Response:
path = /v1.0/devices/ebe271f6f7ab3699a19vhs/commands
data = {
"code": 1101,
"msg": "params range invalid",
"success": false,
"t": 1677063074527,
"tid": "d3a55d73b29e11edb2d1c2a5aeef7bb2"
}

Device info

"switch": "{true,false}"

"mode": {"range": [ "cold", "hot", "wind", "dry"]}

"temp_set": {"unit": "℃", "min": 16, "max": 32, "scale": 0, "step": 1}

level: {"range": ["low", "middle", "high", "auto"]}

child_lock: "{true,false}"

@KiwiBlueSpring KiwiBlueSpring added the bug Something isn't working label Feb 22, 2023
@0x5e
Copy link
Owner

0x5e commented Feb 22, 2023

Thanks for the feedback, I found the typo when processing eco and cold mode, next commit will fix the cold mode issue.
The auto mode should be hidden for your device, but there's many condition select code that I didn't remember why do this, I suggest just keep that logic to avoid other mistakes.

thermostat service doen't support fan speed, if you want this feature, you can override the device category to ac's category kt, and override level to fan_speed_enum according to product document (remember to clean accessory cache). speed auto is not supported, other speed level will be mapped to 0-100% according to their orders.

@0x5e 0x5e closed this as completed in #242 Feb 22, 2023
@0x5e 0x5e added this to the 1.7.0 milestone Feb 22, 2023
@0x5e
Copy link
Owner

0x5e commented Feb 23, 2023

I've read the tuya documentation and some thermostat products (don't have experience using thermostat), so many of them have wind mode right? I can add this feature like ac when I'm free. always busy these days :(

@KiwiBlueSpring
Copy link
Author

Thank you for fixing the cool mode issue so quickly! I look forward to the update. :)

For fan speed I’m okay with just overriding the device category, however I’ve just gone ahead and tried that, and I get a ‘not supported’ accessory in HomeKit with the general house icon. Not sure if I’m doing something wrong?

This is the config
CleanShot 2023-02-24 at 08 26 02@2x

10264A7E-AE2E-4645-B839-1872A3A42ED4

@0x5e
Copy link
Owner

0x5e commented Feb 24, 2023

try clean accessory cache

@KiwiBlueSpring
Copy link
Author

Yup, this was after clearing the accessory cache. Ive done it again and still same issue.

@0x5e
Copy link
Owner

0x5e commented Feb 28, 2023

are there any warning/error logs from homebridge?

@KiwiBlueSpring
Copy link
Author

Thank you. I realised I can filter out the logs in portainer which made it 1000x easier to catch the error without all the other giant logs moving so quickly. It was missing a required schema:

[Thermostat] Missing one of the required schema: [ 'temp_current' ]

CleanShot 2023-02-28 at 17 11 25@2x

I mapped it to 'temp_set' and seems to work fine so far.

Both kt & ktkzq seems to expose a an actual fan accessory grouped with the ac device itself which didnt seem to do anything when adjusting. Once I clicked 'show as seperate tiles' the ac card updated and showed a fan speed slider that worked fine & left an extra fan tile outside. Just something interesting I found.

Ive attached some screenshots if ur interested
(1 = Ac tile before ungroup | 2 = ac tile after ungroup | 3 = ac & fan seperated cards)

Before Ungroup After Ungroup The seperated tiles

I have one other issue, I noticed that the devices current status doesnt seem to update in homekit / homebridge when there are adjustments made on the thermostat itself (or even adjustments made in the smartlife app). Like if I turn on the thermostat, it doesnt show it being 'on' in homekit, or if i adjust anything like temperature, it wont relfect those changes in homekit either.

After a plugin restart it seems to fetch the devices info and it becomes up to date. However any changes after that wont relfect. Is there any reason why this could be. There arent any logs that I can see that could point out an issue.

Btw the 'cool' mode works great after the update so thank you so much & I am loving the plugin!

@KiwiBlueSpring
Copy link
Author

Okay after a plguin restart, the fan accessory from before does something, I realise its for a fan mode for the ac which makes sense & super useful.

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

Successfully merging a pull request may close this issue.

2 participants