Skip to content

Instantly share code, notes, and snippets.

@crixle
Created March 2, 2024 23:34
Show Gist options
  • Save crixle/12c4836712a40c9a7f656480df9634f5 to your computer and use it in GitHub Desktop.
Save crixle/12c4836712a40c9a7f656480df9634f5 to your computer and use it in GitHub Desktop.
Tovala Smart Oven API - Load Recipe POST
# You must get your user token, API key, and your smart oven ID for this to work.
# On Chrome, inspect the network traffic when logging into your account. You'll see a response in the log with a 7-digit number.
# Mine started with 120****
# This is your USER ID!
# Next, check the authorization headers for your key. Will start with "Bearer " and be very long.
# I'm unsure how to find your Oven ID through their website, but I was able to retrieve mine by using HTTP Toolkit on a rooted Android.
# Next you'll need to know the barcode of the item you wish to prepare.
# All Tovala-curated meals are in this format ASSIST-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
# Supported grocery store items will be their regular UPC code that you scan at the store.
# Here are some Tovala-curated codes to get you started
# Chicken: ASSIST-59A541D4-6052-4A2F-8DE6-F959672E19C4
# Bacon: ASSIST-DA21F8FD-15EA-4DFA-8EE7-9717CD29FF34
# Toast + 2 Eggs: ASSIST-1521F8B2-E64B-4EE8-AFE8-157F07B0E7E3
# I added a shell command to Home Assistant with this cURL command:
# curl --location --request POST 'https://api.beta.tovala.com/v1/users/[USER ID]/ovens/[OVEN ID]/cook/start' --header 'Content-Type: application/json' --header 'Authorization: Bearer [YOUR TOKEN]' --data-raw '{"barcode": "ASSIST-DA21F8FD-15EA-4DFA-8EE7-9717CD29FF34"}'
# Then created a script that calls the newly created service and exposed the script to Google Assistant.
# Then made a custom routine that activates the script when I say, "Hey Google, cook bacon"
#! Make sure you replace the USER ID, TOKEN, and OVEN ID when running these commands with your own values.
import requests
import json
url = "https://api.beta.tovala.com/v1/users/[USER ID]/ovens/[OVEN ID]/cook/start"
payload = json.dumps({
"barcode": "ASSIST-DA21F8FD-15EA-4DFA-8EE7-9717CD29FF34" # Bacon
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer [YOUR TOKEN]'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment