Skip to content

homekit光色映射与tuya platform不一致/homekit color temperature map not match with tuya platform #136

Closed
@XiaoTonyLuo

Description

@XiaoTonyLuo

Describe the bug
homekit中调节光色时,tuya-homebridge发送的色温范围仅从0(6300K白光)至255(2700K黄光),而设备定义的色温范围在0(黄光)-1000(白光),导致从homekit中只能调节为黄光。

When change color temperature in Homekit, tuya-homebridge send color-temp request with range 0 (which is demonstrated as 6300K white in Homekit) and 255 (which is demonstrated as 2700K warm yellow in Homekit), which the device accepts color temperature with range 0 (2700K warm yellow in tuya app) and 1000 (6300K white in tuya app), hence in homekit, the color could only been adjusted as warm yellow.

Expected behavior
设备光色应当能在Homekit中完整调节。

The color temperature should be fully adjustable in Homekit.
Screenshots
If applicable, add screenshots to help explain your problem.

Device info (please complete the following information, which can be found in log):
request path = /v1.0/iot-01/associated-users/devices

path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands

device model:
image

Device functions (please complete the following information, which can be found in log):
request path = /v1.0/devices/functions
Same device Id, like this:

"commands":[{"code":"temp_value","value":0}]}

Additional context
full log (some sensitive data was removed):

TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyacn.com, path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands, params = null, body = {"commands":[{"code":"temp_value","value":241}]}, headers = {"t":"1635049344850","client_id":"","nonce":"8b7b03d0-346c-11ec-b345-b3fc3343cac3","Signature-Headers":"client_id","sign":"","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.4.2"}
TuyaOpenAPI response: {"result":true,"success":true,"t":1635049345050} path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyacn.com, path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands, params = null, body = {"commands":[{"code":"temp_value","value":247}]}, headers = {"t":"1635049345162","client_id":"
","nonce":"8b7b03d0-346c-11ec-b345-b3fc3343cac3","Signature-Headers":"client_id","sign":"","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.4.2"}
TuyaOpenMQ onMessage: topic = cloud/token/in/c92dc2016ec72fb05c446ab32cfe2b15, message = {"data":{"dataId":"bed14273-9239-42ff-a783-b4cd952fb866","devId":"6ce506708ec1125e7fbdr2","productKey":"ygmlkb8h","status":[{"4":241,"code":"temp_value","t":"1635049344","value":241}]},"protocol":4,"pv":"2.0","sign":"
","t":1635049344}
TuyaOpenAPI response: {"result":true,"success":true,"t":1635049345380} path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyacn.com, path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands, params = null, body = {"commands":[{"code":"temp_value","value":251}]}, headers = {"t":"1635049345420","client_id":"
","nonce":"8b7b03d0-346c-11ec-b345-b3fc3343cac3","Signature-Headers":"client_id","sign":"","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.4.2"}
TuyaOpenAPI response: {"result":true,"success":true,"t":1635049345676} path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands
TuyaOpenMQ onMessage: topic = cloud/token/in/c92dc2016ec72fb05c446ab32cfe2b15, message = {"data":{"dataId":"0c05bcb5-b701-4562-9049-671918429645","devId":"6ce506708ec1125e7fbdr2","productKey":"ygmlkb8h","status":[{"4":247,"code":"temp_value","t":"1635049344","value":247}]},"protocol":4,"pv":"2.0","sign":"
","t":1635049344}
TuyaOpenMQ onMessage: topic = cloud/token/in/c92dc2016ec72fb05c446ab32cfe2b15, message = {"data":{"dataId":"7c67fc47-5296-4d66-922a-a651bbdab8c1","devId":"6ce506708ec1125e7fbdr2","productKey":"ygmlkb8h","status":[{"4":251,"code":"temp_value","t":"1635049345","value":251}]},"protocol":4,"pv":"2.0","sign":"","t":1635049345}
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyacn.com, path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands, params = null, body = {"commands":[{"code":"temp_value","value":6}]}, headers = {"t":"1635049347588","client_id":"
","nonce":"8b7b03d0-346c-11ec-b345-b3fc3343cac3","Signature-Headers":"client_id","sign":"","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.4.2"}
TuyaOpenAPI response: {"result":true,"success":true,"t":1635049347772} path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyacn.com, path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands, params = null, body = {"commands":[{"code":"temp_value","value":0}]}, headers = {"t":"1635049347887","client_id":"
","nonce":"8b7b03d0-346c-11ec-b345-b3fc3343cac3","Signature-Headers":"client_id","sign":"","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.4.2"}
TuyaOpenMQ onMessage: topic = cloud/token/in/c92dc2016ec72fb05c446ab32cfe2b15, message = {"data":{"dataId":"691c2c33-f3cc-4f6d-b67b-0ac72015198a","devId":"6ce506708ec1125e7fbdr2","productKey":"ygmlkb8h","status":[{"4":6,"code":"temp_value","t":"1635049347","value":6}]},"protocol":4,"pv":"2.0","sign":"
","t":1635049347}
TuyaOpenAPI response: {"result":true,"success":true,"t":1635049348082} path = /v1.0/devices/6ce506708ec1125e7fbdr2/commands
TuyaOpenMQ onMessage: topic = cloud/token/in/c92dc2016ec72fb05c446ab32cfe2b15, message = {"data":{"dataId":"1521ffd9-8636-47f4-8b00-b0809a1f2575","devId":"6ce506708ec1125e7fbdr2","productKey":"ygmlkb8h","status":[{"4":0,"code":"temp_value","t":"1635049347","value":0}]},"protocol":4,"pv":"2.0","sign":"***","t":1635049347}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions