0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
216 stars 65 forks source link

Airconditioner enhancements #232

Open yusufd1 opened 1 year ago

yusufd1 commented 1 year ago

I have a WiFi enabled AC which works with the plug-in. However I cannot control the fan speed. The plug-in exposes 3 accessories. The fan accessory just changes the mode to Fan from cool. I would like to control the wind speed as noted in the Tuya app. Also the main accessory displays the correct room ambient temperature. Is it possible to expose this temperature sensor as a seperate accessory also so that one can do automations when the room temp reaches a seperate level. Right now the ambient room temp is not seen in sensors. Thank you for the great work.

0x5e commented 1 year ago

For the fan speed issue, can you post some logs and device infos? Sensors will be added later.

yusufd1 commented 1 year ago

Hi. Here is log. Temp sensor is fixed now in update. But when I switch on fan speed then it changes the A/C out of cool mode to fan mode mode and sets the temp to 26 deg rather than controlling the wind speed in cool mode.

2/12/2023, 12:48:48 AM] [TuyaPlatform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/082ad5da0d2b49fa64a6760e2fd311f2 protocol = 4 message = { "dataId": "71a185a8-b81a-4cef-b2c6-a6648cd9fe5c", "devId": "12405376c45bbe40ab70", "productKey": "hw50w7qvxluhslkk", "status": [ { "116": 10984 } ] } t = 1676155727 [2/12/2023, 12:48:48 AM] [TuyaPlatform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/082ad5da0d2b49fa64a6760e2fd311f2 protocol = 4 message = { "dataId": "a4773b78-0615-4866-9c4f-6ae7b7289a33", "devId": "12405376c45bbe40ab70", "productKey": "hw50w7qvxluhslkk", "status": [ { "135": 1 } ] } t = 1676155728 [2/12/2023, 12:49:15 AM] [eWeLink] [POWR3] current power [0W] current voltage [2.04V] current current [0A]. [2/12/2023, 12:49:16 AM] [eWeLink] [POWR3] current power [0W] current voltage [2.04V] current current [0A]. [2/12/2023, 12:49:35 AM] [TuyaPlatform] [TuyaOpenAPI] Request: method = post endpoint = https://openapi.tuyaeu.com path = /v1.0/devices/12405376c45bbe40ab70/commands query = null headers = { "t": "1676155775655", "client_id": "u333xxd58dmmc3shn34q", "nonce": "0ba51ecc-c196-4146-8928-3c937969ad1e", "Signature-Headers": "client_id", "sign": "53A3085910D2CC19E8867FDBE0ED7A4765D878A1F185868802C431B8ED2A251D", "sign_method": "HMAC-SHA256", "access_token": "a0e4c16f461b38828d17905114492086", "lang": "en", "dev_lang": "javascript", "dev_channel": "homebridge", "devVersion": "1.7.0-beta.24" } body = { "commands": [ { "code": "switch", "value": true }, { "code": "mode", "value": "wind" } ] } [2/12/2023, 12:49:36 AM] [TuyaPlatform] [TuyaOpenAPI] Response: path = /v1.0/devices/12405376c45bbe40ab70/commands data = { "result": true, "success": true, "t": 1676155776202, "tid": "5bc51f9eaa5e11eda120e66c285aff6b" } [2/12/2023, 12:49:36 AM] [TuyaPlatform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/082ad5da0d2b49fa64a6760e2fd311f2 protocol = 4 message = { "dataId": "243fb78b-f285-4942-b699-a5baecd61b49", "devId": "12405376c45bbe40ab70", "productKey": "hw50w7qvxluhslkk", "status": [ { "2": 260, "code": "temp_set", "t": "1676155776", "value": 260 }, { "4": "wind", "code": "mode", "t": "1676155776", "value": "wind" } ] } t = 1676155776 [2/12/2023, 12:49:36 AM] [TuyaPlatform] [Laila Airconditioner] [HeaterCooler/undefined/Active] Update value: 1 => 0 [2/12/2023, 12:49:36 AM] [TuyaPlatform] [Laila Airconditioner] [HeaterCooler/undefined/CurrentHeaterCoolerState] Update value: 3 => 0 [2/12/2023, 12:49:36 AM] [TuyaPlatform] [Laila Airconditioner] [HeaterCooler/undefined/TargetHeaterCoolerState] Update value: 2 => 0 [2/12/2023, 12:49:36 AM] [TuyaPlatform] [Laila Airconditioner] [HeaterCooler/undefined/CoolingThresholdTemperature] Update value: 21.5 => 26 [2/12/2023, 12:49:36 AM] [TuyaPlatform] [Laila Airconditioner] [HeaterCooler/undefined/HeatingThresholdTemperature] Update value: 21.5 => 26 [2/12/2023, 12:49:49 AM] [TuyaPlatform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/082ad5da0d2b49fa64a6760e2fd311f2 protocol = 4 message = { "dataId": "43f4cee4-2015-442d-9c4e-a43931e0f59a", "devId": "12405376c45bbe40e0e4", "productKey": "hw50w7qvxluhslkk", "status": [ { "3": 26, "code": "temp_current", "t": "1676155788", "value": 26 } ] } t = 1676155788

yusufd1 commented 1 year ago

Here is device info.

"category": "kt", "create_time": 1674845004, "icon": "smart/product_icon2/kt_1.png", "id": "ip": " "lat": " "local_key": "lon": "model": "", "name": "Laila Airconditioner", "online": true, "owner_id": "79885787", "product_id": "hw50w7qvxluhslkk", "product_name": "Air conditioner", "status": [ { "code": "humidity_current", "value": 0 }, { "code": "mode", "value": "wind" }, { "code": "switch", "value": true }, { "code": "temp_current", "value": 24 }, { "code": "temp_set", "value": 260 }, { "code": "temp_set_f", "value": 61 } ], "sub": false, "time_zone": "+02:00", "uid": "update_time": 1674898372, "uuid": "12405376c45bbe40ab70", "schema": [

^G Help^O Write Out ^W Where Is ^K Cut ^X Exit^R Read File

0x5e commented 1 year ago

device info is incomplete, missing the schema part.

yusufd1 commented 1 year ago

Ok I'm new at this. Let me try again

yusufd1 commented 1 year ago

Hi. Here is the rest of it. Also please can you change the min set temp to 16 degrees c and max to 30 degrees c. It will look much better that way in home app. Thanks.

"schema": [ { "code": "humidity_current", "mode": "ro", "type": "Integer", "property": { "unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1 } }, { "code": "mode", "mode": "rw", "type": "Enum", "property": { "range": [ "cold", "hot", "wet", "wind", "auto" ] } }, { "code": "switch", "mode": "rw", "type": "Boolean", "property": {} }, { "code": "temp_current", "mode": "ro", "type": "Integer", "property": { "unit": "℃", "min": -20, "max": 100, "scale": 0, "step": 1 } }, { "code": "temp_set", "mode": "rw", "type": "Integer", "property": { "unit": "℃", "min": 160, "max": 880, "scale": 1, "step": 5 } }, { "code": "temp_set_f", "mode": "rw", "type": "Integer", "property": { "unit": "℉", "min": 61, "max": 88, "scale": 0, "step": 1 } } ] } ]

yusufd1 commented 1 year ago

With the current settings the temp can be set from min 16 to max 88. It will be great if the max can stop at 30 so it will be the same as the physical remote. Thanks.

0x5e commented 1 year ago

I didn't see the fan speed schema in the infos, you can try change the device control mode and restart homebridge to see if it will appear. and the range you can manually set advanced options to override.

yusufd1 commented 1 year ago

this is what i found when changed the device control mode:

{ "code": "wind", "mode": "rw", "type": "Enum", "property": { "range": [ "0", "1", "2", "3" ] } }, { "code": "windspeed", "mode": "rw", "type": "Enum", "property": { "range": [ "strong", "high", "mid_high", "mid", "mid_low", "low", "mute", "auto" ]

yusufd1 commented 8 months ago

hi @0x5e on this issue there is now a horizontal slider in the home app that can control the windspeed but it seems to be inverted ie) full speed on the slider is the minimum speed on the tuya app and vice versa. How can I change the DP to correct this please