Closed mcrypt closed 1 year ago
Capture some packets and I'll be happy to add!
@webdjoe
Setting color + brightness:
{ "payload": { "source": "APP", "method": "setLightStatus", "data": { "action": "on", "speed": 0, "green": 169, "brightness": 100, "blue": 177, "red": 255, "colorMode": "color" } }, "phoneOS": "iPadOS 15.2", "acceptLanguage": "en", "phoneBrand": "iPad", "cid": "ABC123***", "configModule": "WiFi_Bulb_MulticolorBulb_US", "token": "ABC123***", "timeZone": "Europe\/Warsaw", "traceId": "ABC123***", "userCountryCode": "PL", "appVersion": "VeSync 3.2.6 build6", "accountID": "ABC123***", "method": "bypassV2" }
@webdjoe
Turning on:
{ "payload": { "source": "APP", "method": "setSwitch", "data": { "id": 0, "enabled": true } }, "phoneOS": "iPadOS 15.2", "acceptLanguage": "en", "phoneBrand": "iPad", "cid": "ABC123***", "configModule": "WiFi_Bulb_MulticolorBulb_US", "token": "ABC123***", "timeZone": "Europe\/Warsaw", "traceId": "ABC123***", "userCountryCode": "PL", "appVersion": "VeSync 3.2.6 build6", "accountID": "ABC123***", "method": "bypassV2" }
@webdjoe
Getting status:
{ "payload": { "source": "APP", "method": "getLightStatus", "data": {} }, "phoneOS": "iPadOS 15.2", "acceptLanguage": "en", "phoneBrand": "iPad", "cid": "ABC123***", "configModule": "WiFi_Bulb_MulticolorBulb_US", "token": "ABC123***", "timeZone": "Europe\/Warsaw", "traceId": "ABC123***", "userCountryCode": "PL", "appVersion": "VeSync 3.2.6 build6", "accountID": "ABC123***", "method": "bypassV2" }
@webdjoe all should POST https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2
Thank you, I will work on this. How did you capture packets from the app?
On Thu, Feb 24, 2022 at 4:49 PM michalantoszczuk @.***> wrote:
@webdjoe https://github.com/webdjoe all should POST https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2
— Reply to this email directly, view it on GitHub https://github.com/webdjoe/pyvesync/issues/89#issuecomment-1050299309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6JJBRIYN5BS2AGC2OTADTU42RX5ANCNFSM5D4F2QFA . You are receiving this because you were mentioned.Message ID: @.***>
@webdjoe macOS 12 (Apple M1) + VeSync app (from AppStore, version iPad/iPhone) + Charles (https://www.charlesproxy.com). If you need more packets, just tell me.
+1, also have some ESL100MC bulbs :)
Thank you, I will work on this. How did you capture packets from the app? … On Thu, Feb 24, 2022 at 4:49 PM michalantoszczuk @.> wrote: @webdjoe https://github.com/webdjoe all should POST https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2 — Reply to this email directly, view it on GitHub <#89 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6JJBRIYN5BS2AGC2OTADTU42RX5ANCNFSM5D4F2QFA . You are receiving this because you were mentioned.Message ID: @.>
Any news?
@michalantoszczuk I'm working on this now. Can you send the device list return? It should be from the home screen of the app.
@michalantoszczuk Apologies, I meant the api call return of the device list. Also can you send the returns as well. Hard to debug or test without them
@webdjoe anything else?
getHomeInfo:
Request:
:method POST :scheme https :path /cloud/v1/homeManaged/getHomeInfo :authority smartapi.vesync.com accept */* content-type application/json accept-encoding br;q=1.0, gzip;q=0.9, deflate;q=0.8 user-agent VeSync/3.2.42 (com.etekcity.vesyncPlatform; build:12; iOS 15.5.0) Alamofire/5.2.1 accept-language pl-PL;q=1.0, en-PL;q=0.9, de-PL;q=0.8 content-length 357
Response:
{ "traceId": "1659807701719", "code": 0, "msg": "request success", "result": { "roomInfoList": [{ "roomId": 1234567, "roomName": "Backyard", "roomLight": "Part Sun,part Shade", "createTime": 12345678901, "groupList": [], "deviceList": [] }, { "roomId": 1234567, "roomName": "Bedroom", "roomLight": "Part Sun,part Shade", "createTime": 12345678901, "groupList": [], "deviceList": [{ "logicDeviceType": 1, "isOwner": true, "cid": "1234567890qwertyuiopQWERTYUIOP12", "uuid": "a1234567-1234-1abc-12ab-a1b2345c67d8", "macID": null, "subDeviceNo": 0, "subDeviceType": null, "deviceName": "Lampa sypialnia", "deviceImg": "https://image.vesync.com/defaultImages/ESL100MC/icon_color_light_bulb.png", "configModule": "WiFi_Bulb_MulticolorBulb_US", "deviceRegion": "EU", "type": "Wifi-light", "deviceType": "ESL100MC", "authKey": null, "connectionType": "wifi", "currentFirmVersion": "1.0.12", "createTime": 12345678901, "sharedPeople": [], "deviceStatus": "on", "connectionStatus": "online", "mode": null, "speed": null, "extension": null, "deviceProp": null }] }, { "roomId": 1234567, "roomName": "Kitchen", "roomLight": "Part Sun,part Shade", "createTime": 12345678901, "groupList": [], "deviceList": [] }, { "roomId": 1234567, "roomName": "Living Room", "roomLight": "Part Sun,part Shade", "createTime": 12345678901, "groupList": [], "deviceList": [] }, { "roomId": 1234567, "roomName": "Master Bedroom", "roomLight": "Part Sun,part Shade", "createTime": 12345678901, "groupList": [], "deviceList": [] }, { "roomId": 1234567, "roomName": "pokój X", "roomLight": "Part Sun,part Shade", "createTime": 12345678901, "groupList": [], "deviceList": [{ "logicDeviceType": 1, "isOwner": true, "cid": "1234567890qwertyuiopQWERTYUIOP12", "uuid": "a1234567-1234-1abc-12ab-a1b2345c67d8", "macID": null, "subDeviceNo": 0, "subDeviceType": null, "deviceName": "Pokój X lampa ", "deviceImg": "https://image.vesync.com/defaultImages/ESL100MC/icon_color_light_bulb.png", "configModule": "WiFi_Bulb_MulticolorBulb_US", "deviceRegion": "EU", "type": "Wifi-light", "deviceType": "ESL100MC", "authKey": null, "connectionType": "wifi", "currentFirmVersion": "1.0.12", "createTime": 12345678901, "sharedPeople": [], "deviceStatus": "on", "connectionStatus": "online", "mode": null, "speed": null, "extension": null, "deviceProp": null }] }, { "roomId": 0, "roomName": null, "roomLight": null, "createTime": null, "groupList": [], "deviceList": [] }] } }
@michalantoszczuk Thank you, I also need the "getting status" return from the server. The return json from the set status calls have code: 0
correct?
example:
{ "traceId": "123", "code": 0, "msg": "request success", "result": { "traceId": "123", "code": 0, "result": { "action": "on", "brightness": 100, "colorMode": "color", "speed": 0, "red": 255, "green": 1, "blue": 0 } } }
@webdjoe have you maybe had a chance to add this bulb? :)
Hey @michalantoszczuk @aigimig Please check out PR #149 . I added support for the ESL100MC. Not able to test but based off your captures should be close
@sdrapha Please check out #149 and make sure I didn't break any of your methods for Valceno bulbs. I tried to maintain consistency and compatibility with your code.
@sdrapha Please check out #149 and make sure I didn't break any of your methods for Valceno bulbs. I tried to maintain consistency and compatibility with your code.
I'll take a look a it once I get a chance to sit down at the computer, maybe later in the night.
hi, thanks for your work @webdjoe! I had a look at the latest release and have one problem. The on/off function seems to be working fine but setting the color/brightness has no effect on the bulb despite the 'success' response. Any ideas?
Code:
device.display()
device.turn_on()
device.display()
device.set_rgb_color(255, 0, 0)
device.set_brightness(1)
device.display()
Debug mode output:
Device Name:.................. Lamp
Model: ....................... ESL100MC
Subdevice No: ................ None
Status: ...................... off
Online: ...................... online
Type: ........................ Wifi-light
CID: ......................... CID_redacted_CID
UUID: ........................ UUID_redacted_UUID
Brightness: .................. 43 %
ColorHSV: .................... hue: 0.0, saturation: 0.0, value: 54.0,
ColorRGB: .................... hue: 0.0, saturation: 0.0, value: 54.0,
ColorMode: ................... color
2022-11-03 14:59:34,309 - DEBUG - =======call_api=============================
2022-11-03 14:59:34,310 - DEBUG - [post] calling '/cloud/v2/deviceManaged/bypassV2' api
2022-11-03 14:59:34,310 - DEBUG - API call URL:
https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2
2022-11-03 14:59:34,310 - DEBUG - API call headers:
{"Content-Type": "application/json; charset=UTF-8", "User-Agent": "okhttp/3.12.1"}
2022-11-03 14:59:34,310 - DEBUG - API call json:
{"timeZone": "Europe/Warsaw", "acceptLanguage": "en", "accountID": "1234567", "token": "token_redacted", "appVersion": "2.8.6", "phoneBrand": "iPad", "phoneOS": "iPadOS 15.2", "traceId": "1667483974", "method": "bypassV2", "debugMode": false, "deviceRegion": "US", "cid": "CID_redacted_CID", "configModule": "WiFi_Bulb_MulticolorBulb_US", "payload": {"source": "APP", "method": "setSwitch", "data": {"id": 0, "enabled": true}}}
2022-11-03 14:59:35,035 - DEBUG - API response:
{'traceId': '1667483974', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667483974', 'code': 0}}
2022-11-03 14:59:35,052 - DEBUG - =======call_api=============================
2022-11-03 14:59:35,052 - DEBUG - [post] calling '/cloud/v2/deviceManaged/bypassV2' api
2022-11-03 14:59:35,052 - DEBUG - API call URL:
https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2
2022-11-03 14:59:35,052 - DEBUG - API call headers:
{"Content-Type": "application/json; charset=UTF-8", "User-Agent": "okhttp/3.12.1"}
2022-11-03 14:59:35,052 - DEBUG - API call json:
{"timeZone": "Europe/Warsaw", "acceptLanguage": "en", "accountID": "1234567", "token": "token_redacted", "appVersion": "2.8.6", "phoneBrand": "iPad", "phoneOS": "iPadOS 15.2", "traceId": "1667483975", "method": "bypassV2", "debugMode": false, "deviceRegion": "US", "cid": "CID_redacted_CID", "configModule": "WiFi_Bulb_MulticolorBulb_US", "payload": {"method": "setLightStatus", "source": "APP", "data": {"action": "on", "speed": 0, "red": 255, "green": 0, "blue": 0, "colorMode": "color"}}}
Device Name:.................. Lamp
Model: ....................... ESL100MC
Subdevice No: ................ None
Status: ...................... on
Online: ...................... online
Type: ........................ Wifi-light
CID: ......................... CID_redacted_CID
UUID: ........................ UUID_redacted_UUID
Brightness: .................. 43 %
ColorHSV: .................... hue: 0.0, saturation: 0.0, value: 54.0,
ColorRGB: .................... hue: 0.0, saturation: 0.0, value: 54.0,
ColorMode: ................... color
2022-11-03 14:59:35,789 - DEBUG - API response:
{'traceId': '1667483975', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667483975', 'code': 11000000}}
2022-11-03 14:59:35,791 - DEBUG - =======call_api============================= 2022-11-03 14:59:35,791 - DEBUG - [post] calling '/cloud/v2/deviceManaged/bypassV2' api 2022-11-03 14:59:35,791 - DEBUG - API call URL: https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2 2022-11-03 14:59:35,791 - DEBUG - API call headers: {"Content-Type": "application/json; charset=UTF-8", "User-Agent": "okhttp/3.12.1"} 2022-11-03 14:59:35,791 - DEBUG - API call json: {"timeZone": "Europe/Warsaw", "acceptLanguage": "en", "accountID": "1234567", "token": "token_redacted", "appVersion": "2.8.6", "phoneBrand": "iPad", "phoneOS": "iPadOS 15.2", "traceId": "1667483975", "method": "bypassV2", "debugMode": false, "deviceRegion": "US", "cid": "CID_redacted_CID", "configModule": "WiFi_Bulb_MulticolorBulb_US", "payload": {"method": "setLightStatus", "source": "APP", "data": {"action": "on", "speed": 0, "brightness": 1}}} 2022-11-03 14:59:36,505 - DEBUG - API response: {'traceId': '1667483975', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667483975', 'code': 11000000}}
Device Name:.................. Lamp
Model: ....................... ESL100MC
Subdevice No: ................ None
Status: ...................... on
Online: ...................... online
Type: ........................ Wifi-light
CID: ......................... CID_redacted_CID
UUID: ........................ UUID_redacted_UUID
Brightness: .................. 1 %
ColorHSV: .................... hue: 0.0, saturation: 100.0, value: 100.0,
ColorRGB: .................... hue: 0.0, saturation: 100.0, value: 100.0,
ColorMode: ................... color
@aigimig the display() method was wrong, and I created a PR to fix that. But, what about the physical bulb itself, does it change color or is that also broken? because that would be an separate issue from the display method I put the fix for. I had a quick look at the code and didn't find anything obvious out of place. but I don't have a esl100mc myself to test it.
only thing I noticed from your debug output:
{"method": "setLightStatus", "source": "APP", "data": {"action": "on", "speed": 0, "red": 255, "green": 0, "blue": 0, "colorMode": "color"}}}
there is no "brightness" key on that payload. maybe that is the issue.
the captured call from @michalantoszczuk does include the brightness key:
{ "source": "APP", "method": "setLightStatus", "data": { "action": "on", "speed": 0, "green": 169, "brightness": 100, "blue": 177, "red": 255, "colorMode": "color" }
@sdrapha The bulb only changes colors when controlled from the official VeSync app. When controlled by the pyvesync lib, only turn on/off works but not the color or brightness. I noticed the 'brightness' difference too and tried to add it in debug mode but it made no difference - no effect on the bulb itself. @michalantoszczuk maybe you can have a look and confirm whether it works for you or if the setLightStatus has changed?
There are a few possible issues - userCountryCode
, debugMode
and brightness
in the request. Let me make adjustments and I'll start a new branch. @aigimig, are you based in the EU?
@aigimig Can you try testing this branch? https://github.com/sdrapha/pyvesync/tree/patch-2 I added an empty brightness key, to the calls that only changes the colors
Do you know how to clone the git, and setup an virtual env on python to do that? the CONTRBUTING.md has some instruction on how to do that, so you can test the current code directly, without waiting for a release, the only difference would be the git clone address, where you would git clone https://github.com/sdrapha/pyvesync/tree/patch-2
instead
If it works I do a PR with that change
@webdjoe yes, EU @sdrapha I will check tonight and let you know
The result is still the same. The response is 'success' but the bulb's color/brightness does not change. I also tried modifying timezone, region and even app version to match what I've got on my phone but that did not change anything.
Code:
device.display()
device.turn_on()
device.display()
device.set_rgb_color(255, 0, 0)
device.set_brightness(1)
device.display()
Debug mode output:
Device Name:.................. Lamp
Model: ....................... ESL100MC
Subdevice No: ................ None
Status: ...................... off
Online: ...................... online
Type: ........................ Wifi-light
CID: ......................... CID_redacted_CID
UUID: ........................ UUID_redacted_UUID
Brightness: .................. 43 %
ColorHSV: .................... hue: 0.0, saturation: 0.0, value: 54.0,
ColorRGB: .................... red: 138.0, green: 138.0, blue: 138.0,
ColorMode: ................... color
2022-11-04 17:56:47,986 - DEBUG - =======call_api=============================
2022-11-04 17:56:47,986 - DEBUG - [post] calling '/cloud/v2/deviceManaged/bypassV2' api
2022-11-04 17:56:47,986 - DEBUG - API call URL:
https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2
2022-11-04 17:56:47,986 - DEBUG - API call headers:
{"Content-Type": "application/json; charset=UTF-8", "User-Agent": "okhttp/3.12.1"}
2022-11-04 17:56:47,986 - DEBUG - API call json:
{"timeZone": "Europe/Warsaw", "acceptLanguage": "en", "accountID": "1234567", "token": "token_redacted", "appVersion": "2.8.6", "phoneBrand": "SM N9005", "phoneOS": "Android", "traceId": "1667581007", "method": "bypassV2", "debugMode": false, "deviceRegion": "US", "cid": "CID_redacted_CID", "configModule": "WiFi_Bulb_MulticolorBulb_US", "payload": {"source": "APP", "method": "setSwitch", "data": {"id": 0, "enabled": true}}}
2022-11-04 17:56:48,733 - DEBUG - API response:
{'traceId': '1667581007', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667581007', 'code': 0}}
2022-11-04 17:56:48,733 - DEBUG - =======call_api=============================
2022-11-04 17:56:48,733 - DEBUG - [post] calling '/cloud/v2/deviceManaged/bypassV2' api
2022-11-04 17:56:48,733 - DEBUG - API call URL:
https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2
2022-11-04 17:56:48,733 - DEBUG - API call headers:
{"Content-Type": "application/json; charset=UTF-8", "User-Agent": "okhttp/3.12.1"}
2022-11-04 17:56:48,733 - DEBUG - API call json:
{"timeZone": "Europe/Warsaw", "acceptLanguage": "en", "accountID": "1234567", "token": "token_redacted", "appVersion": "2.8.6", "phoneBrand": "SM N9005", "phoneOS": "Android", "traceId": "1667581008", "method": "bypassV2", "debugMode": false, "deviceRegion": "US", "cid": "CID_redacted_CID", "configModule": "WiFi_Bulb_MulticolorBulb_US", "payload": {"method": "setLightStatus", "source": "APP", "data": {"action": "on", "speed": 0, "brightness": "", "red": 255, "green": 0, "blue": 0, "colorMode": "color"}}}
Device Name:.................. Lamp
Model: ....................... ESL100MC
Subdevice No: ................ None
Status: ...................... on
Online: ...................... online
Type: ........................ Wifi-light
CID: ......................... CID_redacted_CID
UUID: ........................ UUID_redacted_UUID
Brightness: .................. 43 %
ColorHSV: .................... hue: 0.0, saturation: 0.0, value: 54.0,
ColorRGB: .................... red: 138.0, green: 138.0, blue: 138.0,
ColorMode: ................... color
2022-11-04 17:56:49,548 - DEBUG - API response:
{'traceId': '1667581008', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667581008', 'code': 11000000}}
2022-11-04 17:56:49,548 - DEBUG - =======call_api============================= 2022-11-04 17:56:49,548 - DEBUG - [post] calling '/cloud/v2/deviceManaged/bypassV2' api 2022-11-04 17:56:49,548 - DEBUG - API call URL: https://smartapi.vesync.com/cloud/v2/deviceManaged/bypassV2 2022-11-04 17:56:49,548 - DEBUG - API call headers: {"Content-Type": "application/json; charset=UTF-8", "User-Agent": "okhttp/3.12.1"} 2022-11-04 17:56:49,548 - DEBUG - API call json: {"timeZone": "Europe/Warsaw", "acceptLanguage": "en", "accountID": "1234567", "token": "token_redacted", "appVersion": "2.8.6", "phoneBrand": "SM N9005", "phoneOS": "Android", "traceId": "1667581009", "method": "bypassV2", "debugMode": false, "deviceRegion": "US", "cid": "CID_redacted_CID", "configModule": "WiFi_Bulb_MulticolorBulb_US", "payload": {"method": "setLightStatus", "source": "APP", "data": {"action": "on", "speed": 0, "brightness": 1, "red": "", "green": "", "blue": ""}}} 2022-11-04 17:56:50,314 - DEBUG - API response: {'traceId': '1667581009', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667581009', 'code': 11000000}}
Device Name:.................. Lamp
Model: ....................... ESL100MC
Subdevice No: ................ None
Status: ...................... on
Online: ...................... online
Type: ........................ Wifi-light
CID: ......................... CID_redacted_CID
UUID: ........................ UUID_redacted_UUID
Brightness: .................. 1 %
ColorHSV: .................... hue: 0.0, saturation: 100.0, value: 100.0,
ColorRGB: .................... red: 255, green: 0, blue: 0,
ColorMode: ................... color
now, the colorMode
key is missing from the set_brightness()
api call.
There are not enough captured calls to study all the possible combinations.
I would assume that the other colorMode that is not "color" would be "white"?
And maybe there are missing needed parameters when we switch between colormodes. That is true in the ValcenoBulbs, and for esl100mc, there are not enough packets captured to see all the different combinations.
yes, the other color mode is 'white'. @michalantoszczuk any chance you could capture some more packets? I don't have access to an iPad
@aigimig I just updated that same previous branch, to include an empty colorMode
key on the api call, when only changing brightness. Please, if you have the opportunity to test that again please. Another scenario I would ask you to tes is, by changing the Color Mode in the vesync app, and then tryng the pyvesync lib, to see if you get different results depending on the current colorMode.
@sdrapha unfortunately no change. Also, I think you misspelled the key name and used 'color' instead of 'colorMode' but I tried both options (also by passing 'color' or 'white' as value) but still no luck :/
I also noticed that the brightness value displayed in the device.display()
result is the value from the 'white' colorMode (app remembers a different value for each mode)
On top of that, I also noticed now, that nowhere in the code there is an api call to SET the colorMode to "white"
On top of that, I also noticed now, that nowhere in the code there is an api call to SET the colorMode to "white"
That might be it. Maybe a colorMode has to be explicitly set before calling setLightStatus for color/brightness modifications.
I fixed the typo, and explicitly included colorMode = "white", when changing brightness, so I'm assuming that the brightness works only in white mode, and the rgb values have their 'brightness' level already contained in the rgb values itself, which makes sense. rgb(230,230,230) is brighter than rgb(30,30,30) and still the same color.
It's funny. Now I have red lamp (red=255, green=0, blue=0). Brightness=100 If I turn the brightness to 50%, the payload is: red=128, green=0, blue=0, brightness=100.
That is exactly I was talking about, it seems that the 'brightness' parameter is exclusive to white
mode, and when in color
mode, you just tweak the rgb values to get more or less intensity
I just added a new method, set_color_mode( )
, the options are 'color', 'white'
;
assuming that could be used to set the color mode without touching other parameters. Please if you could test it.
No change on my side :/ The mode in the app does not change and the brightness (for mode 'white') and color (for mode 'color') modifications don't work. Also, the set_color_mode does not update the device.display() value
Should the brightness parameter always be 100 ? while tweaking the rgb values? instead of a empty value? that is why more packets captures would be useful, to see all the possible combinations of setLightStatus calls
Should the brightness parameter always be 100 ?
I tried that too with no luck
Ok, I did one more push to try to fix the colorMode status, at least on the pyvesync lib instance. But to get the api calls to really work on the bulb, it's beyond me without any more packets capture to study the calls posible combinations.
I also hope webdjoe has any insights regarding 'userCountryCode' or anything else missing on the headers, instead of the payload.
I only noticed that turn_on/turn_off return code 0:
{'traceId': '1667589369', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667589369', 'code': 0}}
whereas all the setLightStatus calls (colorMode, brightness, rgb) return code 11000000 in the result field
{'traceId': '1667589392', 'code': 0, 'msg': 'request success', 'module': None, 'stacktrace': None, 'result': {'traceId': '1667589392', 'code': 11000000}}
'code': 11000000 means the server received the request successfully, and the payload was rejected because it was wrong. I saw that code when the Valceno methods broke during the code refactoring. Again, we need more captures to figure out the api
I did one more push, to set brightness 100 while sending rgb parameters. That supposedly will replicate the api call from the only one packet capture we have from feb 24 by @michalantoszczuk , (the third post on this issue), We are really getting into some exploration mode now, without more info.
Without having the device it's impossible to know what's going on. The inner code mean's the request was authenticated to that account but there is an issue with the device payload. If you are unable to capture more packets, please use the Rest Client vs code addin, insomnia or postman to send this POST request with your token, accountID and cid to see if this works. The traceid
is the epoch timestamp, you can get this by going to https://www.epochconverter.com/. Must be within a few minutes of sending the call.
{
"payload": {
"source": "APP",
"method": "setLightStatus",
"data": {
"action": "on",
"speed": 0,
"green": 169,
"brightness": 100,
"blue": 177,
"red": 255,
"colorMode": "color"
}
},
"phoneOS": "iPadOS 15.2",
"acceptLanguage": "en",
"phoneBrand": "iPad",
"cid": "++++++DEVICE CID+++++++++",
"configModule": "WiFi_Bulb_MulticolorBulb_US",
"token": "+++++ACCOUNT TOKEN+++++++++",
"timeZone": "Europe\/Warsaw",
"traceId": "THIS IS THE EPOCH TIMESTAMP FOR THE REQUEST",
"userCountryCode": "PL",
"appVersion": "VeSync 3.2.6 build6",
"accountID": "++++++++ACOUNT ID++++++++",
"method": "bypassV2"
}
@sdrapha the RGB modifications started working! so at least we know the one packet we have apart from on/off is correct :) @webdjoe thanks, I will give it a go and report back
Insomnia is great, I recommend, and it already has an automatic unix Timestamp feature, so you don't need to manually get it and type it. Also, you can have multiple requests saved so it's easy to explore.
It looks like that:
this one works for brightness so we were really close :) (rgb values are irrelevant but the keys must be present)
great, I pushed a commit for this last discovery for brightness only adjustment. I wonder now, how to change colormodes, without touching the other parameters, should the other parameters be present( probably yes), but they should be [empty, 0 or 100] ?
It would be great if you could add support for ESL100MC "multicolor" light bulb! Personally i don't care about the "multicolor" option, i just want to be able to switch it on/off