Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COSORI Smart WiFi Air Fryer 5.5L Air Fryer #55

Open
brianrossmeisl opened this issue May 25, 2020 · 110 comments
Open

COSORI Smart WiFi Air Fryer 5.5L Air Fryer #55

brianrossmeisl opened this issue May 25, 2020 · 110 comments

Comments

@brianrossmeisl
Copy link

I am new to home Assistant and was trying to track if there was an integration with pyvesync to the "COSORI Smart WiFi Air Fryer 5.8QT(100 Recipes), 1700-Watt Programmable Base for Air Frying, Roasting & Keep Warm 11 Cooking Preset,Preheat&Shake Remind". My wife uses it with VeSync all the time.

https://www.amazon.com/COSORI-1700-Watt-Programmable-Roasting-Touchscreen/dp/B07VLKMMJ5
I would love to help spec the function calls but do not know the best way to trace the app. It appears to preload cooking temperature, times, and a "shake reminder".
It seems like a fun thing to get going to me. Let me know if you are interested.

@JerTeske
Copy link

I too am interested in this integration. Would love push notifications and led color changes when food is done

@webdjoe
Copy link
Owner

webdjoe commented Oct 3, 2020

If you capture the packets I will work on this

@webdjoe webdjoe closed this as completed Oct 3, 2020
@webdjoe webdjoe reopened this Oct 3, 2020
@frigidplatypus
Copy link

webdjoe What would you need captured to work on this?

@webdjoe
Copy link
Owner

webdjoe commented Dec 10, 2020

You can use a packet capture app, Packet Capture works for me and you don't need to root the device, to capture all of the associated packets with the vesync device. So you would start packet capture, go to VeSync, get the device list, go to the device and run each function possible. You can then stop the Packet Capture app and download all of the associated packets from the app. Upload them here and please redact your token and account id. That is unless you want your VeSync devices to become possessed 😉

@scruffynerf
Copy link

Just got a Cosori Smart Oven, same sort of thing. I'll capture the packets for that. Would love to see Home Assistant controlling it eventually.

@fmartingr
Copy link

I'm considering buying a Cosori with wifi capabilities as well. Have been any progress on this? If I end up buying it I can provide packet capture as well and help with this (with some guidance probably).

@scruffynerf
Copy link

Haven't had a chance to do a packet capture yet...however, I have noticed something interesting: control via the phone app is NOT as good in some ways as the Alexa control. Asking Alexa allows you to do things easier (no button push required) than the vesync app. Strangely the Google Assistant control isn't as good as either. So if we do some packet capture, might be worthwhile seeing if we can replicate the best method(s) of control.

For example, Alexa can't control the Toast level, only invoke Toast.

@webdjoe
Copy link
Owner

webdjoe commented Jan 22, 2021 via email

@BKrnk1337
Copy link

Hello - one question. Do you still work on the implementation?

@webdjoe
Copy link
Owner

webdjoe commented Jul 8, 2021

I was sent a few packet captures for this and I started but they were incomplete. Once I receive all captures from the device list forward I'll work on this further.

@Infiniski
Copy link

Webdjoe are you in the home assistant Facebook page?

I've opened up a post about this air fryer and I'm sure a couple of us there will help you out get those packets.

I downloaded the packet app and ran the VESYNC app, however when I tried to connect to the air fryer the VPN was blocking it or something?

@urechi
Copy link

urechi commented Dec 2, 2021

Hey @webdjoe ,

I am not a dev but I work in the cyber security area and I am happy to help with some traffic captures for the COSORI Smart WiFi Air Fryer 5.5L.

  • Vesync V3.1.52 (build 9)
  • IOS 15.1.1

Get status request:

