Open brianrossmeisl opened 4 years ago
I have the CS158-AF model if it can be used for tests
I was finally able to get a working branch. Try out #160 . Look at the readme for the methods and properties
If it's not too much to ask, I could try but I need some help it's my first time trying and it's not clear to me how to load the test version.
I tried on the "corsori" (it's a typo, the brand name is Cosori, so it shall be fixed everywhere) branch and managed to start pre-heating my CS158-AF Air Fryer.
@Subia75 : you have to checkout the branch called "corsori" in Git, then you can create a python file in the src folder where you can try the functions as mentioned in the readme file, but here's an example:
import pyvesync
from pyvesync.vesync import VeSync
manager = VeSync("<your email address>", "<your password>", time_zone="<your timezone>", debug=True)
manager.login()
# Get/Update Devices from server - populate device lists
manager.update()
# Get your Air Fryer
my_air_fryer = manager.kitchen[0]
# Update the status of the Air Fryer
my_air_fryer.update()
# Preheat your AF to 75 °C
my_air_fryer.set_preheat(75,2)```
@Subia75 You can use WSL: ensure you have python 3.8+ (Ubuntu 20 should have 3.8 by default)
$ python3 --version
Need to have venv, git and pip installed
$ sudo apt get install -y python3.8-venv python3-pip git
Go to your home directory and create a new venv
$ cd ~ && python3 -m venv ./venv
Activate new venv
$ source ./venv/bin/activate
Install wheel & pyvesync from the branch
$ python3 -m pip install wheel
$ python3 -m pip install git+https://github.com/webdjoe/pyvesync.git@corsori
Then you can follow @fraviktor script and look at the https://github.com/webdjoe/pyvesync/tree/corsori#corsori-devices for the methods and property definitions
@fraviktor I really like the sound of "Corsori" 😂.
Haha, I get it :D I left some review comments on the code and also in the readme file if you don't mind, some of them could help to start testing.
I appreciate any suggestions. I rewrote a few time because the logic becomes way to unmanageable and it was tough to find the just the right amount of validation without being too restrictive
Thank you all for your contributions. Is there a way to integrate this into the official home assistant integration?
Haha, I get it :D I left some review comments on the code and also in the readme file if you don't mind, some of them could help to start testing.
@fraviktor Did you leave comments already, I'm not seeing them
Haha, I get it :D I left some review comments on the code and also in the readme file if you don't mind, some of them could help to start testing.
@fraviktor Did you leave comments already, I'm not seeing them
@webdjoe Yes, I did on PR #160 as comments.
How do I download this version to test with my airfryer, I'm not very good with github 😅
I'm going to do one last round of testing and then merge this PR.
@fraviktor Still not seeing any comments or code review - let me know if you have any comments
@KyleStilkey You can test this using a virtual environment in vs code, create a virtual environment (python 3.8+), activate it and then install this pr using the terminal-
$ python3 -m pip install wheel
$ python3 -m pip install git+https://github.com/webdjoe/pyvesync.git@corsori
Run or debug python script from virtual environment from @fraviktor's script:
import pyvesync
from pyvesync.vesync import VeSync
manager = VeSync("<your email address>", "<your password>", time_zone="<your timezone>", debug=True)
manager.login()
# Get/Update Devices from server - populate device lists
manager.update()
# Get your Air Fryer
my_air_fryer = manager.kitchen[0]
# Update the status of the Air Fryer
my_air_fryer.update()
# Preheat your AF to 75 °C
my_air_fryer.set_preheat(75,2)```
Hi @webdjoe , I did some review comments to the Pull Request, but I can copy them here:
vesynckitchen.py
The current kitchen_features dict is not working ('CS137-AF/CS158-AF':... ), because of this key the device won't be available. For beginners it would be nice to provide a usable solution. Suggestion:
kitchen_features: dict = {
'CS158-AF': {
'module': 'VeSyncAirFryer158',
'features': [],
},
'CS137-AF': {
'module': 'VeSyncAirFryer158',
'features': [],
}
}
Readme.md line 561:
original:
VeSyncAirFryer158.preheat(set_temp: int, set_time: int)- Set air fryer preheat mode based on time and temp in defined units
The function "preheat" doesn't set the preheat... the correct preheat function is set_preheat, like this:
VeSyncAirFryer158.set_preheat(target_temp: int, cook_time: int)
Hello All! I found this thread as I have recently bought the Cosori Dual Blaze Air Fryer and am loving it so far. (Model CAF-P583S-KUS) I am an avid HA user and am happy to help in any way with testing and usage. Thank you all for the great work here!
Hello, I have been given the cosori CS158-AF as a gift and I would love to be able to manage it from Home Assistant. I understand that the first step is here.
Could I help with something?
Hey guys. I haven't tried it myself but apparently you can connect to Google home with home assistant. Google still has commands for cosori air fryers (as far as I know). Everything smart home has a tutorial on YouTube for connecting Google home. https://youtu.be/a-Is8GtLJCs You just need to connect to your fryer via the Google home app, then connect to home assistant. But I'm not sure what is possible yet.
@webdjoe Any update on this? Anything we can do to help? Thanks!
Made some final edits and fixes, #160 anyone want to give it a spin?
Just don't lit the house on fire: https://abcnews.go.com/GMA/News/2-million-air-fryers-recalled-due-fire-burn/story?id=97428709
I'll test the non airfryer portion of it, since I dont't have any.
Made some final edits and fixes, #160 anyone want to give it a spin?
Would love to but currently there is a recall going on so sadly at this time I can not until a replacement unit is sent.
Made some final edits and fixes, #160 anyone want to give it a spin?
Would love to but currently there is a recall going on so sadly at this time I can not until a replacement unit is sent.
I have the Lite version in Europe so looks like I'm not affected.
I'm not taking my new air fryer apart but I'm highly interested in getting it into Home Assistant without having to use the VeSync app.
It appears the Dual Blaze doesn't work with this api..
Hi. How can I use this on Home Assistant?
It seems that VeSync integration https://github.com/home-assistant/core/tree/dev/homeassistant/components/vesync uses an old version (pyvesync==2.1.1),
I've installed manually:
docker exec -it homeassistant bash
vi /usr/src/homeassistant/homeassistant/components/vesync/manifest.json
and changed
"requirements": ["pyvesync==2.1.6"]
It also has been upgraded:
bash-5.1# pip list |grep pyvesync
pyvesync 2.1.6
but nothing happends when I add VeSync integration.
I just got my replacement Air Fryer and it seems they are replacing the 158 with 168 models and as far as I'm aware this is pretty much the same but could be wrong.
This model needs to be added please!
Again it's the 168-AF
Have you tried it with the current library? It seems they added the 168 model to the display but kept the internal model device numbers the same as per the configuration call:
{
"deviceType": "SKA",
"model": "CS137-AF/CS158-AF",
"setupEntry": "CS137-AF/CS158-AF",
"modelImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_ska_airfryer137_us_240.png",
"modelName": "COSORI Smart/Pro/Pro Gen 2 5.8 Qt. Air Fryer",
"connectionType": "wifi",
"configInfo": "{\"purchaseUrl\":\"https://www.amazon.com/s?k=Air+Fryer&rh=p_4%3ACOSORI%2Cp_78%3AB07VLKMMJ5&ref=nb_sb_noss_2\"}",
"minSupportedIosVersion": "2.7.0",
"minSupportedAndroidVersion": "2.7.0",
"modelDisplay": "CS158/159/168/169-AF Series",
"entryState": 1,
"latestMaterialConfigVersion": 0,
"isSupportMaterialConfig": false,
"configModuleInfoList": [
{
"configModule": "WiFi_SKA_AirFryer137_US",
"isSupportAlexa": true,
"isSupportGoogleHome": true,
"iftttServiceName": null,
"modelImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_ska_airfryer137_us_240.png",
"deviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_ska_airfryer137_us_240.png",
"deviceRegion": ""
},
{
"configModule": "WiFi_AirFryer_CS158-AF_EU",
"isSupportAlexa": false,
"isSupportGoogleHome": true,
"iftttServiceName": null,
"modelImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_airfryer_cs158-af_eu_240.png",
"deviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_airfryer_cs158-af_eu_240.png",
"deviceRegion": ""
}
],
"hotSpotPrefix": "Cosori_AirFryer_"
}
Have you tried it with the current library? It seems they added the 168 model to the display but kept the internal model device numbers the same as per the configuration call:
{ "deviceType": "SKA", "model": "CS137-AF/CS158-AF", "setupEntry": "CS137-AF/CS158-AF", "modelImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_ska_airfryer137_us_240.png", "modelName": "COSORI Smart/Pro/Pro Gen 2 5.8 Qt. Air Fryer", "connectionType": "wifi", "configInfo": "{\"purchaseUrl\":\"https://www.amazon.com/s?k=Air+Fryer&rh=p_4%3ACOSORI%2Cp_78%3AB07VLKMMJ5&ref=nb_sb_noss_2\"}", "minSupportedIosVersion": "2.7.0", "minSupportedAndroidVersion": "2.7.0", "modelDisplay": "CS158/159/168/169-AF Series", "entryState": 1, "latestMaterialConfigVersion": 0, "isSupportMaterialConfig": false, "configModuleInfoList": [ { "configModule": "WiFi_SKA_AirFryer137_US", "isSupportAlexa": true, "isSupportGoogleHome": true, "iftttServiceName": null, "modelImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_ska_airfryer137_us_240.png", "deviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_ska_airfryer137_us_240.png", "deviceRegion": "" }, { "configModule": "WiFi_AirFryer_CS158-AF_EU", "isSupportAlexa": false, "isSupportGoogleHome": true, "iftttServiceName": null, "modelImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_airfryer_cs158-af_eu_240.png", "deviceImg": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifi_airfryer_cs158-af_eu_240.png", "deviceRegion": "" } ], "hotSpotPrefix": "Cosori_AirFryer_" }
I have and ran the script but got no response, maybe I'm just doing something wrong on my end.
That's a response from the VeSync API when adding a device that defines the devices to be added. I use it as a baseline for making sure all of the models are included for the different device type. The model
and the setupEntry
are read from the get_devices()
API call to configure the device in the pyvesync library. It seems like in the pyvesync configuration the CS168-AF has the same model
as the original "CS137-AF/CS158-AF", meaning that it should be detected as is. You can use the debug flag when instantiating manager = pyvesync.VeSync(user="", password="", debug=True)
. If the device isn't found, it will output the exact model of the device to the log.
did anyone manage to get the cosori air fryer to work with home assistant ?
Would also like a possible update on this or anything I could do to move this forward? I have the "CAF-LI401S-AUS" Cosori 4qt Smart Air Fryer and it already comes out of the box with alexa/google support but I'd like to link it directly to my Home Assistant :)
I'm really interested in using Cosori AirFryer on HA. Any updates on how use it? I'm a little confused on how to use this lib and not an expert. Thanks
I bring news for those who have an AirFryer 158 for those who want to test and help with development on HA
https://github.com/vlebourl/custom_vesync/pull/175
or for anyone who wants to follow
https://github.com/tv4you2016/custom_vesync/tree/feature/airfryer
I bring news for those who have an AirFryer 158 for those who want to test and help with development on HA
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'
Hello @Scope666
Can you share your device with me to do some testing?
email: tv4you2016@gmail.com
I bring news for those who have an AirFryer 158 for those who want to test and help with development on HA
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
@Subia75 Hello, how do you install it? manual mode or through -HACS
@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.
@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
https://github.com/vlebourl/custom_vesync/pull/175
Or go to my repository and download it and put it in the folder custom_components/vesync
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?
it automatically associates if there is an airfryer of the following models 'models': ['CS137-AF/CS158-AF', 'CS158-AF', 'CS137-AF', 'CS358-AF'],
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.
Thank you
It’s working :) On 24 Oct 2023 at 19:39 +0100, Alessio @.***>, wrote:
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 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
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.
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.
@KyleStilkey Can you share your device with me to do some testing?
email: tv4you2016@gmail.com
@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?
@tv4you2016 Is the CAF-P583S supposed to be supported? Tried it but doesn't show any devices
@pvieira84 the update is every 30 seconds model suported: ['CS137-AF/CS158-AF', 'CS158-AF', 'CS137-AF', 'CS358-AF'],
@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.
@KyleStilkey add me in discord [PT]GOODVIBE[PT]#1314
@KyleStilkey add me in discord [PT]GOODVIBE[PT]#1314
Sent
@KyleStilkey try my last commit https://github.com/tv4you2016/custom_vesync/tree/feature/airfryer
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.