I did manage to make some progress thanks to @MDinHeaven and huangyq23. I am documenting here the steps I took, hoping that someone will be able to help me with what I am missing.
-
Get the tokens (access token, refresh token) from Chrome local storage. Authenticate to https://oven.anovaculinary.com , F12, Application > Storage > IndexedDB > firebaseLocalStorageDB > firebaseLocalStorage > value > stsTokenManager > accessToken
I was unable to copy directly from Chrome’s DevTools, so I used an extension ( IndexedDBEdit ).
-
You should be able to use the access token directly. Or, if it expires, you can get a new access token using the refresh token (docs here):
curl 'https://securetoken.googleapis.com/v1/token?key=[API_KEY]' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data 'grant_type=refresh_token&refresh_token=[REFRESH_TOKEN]'
(both the API key and the refresh token are also stored in Chrome’s local storage)
Now, I am trying to use the API documented by @mcolyer:
-
Connect to wss://app.oven.anovaculinary.io
. Using postman, or an online WSS tester like Online Websockets Tester - Debug Client Tool
-
Send the authentication message:
{
"command": "AUTH_TOKEN",
"payload": "[ID_TOKEN]"
}
[ No comma at the end, before }
- the API seems to have problems if we keep that comma! ]
The token is correct, I am getting back a
{"response":"AUTH_TOKEN_RESPONSE"}
However, I am also getting a {"response":"OVEN_COMMAND_RESPONSE","requestId":"xyz","deviceId":"anova0123456789","success":false,"error":"12 UNIMPLEMENTED: Method not found."}
The WSS connection stays up (so authentication does seem to be successful), but I cannot get any further. There are no periodic messages from the oven, and if I try to send a command like this:
{
"command": "SEND_OVEN_COMMAND",
"payload": {
"deviceId": "anova0123456789",
"command": {
"id": "001a",
"type": "stopCook"
},
"requestId": "01a"
}
}
I get the same
"success":false,"error":"12 UNIMPLEMENTED: Method not found."}
If anybody knows what I am missing, please let me know…