POST /cloud/v1/deviceManaged/bypass HTTP/1.1
Host: smartapi.vesync.com
Accept: */*
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: VeSync/3.1.52 (com.etekcity.vesyncPlatform; build:9; iOS 15.1.1) Alamofire/5.2.1
Accept-Language: en-GB;q=1.0, ro-US;q=0.9
Content-Length: 497
Connection: close

{
  "pid": "8t8o******lsbosm",
  "appVersion": "VeSync 3.1.52 build9",
  "acceptLanguage": "en",
  "jsonCmd": {
    "getStatus": "status"
  },
  "phoneBrand": "iPhone 12 Pro",
  "traceId": "1638456091583",
  "timeZone": "Europe/London",
  "userCountryCode": "GB",
  "accountID": "2*****1",
  "uuid": "92e3e134-****-4216-****-65c7656bcf3b",
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==",
  "configModule": "WiFi_AirFryer_CS158-AF_EU",
  "cid": "0MCk86********Hg65mzxlE-6vcTp",
  "phoneOS": "iOS 15.1.1",
  "method": "bypass",
  "debugMode": false
}

Status responses

standby: No cooking at all.

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 14:46:34 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 98

{
  "traceId": "1638456091583",
  "code": 0,
  "msg": null,
  "result": {
    "returnStatus": {
      "cookStatus": "standby"
    }
  }
}

pullOut: Baskets are not pushed in all the way.

{
  "traceId": "1638454636576",
  "code": 0,
  "msg": null,
  "result": {
    "returnStatus": {
      "cookStatus": "pullOut"
    }
  }
}

cooking: Cooking in progress

{
  "traceId": "1638459417561",
  "code": 0,
  "msg": null,
  "result": {
    "returnStatus": {
      "curentTemp": 32,
      "cookSetTemp": 175,
      "mode": "custom",
      "cookSetTime": 15,
      "cookLastTime": 15,
      "cookStatus": "cooking",
      "tempUnit": "celsius",
      "accountId": "2*****1",
      "customRecipe": "Manual"
    }
  }
}

cookStop - While you are cooking something and you press pause in the app:

{
  "traceId": "1638457432788",
  "code": 0,
  "msg": null,
  "result": {
    "returnStatus": {
      "curentTemp": 38,
      "cookSetTemp": 175,
      "mode": "custom",
      "cookSetTime": 15,
      "cookLastTime": 15,
      "cookStatus": "cookStop",
      "tempUnit": "celsius",
      "accountId": "2*****1",
      "customRecipe": "Manual"
    }
  }
}

Initiate a manual cooking

POST /cloud/v1/deviceManaged/bypass HTTP/1.1
Host: smartapi.vesync.com
Accept: */*
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: VeSync/3.1.52 (com.etekcity.vesyncPlatform; build:9; iOS 15.1.1) Alamofire/5.2.1
Accept-Language: en-GB;q=1.0, ro-US;q=0.9
Content-Length: 695
Connection: close

{
  "accountID": "2*****1",
  "traceId": "1638456459244",
  "cid": "0MCk86********Hg65mzxlE-6vcTp",
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==",
  "timeZone": "Europe/London",
  "acceptLanguage": "en",
  "configModule": "WiFi_AirFryer_CS158-AF_EU",
  "userCountryCode": "GB",
  "debugMode": false,
  "method": "bypass",
  "uuid": "92e3e134-****-4216-****-65c7656bcf3b",
  "jsonCmd": {
    "cookMode": {
      "cookStatus": "cooking",
      "mode": "custom",
      "cookSetTime": 15,
      "tempUnit": "celsius",
      "cookSetTemp": 175,
      "customRecipe": "Manual",
      "accountId": "2*****1",
      "recipeId": 1,
      "appointmentTs": 0,
      "readyStart": false,
      "recipeType": 1
    }
  },
  "phoneBrand": "iPhone 12 Pro",
  "pid": "8t8o******lsbosm",
  "phoneOS": "iOS 15.1.1",
  "appVersion": "VeSync 3.1.52 build9"
}

Successful response, where the air fryer started to cook:

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 15:47:25 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 74

{
  "traceId": "1638456459244",
  "code": 0,
  "msg": "cookMode set ok",
  "result": null
}

A failed response, The baskets are not pushed in all the way. Please secure them to start cooking.

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 14:17:11 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 83

{
  "traceId": "1638454631216",
  "code": 11901000,
  "msg": "cookMode set fail",
  "result": null
}

Pause the cooking:

POST /cloud/v1/deviceManaged/bypass HTTP/1.1
Host: smartapi.vesync.com
Accept: */*
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: VeSync/3.1.52 (com.etekcity.vesyncPlatform; build:9; iOS 15.1.1) Alamofire/5.2.1
Accept-Language: en-GB;q=1.0, ro-US;q=0.9
Content-Length: 509
Connection: close

{
  "cid": "0MCk86********Hg65mzxlE-6vcTp",
  "traceId": "1638456308273",
  "uuid": "92e3e134-****-4216-****-65c7656bcf3b",
  "userCountryCode": "GB",
  "method": "bypass",
  "phoneOS": "iOS 15.1.1",
  "acceptLanguage": "en",
  "jsonCmd": {
    "cookMode": {
      "cookStatus": "stop"
    }
  },
  "appVersion": "VeSync 3.1.52 build9",
  "accountID": "2*****1",
  "phoneBrand": "iPhone 12 Pro",
  "configModule": "WiFi_AirFryer_CS158-AF_EU",
  "pid": "8t8o******lsbosm",
  "timeZone": "Europe/London",
  "debugMode": false,
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw=="
}

Successful response:

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 15:47:33 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 74

{
  "traceId": "1638456308273",
  "code": 0,
  "msg": "cookMode set ok",
  "result": null
}

Failed response:

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 16:03:24 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 83

{
  "traceId": "1638456308273",
  "code": 11901000,
  "msg": "cookMode set fail",
  "result": null
}

Resume or continue the cooking after a pause:

POST /cloud/v1/deviceManaged/bypass HTTP/1.1
Host: smartapi.vesync.com
Accept: */*
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: VeSync/3.1.52 (com.etekcity.vesyncPlatform; build:9; iOS 15.1.1) Alamofire/5.2.1
Accept-Language: en-GB;q=1.0, ro-US;q=0.9
Content-Length: 512
Connection: close

