So pyscript.airfryer_token stays empty and there’s no pyscript.airfryer_status?
Have you checked that you can ping the Airfryer IP you entered in airfryer.py from your HA server? (you can do over the terminal addon or create a ping sensor)
i try to uninstall and reinstall pyscript and now i have some error:
2024-02-03 17:32:50.603 ERROR (MainThread) [custom_components.pyscript.file.airfryer.airfryer_sensors_update] Exception in <file.airfryer.airfryer_sensors_update> line 74:
response = get_status(pyscript.airfryer_token)
^
Error: Invalid base64-encoded string: number of data characters (21) cannot be 1 more than a multiple of 4
That’s because the state of the airfryer_token is “m”. That shouldn’t be there. Just click on the blue entity name, then “set state” opens where you can empty the state again. That should remove that error.
Are you using the correct endpoint (command_url)? It should be the one with “airfryer” in your case.
Now I was able replicated the error: It happens when the letter count of client_id and/or client_secret is wrong. You should check that you entered them correctly.
Created descriptions and selectors for all services
Added new services (Adjust Time, Adjust Temp)
Optimized existing services
Optimized the frontend card to be usable if you don’t have Airspeed or Temp Probe
Additionally I added the guide how to get the secrets to the Gist
Since English is obviously not my native language, I would be happy if you let me know if you find anything wrong or misleading in the descriptions (preferably by DM to avoid further spamming the thread here)
I think I fixed the crashing issue by making sure, that no two services are running in parallel. In the past it was possible to call a service like “airfryer_start_cooking” while in the background the sensors get updated. Now, depending on who’s first, either your service_call (for example “airfryer_start_cooking”) gets delayed a little bit or the sensor update is skipped once.
I also moved the code from Github Gists to a new repository:
For everybody who is trying to get their API Key and can’t succeed.
I use a debugging Proxy - like Charles - to record all the traffic between the NutriU App on my phone and the servers. You need to turn on SSL proxy and force-quite the app before, so that it’s logging in again to the server. During this process the app get the API Key for your Airfryer.
As I mentioned earlier in a post, I tried to mimic the login process in order to receive the API key outside of the app, but I got stuck there. Maybe someone has the time to further dig into it.
My integration with Airfryer HD9285 stopped working in HA so I started investigating. I wasn’t able to call the endpoints from Postman using valid Authorization header so I turned on the VM to double check if my client id/secret are valid. I discovered that my client secret has changed! I am suspecting that this might have happened when I enabled remote control in the app on my phone. There are also some other changes in the database. So keep an eye for this, maybe you will confirm when can the secret change.
I wrote a cloud implementation for nutriu for ioBroker maybe someone can test it.
I have still some issue with the mqtt cloud connection
But I can easily read client id and secret maybe I can join the local connection
i have air fryer HD928X and with your configuration don’t work, I have a client id and client secret, the integration generate a token but no value from sensor, if I try with a curl request using token generator for the integration I receive 401 response.