manjh wrote: ↑Saturday 27 March 2021 12:25
What puzzles me: if the payload is the same, then why is it that the Tuya app knows that the lamp is white-only? Apparently the app has a way to detect it!
Not all info is shared by the api
This is you payload (White only):
Code: Select all
{ 'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': { 'devices': [ { 'data': { 'brightness': '130',
'color_mode': 'white',
'color_temp': 1000,
'online': True,
'state': 'true'},
'dev_type': 'light',
'ha_type': 'light',
'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/15919273389f9d925c99f.png',
'id': '6276453110521cc9ecd9',
'name': 'LSC 2'},
This is my payload (RGBWW):
Code: Select all
{ 'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': { 'devices': [ { 'data': { 'brightness': '255',
'color_mode': 'colour',
'color_temp': 10000,
'online': True,
'state': 'true'},
'dev_type': 'light',
'ha_type': 'light',
'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/15620318474c719f1c5cf.png',
'id': 'bfa550692e71343800we58',
'name': '3D Lamp'}],
When I set my lamp to white then 'color_mode': 'colour', change 'color_mode': 'white', . So there is no other data to use.