{
  "traceId": "1638461430107",
  "pid": "8t8o******lsbosm",
  "timeZone": "Europe/London",
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==",
  "appVersion": "VeSync 3.1.52 build9",
  "phoneOS": "iOS 15.1.1",
  "uuid": "92e3e134-****-4216-****-65c7656bcf3b",
  "accountID": "2*****1",
  "configModule": "WiFi_AirFryer_CS158-AF_EU",
  "jsonCmd": {
    "cookMode": {
      "cookStatus": "cooking"
    }
  },
  "phoneBrand": "iPhone 12 Pro",
  "cid": "0MCk86********Hg65mzxlE-6vcTp",
  "method": "bypass",
  "userCountryCode": "GB",
  "debugMode": false,
  "acceptLanguage": "en"
}

Successful response:

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 16:10:30 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 74

{
  "traceId": "1638461430107",
  "code": 0,
  "msg": "cookMode set ok",
  "result": null
}

Failed response:

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 16:14:54 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 83

{
  "traceId": "1638461693432",
  "code": 11901000,
  "msg": "cookMode set fail",
  "result": null
}

End the cooking:

POST /cloud/v1/deviceManaged/bypass HTTP/1.1
Host: smartapi.vesync.com
Accept: */*
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: VeSync/3.1.52 (com.etekcity.vesyncPlatform; build:9; iOS 15.1.1) Alamofire/5.2.1
Accept-Language: en-GB;q=1.0, ro-US;q=0.9
Content-Length: 508
Connection: close


{
  "accountID": "2*****1",
  "timeZone": "Europe/London",
  "phoneBrand": "iPhone 12 Pro",
  "userCountryCode": "GB",
  "jsonCmd": {
    "cookMode": {
      "cookStatus": "end"
    }
  },
  "debugMode": false,
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==",
  "cid": "0MCk86********Hg65mzxlE-6vcTp",
  "uuid": "92e3e134-****-4216-****-65c7656bcf3b",
  "method": "bypass",
  "pid": "8t8o******lsbosm",
  "configModule": "WiFi_AirFryer_CS158-AF_EU",
  "traceId": "1638456337118",
  "phoneOS": "iOS 15.1.1",
  "appVersion": "VeSync 3.1.52 build9",
  "acceptLanguage": "en"
}

Successful and failed responses are the same as when you pause the cooking.

Apologies for the long comment! If you need anything else please let me know.

@urechi
Copy link

urechi commented Dec 2, 2021

POST /cloud/v2/deviceManaged/getFirmwareUpdateInfoList HTTP/1.1
Host: smartapi.vesync.com
Tz: Europe/London
Content-Type: application/json
Accept: */*
Tk: p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==
Accountid: 2******1
Content-Length: 442
User-Agent: VeSync/3.1.52 (iPhone; iOS 15.1.1; Scale/3.00)
Accept-Language: en
Accept-Encoding: gzip, deflate
Connection: close

{
  "userCountryCode": "GB",
  "phoneOS": "iOS 15.1.1",
  "acceptLanguage": "en",
  "phoneBrand": "iPhone 12 Pro",
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==",
  "timeZone": "Europe/London",
  "traceId": "1638463323221",
  "cidList": [
    "0MVz0ePMG8*********D2otJoGYR",
    "0MVyh25XIH2K*********_Hi64sb3AX",
    "0MCk86avk94********mzxlE-6vcTp"
  ],
  "appVersion": "VeSync 3.1.52 build9",
  "accountID": "2******1",
  "macIDList": [],
  "method": "getFirmwareUpdateInfoList"
}

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 16:42:03 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 1837

