0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
218 stars 67 forks source link

Add support for RGBW SMART BULB as RGBCW #223

Open johntous opened 1 year ago

johntous commented 1 year ago

[ { "active_time": 1674313273, "biz_type": 18, "category": "dsd", "create_time": 1674313273, "icon": "smart/icon/bay1585191439783zhuG/ef2ac0cba9bc74854b2c9073fae8d595.png", "id": "eb0bc4ea75f9d47b76ayw9", "ip": "", "lat": "", "local_key": "5fd894c5060b43d1", "lon": "", "model": "", "name": "RGBW SMART BULB", "online": true, "owner_id": " ", "product_id": "hvjumj3mjsqapl4t", "product_name": "RGBW SMART BULB", "status": [ { "code": "bright_value", "value": 10 }, { "code": "colour_data", "value": "008803ac01c2" }, { "code": "countdown", "value": 0 }, { "code": "debug_data", "value": "" }, { "code": "power_memory", "value": "AAEAiAOsAcIACgPo" }, { "code": "random_timing", "value": "AAAA" }, { "code": "rhythm_mode", "value": "AAAAAAA=" }, { "code": "scene_data", "value": "000e0d0000000000000000c803e8" }, { "code": "sleep_mode", "value": "AAA=" }, { "code": "switch_led", "value": true }, { "code": "wakeup_mode", "value": "AAA=" }, { "code": "work_mode", "value": "white" } ], "sub": false, "time_zone": "-05:00", "uid": "az16741851266452Ls6y", "update_time": 1674313273, "uuid": "2943175e7ebd0e37", "schema": [ { "code": "bright_value", "mode": "rw", "type": "Integer", "property": { "min": 10, "max": 1000, "scale": 0, "step": 1 } }, { "code": "colour_data", "mode": "rw", "type": "String", "property": { "maxlen": 255 } }, { "code": "control_data", "mode": "wo", "type": "String", "property": { "maxlen": 255 } }, { "code": "countdown", "mode": "rw", "type": "Integer", "property": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, { "code": "debug_data", "mode": "rw", "type": "String", "property": { "maxlen": 255 } }, { "code": "music_data", "mode": "wo", "type": "String", "property": { "maxlen": 255 } }, { "code": "power_memory", "mode": "rw", "type": "Raw", "property": {} }, { "code": "random_timing", "mode": "rw", "type": "Raw", "property": {} }, { "code": "rhythm_mode", "mode": "rw", "type": "Raw", "property": { "maxlen": "255" } }, { "code": "scene_data", "mode": "rw", "type": "String", "property": { "maxlen": 255 } }, { "code": "sleep_mode", "mode": "rw", "type": "Raw", "property": {} }, { "code": "switch_led", "mode": "rw", "type": "Boolean", "property": {} }, { "code": "wakeup_mode", "mode": "rw", "type": "Raw", "property": {} }, { "code": "work_mode", "mode": "rw", "type": "Enum", "property": { "range": [ "white", "colour", "scene", "music" ] } } ] } ]

[28/01/2023, 18:32:45] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "6936deb7-e41b-4eba-88f0-c7b02a3dc003", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "22": 1000, "code": "bright_value", "t": "1674948764", "value": 1000 } ] } t = 1674948764 [28/01/2023, 18:32:45] [@0x5e/homebridge-tuya-platform] [RGBW SMART BULB] [Lightbulb/undefined/Brightness] Update value: 1 => 100 [28/01/2023, 18:32:51] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "629fb6ce-5b8e-4b06-9902-01eca9b6571b", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "20": false, "code": "switch_led", "t": "1674948771", "value": false } ] } t = 1674948771 [28/01/2023, 18:32:51] [@0x5e/homebridge-tuya-platform] [RGBW SMART BULB] [Lightbulb/undefined/On] Update value: true => false [28/01/2023, 18:32:53] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "18c54bf6-27f9-46f7-9de8-f11126a68b6d", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "20": true, "code": "switch_led", "t": "1674948773", "value": true } ] } t = 1674948773 [28/01/2023, 18:32:53] [@0x5e/homebridge-tuya-platform] [RGBW SMART BULB] [Lightbulb/undefined/On] Update value: false => true [28/01/2023, 18:32:55] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "e4064f6b-3580-4733-a0eb-101af268d9ab", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "21": "colour", "code": "work_mode", "t": "1674948775", "value": "colour" } ] } t = 1674948775 [28/01/2023, 18:33:00] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "5572ca9c-3fe2-4485-a88a-1c149b0feff0", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "24": "015b03ac01c2", "code": "colour_data", "t": "1674948779", "value": "015b03ac01c2" } ] } t = 1674948779 [28/01/2023, 18:33:08] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "b8ddda90-0819-414d-9369-699c471c5484", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "24": "015b03e801c2", "code": "colour_data", "t": "1674948787", "value": "015b03e801c2" } ] } t = 1674948787 [28/01/2023, 18:33:10] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "a34aff83-bdc1-4366-b4a3-bb9f87c44525", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "24": "015b03e803e8", "code": "colour_data", "t": "1674948790", "value": "015b03e803e8" } ] } t = 1674948790 [28/01/2023, 18:33:14] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/ protocol = 4 message = { "dataId": "44e2e987-fcc5-43fa-b295-1a83f8800e83", "devId": "eb0bc4ea75f9d47b76ayw9", "productKey": "hvjumj3mjsqapl4t", "status": [ { "20": false, "code": "switch_led", "t": "1674948794", "value": false } ] } t = 1674948794 [28/01/2023, 18:33:14] [@0x5e/homebridge-tuya-platform] [RGBW SMART BULB] [Lightbulb/undefined/On] Update value: true => false

0x5e commented 1 year ago

colour_data in string type is not supported yet. See: https://github.com/0x5e/homebridge-tuya-platform/issues/181#issuecomment-1400832534

RGBCW require a schema of adjusting color temperature, usually named temp_value or temp_value_v2, but I don't see it in your device.

johntous commented 1 year ago

It may not RGBCW. in the smart life app, there is two modes white (one temp) and color mode where I can change colors. but in HomeKit I can only turn it off and on and adjust the brightness

johntous commented 1 year ago

Is there any plan to colour_data in string type

0x5e commented 1 year ago

it's in the plan, but the format of colour_data in string type is not very clear, and I don't have enough coding time recently. need help :)