As I was shopping for an AirFryer, I checked Home Assistant at the same time, glad to see so fresh posts!
By any chance, do you plan on releasing your code as a HACS friendly package?
I don’t think that it is possible to distribute scripts for Pyscript via HACS and my coding skills aren’t good enough to create a real integration.
Also, please be aware that this is a highly experimental project - more of a gap filler until someone comes along and creates a proper integration
By the way: In the next few days I will probably release a new version with some optimizations and new service calls.
in which way you obtain an api key for this request??
i have tryed the way with android x86 but in ths way Nutriu dont show login page.
Your project is amazing, any idea for the api key?
thanks
p.s.: now i can login with nutriu on androird x86, i see my airfryer, but i cant connect, and i try to open db file clientid an secret is empty
You can see the airfryer in NutriU because it’s registered in your account - it doesn’t mean that the app can really “see” it.
- Are you sure that both your Android x86 and the airfryer have internet connection?
- Are they running in the same network/subnet, so they can see each other locally? (don’t know if this is needed, but it could be needed for the first connection)
- Did you use a “Man-in-the-middle attack” to capture the traffic before? After that you might need to go in the device settings in NutriU (possibly multiple times) until you get a warning that something has changed and if you really want to connect the device.
Android x86 can ping the airfryer and are in the same network connected to internet
i dont understand the last point, i dont use a “Man-in-the-middle attack” , which is the scope of this procedure? how i can try this?
That’s weird. Sadly I don’t have a solution for that.
You don’t need to do a man-in-the-middle attack - I just mentioned it, because if you did sniff the traffic of the air fryer before, then you might have temporary connection problems because of that. If you didn’t sniff the traffic before, you can ignore that.
i can try the other way, i need to know how obtain the apikey to use in the curl request
I have the same problem as you @italoc, ended up with the app showing airfryer in the appliances but it’s not connected (I have the android VM and airfryer in different networks but both have Internet access). At the same time, the airfryer is connected when I check on my phone (connected only to mobile Internet). @nicohirsch which exact version of philips app were you using to obtain the secrets? Maybe you would be willing to try it again just to double check it still works for you?
I’ve tried again now: Before that I’ve updated to the newest version 7.28.1 via Google Playstore. Then I deleted cache and storage for the app, logged in again and connected to the airfryer. Everything worked fine for me - even though I’ve blocked the internet connection for the Airfryer since I don’t want it to install updates which might break things.
I also found another SQLite Editor which makes finding the secrets easier (after connecting, of course). I’ve updated my post above: Philips Airfryer & NutriU Integration (Alexa only)? - #17 by nicohirsch
I’ve just updated the pyscript code and the frontend card - in the hope that someone else will get hold of the client secrets, too.
Some of the changes:
- More settings that should make it easier to use this projects with other devices (for example you can now disable airspeed and temp probe if you don’t have these)
- More services (look for “@service” in the code to get a list)
- Updated frontend card with better countdown timer (maybe not compatible with devices without airspeed / temp probe. Another update will follow)
Everything is tested on my HD9880/90 - I don’t have any other airfryer to test.
Known problem: If you disable Internet access for the Airfryer, it loses the time (at least if it has had no power in the meantime). In this case, the time calculation for the frontend card no longer works.
i have the same versione of the app Nutriu 7.28.1, but nothing always say no connection
Did you install it via the APK or Google Play Store? I installed it via the Play Store and updated everything else, too. Maybe some system app like for expample Android System WebView - which NutriU might depend - on needs an update. But I’m just guessing …
Via Google Play Store, which version of Android x86 you use? i have installed Android-x86 9.0-R2 Pie
I used the same version, but 64bit (in case you hadn’t just left out that detail):
android-x86_64-9.0-r2.iso
I use this versione with vmware format
if i try to install directly with iso after installation, the OS stay in console mode
I have just tried this, but didn’t get very far. Chrome had display problems for me, so that the login page, among other things, could not be displayed.
I would recommend trying to boot Android x86 directly from a USB stick - without a virtual machine. Maybe that will help with the connection problems.
If you have a Proxmox Server for your HA instance, you can also install it there. That’s what I did.
Thank you @nicohirsch for double checking. I did another test and now it works for me too. This time my VM was running on my desktop in the same network as the airfryer, so this might be important for the first-time connection not to have them in separate network, even if both have Internet access.
With native boot from usb works, but in sqllite editor i have found client id, but no client secret, it the latest columns of the db? have another name?
Strange … no it’s still called client_secret. In my case the last three columns are client_id, client_secret & hsdpid (that you can ignore).
ok now i have client id an client secret, but i have this error
2024-02-02 23:44:08.505 ERROR (MainThread) [custom_components.pyscript.file.airfryer.airfryer_sensors_update] Exception in <file.airfryer.airfryer_sensors_update> line 52:
response = get_status(pyscript.airfryer_token)
^
NameError: name ‘pyscript.airfryer_token’ is not defined
i have airfryer HD928X