{
  "traceId": "1638463323221",
  "code": 0,
  "msg": "request success",
  "result": {
    "cidFwInfoList": [
      {
        "deviceCid": "0MVz0ePMG8*********D2otJoGYR",
        "deviceName": "Kitchen Air Purifier",
        "deviceImg": "https://image.vesync.com/defaultImages/LV_PUR131S_Series/icon_131_air_purifier_80.png",
        "uuid": "17e60652-6077-****-****-11069e5c2c26",
        "configModule": "AirPurifier131",
        "connectionType": "wifi",
        "macID": "",
        "deviceRegion": "US",
        "code": 0,
        "msg": null,
        "firmUpdateInfos": [
          {
            "upgradeLevel": 0,
            "latestVersionUrl": null,
            "partFirmwareVersionUrl": null,
            "currentVersion": "2.0.58",
            "latestVersion": null,
            "releaseNotes": null,
            "pluginName": "mainFw",
            "priority": 1,
            "upgradeTimeoutInSec": 120,
            "isMainFw": true
          }
        ]
      },
      {
        "deviceCid": "0MVyh25XIH2K*********_Hi64sb3AX",
        "deviceName": "Master Bedroom Air Purifier",
        "deviceImg": "https://image.vesync.com/defaultImages/LV_PUR131S_Series/icon_131_air_purifier_80.png",
        "uuid": "bdb182e1-eea1-*****-******-1cd7fd821559",
        "configModule": "AirPurifier131",
        "connectionType": "wifi",
        "macID": "",
        "deviceRegion": "US",
        "code": 0,
        "msg": null,
        "firmUpdateInfos": [
          {
            "upgradeLevel": 0,
            "latestVersionUrl": null,
            "partFirmwareVersionUrl": null,
            "currentVersion": "2.0.58",
            "latestVersion": null,
            "releaseNotes": null,
            "pluginName": "mainFw",
            "priority": 1,
            "upgradeTimeoutInSec": 120,
            "isMainFw": true
          }
        ]
      },
      {
        "deviceCid": "0MCk86avk94********mzxlE-6vcTp",
        "deviceName": "Kitchen Air Fryer",
        "deviceImg": "https://image.vesync.com/defaultImages/CS158_AF_Series/airfryer_80.png",
        "uuid": "92e3e134-e419-*****-*****-65c7656bcf3b",
        "configModule": "WiFi_AirFryer_CS158-AF_EU",
        "connectionType": "wifi",
        "macID": "",
        "deviceRegion": "EU",
        "code": 0,
        "msg": null,
        "firmUpdateInfos": [
          {
            "upgradeLevel": 0,
            "latestVersionUrl": null,
            "partFirmwareVersionUrl": null,
            "currentVersion": "1.0.06",
            "latestVersion": null,
            "releaseNotes": null,
            "pluginName": "mainFw",
            "priority": 1,
            "upgradeTimeoutInSec": 120,
            "isMainFw": true
          }
        ]
      }
    ],
    "macIDFwInfoList": null
  }
}
POST /cloud/v1/homeManaged/getHomeDeviceStatus HTTP/1.1
Host: smartapi.vesync.com
Accept: */*
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: VeSync/3.1.52 (com.etekcity.vesyncPlatform; build:9; iOS 15.1.1) Alamofire/5.2.1
Accept-Language: en-GB;q=1.0, ro-US;q=0.9
Content-Length: 514
Connection: close

{
  "userCountryCode": "GB",
  "phoneBrand": "iPhone 12 Pro",
  "deviceList": [
    {
      "cid": "0MVz0ePMG8*********D2otJoGYR",
      "subDeviceNo": 0
    },
    {
      "cid": "0MVyh25XIH2K*********_Hi64sb3AX",
      "subDeviceNo": 0
    },
    {
      "subDeviceNo": 0,
      "cid": "0MCk86avk94********mzxlE-6vcTp"
    }
  ],
  "debugMode": false,
  "method": "getHomeDeviceStatus",
  "acceptLanguage": "en",
  "traceId": "1638463353181",
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==",
  "appVersion": "VeSync 3.1.52 build9",
  "accountID": "2******1",
  "phoneOS": "iOS 15.1.1",
  "timeZone": "Europe/London"
}

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 16:42:33 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 630

{
  "traceId": "1638463353181",
  "code": 0,
  "msg": "request success",
  "result": {
    "deviceList": [
      {
        "cid": "0MVz0ePMG8*********D2otJoGYR",
        "subDeviceNo": 0,
        "currentFirmVersion": "2.0.58",
        "deviceStatus": "off",
        "connectionStatus": "online",
        "mode": "auto",
        "speed": null,
        "extension": null
      },
      {
        "cid": "0MVyh25XIH2K*********_Hi64sb3AX",
        "subDeviceNo": 0,
        "currentFirmVersion": "2.0.58",
        "deviceStatus": "off",
        "connectionStatus": "online",
        "mode": "auto",
        "speed": null,
        "extension": null
      },
      {
        "cid": "0MCk86avk94********mzxlE-6vcTp",
        "subDeviceNo": 0,
        "currentFirmVersion": "1.0.06",
        "deviceStatus": "off",
        "connectionStatus": "online",
        "mode": null,
        "speed": null,
        "extension": null
      }
    ]
  }
}
POST /cloud/v2/deviceManaged/configurationsV2 HTTP/1.1
Host: smartapi.vesync.com
Accept: */*
Content-Type: application/json
Accept-Encoding: gzip, deflate
User-Agent: VeSync/3.1.52 (com.etekcity.vesyncPlatform; build:9; iOS 15.1.1) Alamofire/5.2.1
Accept-Language: en-GB;q=1.0, ro-US;q=0.9
Content-Length: 423
Connection: close

{
  "method": "configurationsV2",
  "appVersion": "VeSync 3.1.52 build9",
  "phoneOS": "iOS 15.1.1",
  "token": "p5RD57Vgczk-Nrg_**********_YKjd0vKMEIIYUrf1ZywA5Vw==",
  "acceptLanguage": "en",
  "debugMode": false,
  "traceId": "1638463406174",
  "deviceRegion": "EU",
  "accountID": "2******1",
  "timeZone": "Europe/London",
  "configModule": "WiFi_AirFryer_CS158-AF_EU",
  "phoneBrand": "iPhone 12 Pro",
  "cid": "0MCk86avk94********mzxlE-6vcTp",
  "userCountryCode": "GB"
}

HTTP/1.1 200 
Date: Thu, 02 Dec 2021 16:43:26 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Content-Length: 1010

{
  "traceId": "1638463406174",
  "code": 0,
  "msg": "request success",
  "result": {
    "deviceName": "Kitchen Air Fryer",
    "deviceImg": "https://image.vesync.com/defaultImages/CS158_AF_Series/airfryer_80.png",
    "defaultDeviceImg": "https://image.vesync.com/defaultImages/CS158_AF_Series/airfryer_80.png",
    "allowNotify": "on",
    "currentFirmVersion": "1.0.06",
    "latestFirmVersion": "1.0.06",
    "deviceStatus": "off",
    "connectionStatus": "online",
    "ownerShip": true,
    "rssi": -58,
    "wifiName": null,
    "macID": "c8:**:96:**:15:**",
    "wifiMacID": "c8:**:96:**:15:**",
    "btMacID": null,
    "cid": "0MCk86avk94********mzxlE-6vcTp",
    "uuid": "92e3e134-e419-*****-*****-65c7656bcf3b",
    "configModule": "WiFi_AirFryer_CS158-AF_EU",
    "connectionType": "wifi",
    "firmwareUrl": "http://fw.vesync.com/WiFi_AirFryer_CS158-AF_EU/v1.0.06/",
    "outletInfo": null,
    "switchInfo": null,
    "hygrometerInfo": null,
    "airPurifierInfo": null,
    "subDevices": null,
    "airFryerInfo": {
      "tempUnit": 2,
      "workTempUnit": "c"
    },
    "meatThermometerInfo": null,
    "humidifierInfo": null,
    "ovenInfo": null,
    "deviceRegion": "EU",
    "deviceType": "CS158-AF"
  }
}

@eddyliao
Copy link

@urechi
Can you tell me how did you manage to sniff this?
Im using fiddler with a android emulator but i cant get the app to connect

@urechi
Copy link

urechi commented Dec 27, 2021

@eddyliao I am using Burp Suite with my IOS device. You can follow this guide for android.

@webdjoe
Copy link
Owner

webdjoe commented Dec 27, 2021

I use the Packet Capture app on android. You have to install a custom certificate so make so you uninstall both app and certificate when you are done - https://github.com/webdjoe/pyvesync#feature-requests

@eddyliao
Copy link

eddyliao commented Dec 27, 2021

hi thanks for the replies, i tried the packet capture app and nox as well (i also tried other android emulators)
Nothing seems to work. I am able to sniff other packets but when i open the vesync app, i dont see any device.
When i remove the proxy info from the wifi settings, everything seems to work fine afterwards

Tried root and installed the certificate correctly as well

@urechi
Copy link

urechi commented Dec 27, 2021

I usually have issues when there is ssl certificate pinning implemented but I doubt they've done it for Android and not for the IOS app.

@timtimmahh
Copy link

This seems like a good option to get it working, however I'm really not a fan of the cloud-based requirements of VeSync devices. I've got a Corsori Smart Wifi Toaster Oven/Air Fryer (CS130-A0) and it looks like it uses an ESP32 microprocessor for WiFi/Bluetooth connectivity (and hopefully also controls the device itself). Looking at the FCC images, it looks like the JTAG interface is exposed, so using a JTAG programmer it might be possible to obtain/modify the device's firmware (or completely make it from scratch) and use that to make it locally controlled as well. If all Cosori devices work similarly, it might be possible to create a bunch of custom firmware for the devices in order to provide what VeSync won't provide (such as support for the upcoming Matter protocol later this year).

When I have time, I'll take apart my Cosori device and see if this is actually possible.

@TRusselo
Copy link

hope to see progress on this too

@rdlvm
Copy link

rdlvm commented Mar 23, 2022

Hi, has anyone managed to install Tasmota on AirFryer Wifi? That would be great and maybe make things easier.

@webdjoe
Copy link
Owner

webdjoe commented Mar 24, 2022

This will be in the next release!

In terms of Tasmota, I don't know much but would love to hear if you have any success.

@rdlvm
Copy link

rdlvm commented Mar 25, 2022

This will be in the next release!

In terms of Tasmota, I don't know much but would love to hear if you have any success.

It would be great to be able to install Tasmota on it, but I don't know if it actually allows it.

When will Cosori airfryer compatible integration launch?

@eddyliao
Copy link

eddyliao commented Mar 25, 2022

Quick update on this
I was not able to successfully get the states of the air fryer
Also i noticed that it would be not a good idea to try simulating sending command coming from an android device as well
This is because whatever you do, you will have to manually press start on the air fryer for it to start

So instead i decided to emulate a google home command and it works for turning it on/off (however only able to use common preset built in only).
Doing it this way, you dont have to manually press the button on the air fryer for it to start

@timtimmahh
Copy link

timtimmahh commented Apr 13, 2022

Update on accessing the ESP32 board in Cosori devices.
I haven't been able to get the JTAG programmer to work with the ESP32 board, but I found a workaround using the serial communication between the ESP32 and the main control board (LCD/button board).
It appears that the control board sends the current state of the device any time something changes (ie. rotating function nob, toggling light/fan, etc). I haven't been able to decode the entire output, but was able to get some useful information.

Hex output:
A5 22 30 1E 00 3B 01 26 40 00 07 00 00 00 03 F1 01 C2 01 84 03 00 00 02 01 01 00 00 00 00 00 00 00 00 00 00

example data num bytes byte range info
A5 22 30 1E 00 3B 01 26 40 00 07 00 00 00 14 0-14 seemingly random or possibly a timestamp
03 1 15 the current function, on mine it goes up to 12 or 0C (12 total functions)
F1 01 2 16-17 unknown data, possibly temperature unit setting or wifi status?
C2 01 2 18-19 the current temperature (decimal)
84 03 2 20-21 the current timer (seconds)
00 00 2 22-23 unknown setting (again maybe temp unit/wifi?)
02 1 24 fan setting (0=off, 1=normal fan, 2=high speed fan)
01 1 25 light setting (0=off, 1=on)
01 1 26 unknown setting (again maybe temp unit?)
00 00 00 00 00 00 00 00 00 00 10 27-36 unknown data (possibly just excess serial data)

Still investigating this further, but I think this shows a lot of potential.

Edit: In case anyone wants to know the configuration I used to obtain this, I connected an ESP32 (a USB to TTL adapter also works) to the control board from the oven over it's exposed serial port (see photo 8). The serial configuration I used is 9600-8-N-1 (baud-data bits-parity-stop bits).
Also, it's important to know that the serial output is in little-endian and must be converted to big-endian to get the correct values. For example, the temperature data above is represented as C2 01 which is 49665 in decimal, whereas 01 C2 is 450, which is exactly what is displayed on the LCD.

@sofakng
Copy link

sofakng commented Apr 23, 2022

I'm also looking forward to this!

@danyknight
Copy link

Is this still something that is being considered?

@webdjoe
Copy link
Owner

webdjoe commented Apr 27, 2022

Yes, this is in the works. I've just been short on free time lately.

@Scope666
Copy link

Scope666 commented Oct 24, 2023

I bring news for those who have an AirFryer 158 for those who want to test and help with development on HA

vlebourl/custom_vesync#175

or for anyone who wants to follow

https://github.com/tv4you2016/custom_vesync/tree/feature/airfryer

I tested this out, but it's not loading correctly... getting this (latest HA, not beta)

2023-10-23 20:46:13.776 ERROR (MainThread) [homeassistant.components.light] Error adding entities for domain light with platform vesync
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncNightLightHA' object has no attribute '_icon'
2023-10-23 20:46:13.777 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform vesync
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncHumiditySensor' object has no attribute '_icon'
2023-10-23 20:46:13.777 ERROR (MainThread) [homeassistant.components.humidifier] Error adding entities for domain humidifier with platform vesync
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncHumidifierHA' object has no attribute '_icon'
2023-10-23 20:46:13.778 ERROR (MainThread) [homeassistant.components.light] Error while setting up vesync platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncNightLightHA' object has no attribute '_icon'
2023-10-23 20:46:13.779 ERROR (MainThread) [homeassistant.components.number] Error adding entities for domain number with platform vesync
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncHumidifierMistLevelHA' object has no attribute '_icon'
2023-10-23 20:46:13.779 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up vesync platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncHumiditySensor' object has no attribute '_icon'
2023-10-23 20:46:13.780 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entities for domain binary_sensor with platform vesync
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncOutOfWaterSensor' object has no attribute '_icon'
2023-10-23 20:46:13.780 ERROR (MainThread) [homeassistant.components.humidifier] Error while setting up vesync platform for humidifier
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncHumidifierHA' object has no attribute '_icon'
2023-10-23 20:46:13.781 ERROR (MainThread) [homeassistant.components.number] Error while setting up vesync platform for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncHumidifierMistLevelHA' object has no attribute '_icon'
2023-10-23 20:46:13.782 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up vesync platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity
    original_icon=entity.icon,
                  ^^^^^^^^^^^
  File "/config/custom_components/vesync/common.py", line 171, in icon
    return self._icon
           ^^^^^^^^^^
AttributeError: 'VeSyncOutOfWaterSensor' object has no attribute '_icon'
image

@tv4you2016
Copy link

Hello @Scope666

Can you share your device with me to do some testing?

email:
tv4you2016@gmail.com

@Subia75
Copy link

Subia75 commented Oct 24, 2023

I bring news for those who have an AirFryer 158 for those who want to test and help with development on HA

vlebourl/custom_vesync#175

or for anyone who wants to follow

https://github.com/tv4you2016/custom_vesync/tree/feature/airfryer

HI @tv4you2016
I ask for help.
I tried to download and install the integration, I connected my vesync account but it can't find my CS158-AF model.
is there anything else to do?
thanks

@tv4you2016
Copy link

tv4you2016 commented Oct 24, 2023

@Subia75 Hello, how do you install it?
manual mode or through -HACS

@Subia75
Copy link

Subia75 commented Oct 24, 2023

@Subia75 Hello, how do you install it? manual mode or through -HACS

With HACS
it should be the easiest way.
I imagined that by entering my vsync account credentials the fryer would be associated.
At this point I think I'm missing something.

@tv4you2016
Copy link

@Subia75Olá, como você instala isso? modo manual ou através de -HACS

Com o HACS deveria ser a maneira mais fácil. Imaginei que ao inserir as credenciais da minha conta vsync a fritadeira seria associada. Neste ponto, acho que estou faltando alguma coisa.

It can't be through HACS because the author still doesn't accept my pull, make changes to the files according to my pull and after reboot ...... test

vlebourl/custom_vesync#175

Or go to my repository and download it and put it in the folder
custom_components/vesync

@Subia75
Copy link

Subia75 commented Oct 24, 2023

ok I'll try to download the repository.
but do we need to do something else afterwards or should it associate automatically after entering the credentials?

@tv4you2016
Copy link

it automatically associates if there is an airfryer of the following models
'models': ['CS137-AF/CS158-AF', 'CS158-AF', 'CS137-AF', 'CS358-AF'],

@Subia75
Copy link

Subia75 commented Oct 24, 2023

Yes i have the CS158-AF model, so I think I should find it.
I'll try again later and let you know if everything is ok.
thanks in advance for the help

update post 2023/10/25
@tv4you2016
I updated to manual and it works.

I hope it gets integrated into the original code.
image

Thank you

@vechiato
Copy link

vechiato commented Oct 25, 2023 via email

@KyleStilkey
Copy link

Ok I have tested and it's not working for me, I am wondering if this is due to the model change?

I have the CS168-AF, it's the exact same thing as the 158 and was the replacement model sent out to people due to the fire hazards. Here is all I see for entities.
image

I tried running the AirFryer to see if it would pull new entries but nothing just the single End cooking or preheating.

Now the other issues here too is I do have the 158 too, but as of last month it was pulled from the app in the United States and I'm not sure if this was done in any other regions so I can't test if this is due to just a simple number difference, but again these 2 models are the exact same just the 168 is the replacement one they released that fixes the wiring fire hazzard.

@tv4you2016
Copy link

@KyleStilkey
Can you share your device with me to do some testing?

email:
tv4you2016@gmail.com

@Subia75
Copy link

Subia75 commented Oct 26, 2023

@tv4you2016
as per my previous post from 2 days ago I see all the entities of my CS158-AF, but it doesn't respond to commands.
if I give them from the integration the fryer doesn't respond,
if I give them from the fryer in the integration there is no change of state in the sensors.
does it only happen to me?

@pvieira84
Copy link

@tv4you2016 Is the CAF-P583S supposed to be supported? Tried it but doesn't show any devices

@tv4you2016
Copy link

tv4you2016 commented Oct 26, 2023

@pvieira84
the update is every 30 seconds
model suported: ['CS137-AF/CS158-AF', 'CS158-AF', 'CS137-AF', 'CS358-AF'],

@KyleStilkey
Copy link

@KyleStilkey Can you share your device with me to do some testing?

email: tv4you2016@gmail.com

I shared my device with you on the app. Let me know if you need anything else.

@tv4you2016
Copy link

@KyleStilkey add me in discord [PT]GOODVIBE[PT]#1314

@KyleStilkey
Copy link

@KyleStilkey add me in discord [PT]GOODVIBE[PT]#1314

Sent

@tv4you2016
Copy link

@leo-storch
Copy link

leo-storch commented Oct 26, 2023

Hey, How do I setup my airfryer with this integration? I already installed the last commit manually on HACS.

My model: CAF-lI401S and the integration doesn't shows mine. Thanks!

image
airfryer

image

@tv4you2016
Copy link

From now on I only support my repository
https://github.com/tv4you2016/custom_vesync/discussions
You should first check that there is no discussion about your model. If it doesn't exist, please create one

@Scope666
Copy link

Scope666 commented Oct 26, 2023

It was quite a fight, but I managed to disable SSL Pinning with Frida using Android Studio. Here's a few grabs from my Cosori Dual Blaze: (CAF-P583S-KUS)

POST /cloud/v2/deviceManaged/configurationsV2 HTTP/2

{
  "traceId": "1698336540120",
  "code": 0,
  "msg": "request success",
  "module": null,
  "stacktrace": null,
  "result": {
    "ownerShip": true,
    "hygrometerInfo": null,
    "switchInfo": null,
    "macID": "4c:75:25:11:11:11",
    "btMacID": "4c:75:25:11:11:11",
    "airPurifierInfo": null,
    "deviceRegion": "US",
    "deviceName": "Air Fryer",
    "deviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wfon_afr_caf-p583s-kus_us_240.png",
    "uuid": "47012820-3541-48e0-b4d4-1111111",
    "connectionType": "WiFi+BTOnboarding+BTNotify",
    "deviceStatus": "off",
    "ovenInfo": null,
    "configModule": "WFON_AFR_CAF-P583S-KUS_US",
    "meatThermometerInfo": null,
    "sousVideCookerInfo": null,
    "wifiName": "Down_IoT",
    "subDevices": null,
    "latestFirmVersion": "1.0.15",
    "deviceProp": null,
    "airFryerInfo": {
      "tempUnit": 1,
      "workTempUnit": "f"
    },
    "deviceType": "CAF-P583S-KUS",
    "rssi": -49,
    "allowNotify": "on",
    "wifiMacID": "4c:75:25:11:11:11",
    "firmwareUrl": "http://fw.vesync.com/WFON_AFR_CAF-P583S-KUS_US/mcuFirmware/v1.0.15/CAF-P583S-KUS_MCU_C1_ota_v1.0.15.bin",
    "currentFirmVersion": "1.0.15",
    "connectionStatus": "online",
    "defaultDeviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wfon_afr_caf-p583s-kus_us_240.png",
    "humidifierInfo": null,
    "outletInfo": null,
    "cid": "vsskf5a9079c41eca7592f65c4111111"
  }
}

-----------
POST /cloud/v2/deviceManaged/bypassV2 HTTP/2

{
  "traceId": "1698336538629",
  "code": 0,
  "msg": "request success",
  "module": null,
  "stacktrace": null,
  "result": {
    "traceId": "1698336538629",
    "code": 0,
    "result": {
      "stepArray": [
        {
          "cookSetTime": 60,
          "cookTemp": 175,
          "mode": "AirFry",
          "cookLastTime": 60,
          "shakeTime": 0,
          "cookEndTime": 0,
          "recipeName": "Air Fry",
          "recipeId": 14,
          "recipeType": 3
        }
      ],
      "stepIndex": 0,
      "cookMode": "normal",
      "cookStatus": "ready",
      "tempUnit": "f",
      "preheatSetTime": 0,
      "preheatLastTime": 0,
      "preheatEndTime": 0,
      "preheatTemp": 0,
      "startTime": 1698336533,
      "totalTimeRemaining": 60,
      "currentTemp": 24,
      "appointLastTime": 0,
      "shakeStatus": 0
    }
  }
}

@ncodee
Copy link

ncodee commented Mar 19, 2024

+1 for ‎CAF-R901 support.

@gtbdf1
Copy link

gtbdf1 commented Aug 6, 2024

@webdjoe since the HACS dev abandoned this, is there anything we can do to help get it integrated into the official integration? I have the Cosori Dual Blaze and am willing to help where I can.

@webdjoe webdjoe changed the title COSORI Smart WiFi Air Fryer COSORI Smart WiFi Air Fryer 5.5L Air Fryer Aug 6, 2024
@webdjoe
Copy link
Owner

webdjoe commented Aug 8, 2024

@gtbdf1 Yes, I'm happy to help if you can capture packets.

@Scope666 What did you use to capture packets? Did you patch the APK and/or use frida server? Can you please post the full request/response with all actions from the home screen and each command the device does?

@Scope666
Copy link

Scope666 commented Aug 8, 2024

@Scope666 What did you use to capture packets? Did you patch the APK and/or use frida server? Can you please post the full request/response with all actions from the home screen and each command the device does?

It's been a long time since I did this, but basically I setup a rooted android emulator, and used Frida.

https://samsclass.info/128/proj/M145.htm
https://medium.com/@agmmnn/ssl-pinning-bypass-for-android-emulators-using-frida-702c6bf84e38

(the 2nd link is now gated behind a Medium membership, it wasn't when I did this). :(

@gtbdf1
Copy link

gtbdf1 commented Aug 8, 2024

@webdjoe will do tomorrow morning. Wireshark ok?

@webdjoe
Copy link
Owner

webdjoe commented Aug 12, 2024

@gtbdf1 That works, can you post to this discussion, this issue is getting a bit unmanageable - #249

@carlosgamezvillegas
Copy link

Hello @Scope666,

Could you share the body of the post to get the status of the CAF-P583S-KUS? I am trying to make a homebridge plugin to make it compatible with Homekit and monitor the devices. However I am stuck, I cannot get the status of the devices. so for this is what I have but it does not work.

url = '/cloud/v1/deviceManaged/bypass'
body: {
'pid': 'idjmyvv*****',
'appVersion': '1.1',
'acceptLanguage': 'en',
"jsonCmd": {
"getStatus": "status"
},
'phoneBrand': 'HomeBridge-Vesync',
'traceId': this.traceId,
'timeZone': 'America/Chicago',
'userCountryCode': 'US',
'accountID': this.uniqueId,
'uuid': '0b652d90-',
'token': this.token,
'configModule': 'WFON_AFR_CAF-P583S-KUS_US',
'cid': 'vssk32d57
',
'phoneOS': 'HomeBridge-Vesync',
'method': 'bypass',
'debugMode': false
}
Thank you,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests