Skip to main content

Python SDK for Anova Precision Oven

Project description

⚠️ Disclaimer

This software is provided "as is" without warranty of any kind, express or implied. The authors and contributors are not liable for any damages, losses, or issues arising from the use of this software, including but not limited to:

  • Device malfunction or damage
  • Property damage
  • Food safety issues
  • Data loss
  • Service interruptions

Use at your own risk. Always supervise cooking operations and follow manufacturer guidelines for your Anova Precision Oven. This is unofficial software not endorsed by Anova Culinary.

Anova Precision Oven Python SDK

Python SDK for controlling Anova Precision Ovens using the official Anova API(https://developer.anovaculinary.com/docs/devices/wifi/oven-commands). The final goal of this project is to create an integration for Home Assistant which leverages this SDK for operation. The majority of this code was written using Anthropic Claude(https://claude.ai)

Installation

# Using pip
pip install .

Quick Start

1. Create configuration files

Create settings.yaml:

default:
  log_level: INFO
  supported_accessories:
    - APO

Create .secrets.yaml (add to .gitignore):

default:
  token: "anova-your-token-here"

Or use environment variables:

export ANOVA_TOKEN="anova-your-token-here"

2. Basic usage

from anova_oven_sdk import AnovaOven
from anova_oven_sdk import CookingPresets

async def main():
    async with AnovaOven() as oven:
        # Discover devices
        devices = await oven.discover_devices()
        device_id = devices[0].id
        
        # Simple roast
        await oven.start_cook(
            device_id=device_id,
            temperature=200,
            duration=1800  # 30 minutes
        )
        
        # Or use presets
        await CookingPresets.roast(
            oven, device_id,
            temperature=200,
            duration_minutes=30
        )

import asyncio
asyncio.run(main())

Environment Management

Switch environments using ANOVA_ENV:

# Development (debug logging, more retries)
export ANOVA_ENV=development
python your_script.py

# Production (warning logging, optimized)
export ANOVA_ENV=production
python your_script.py

CLI Usage

# Discover devices
python anova_oven_cli.py discover

# Start cooking
python anova_oven_cli.py cook --device DEVICE_ID --temp 200 --duration 30

# Stop cooking
python anova_oven_cli.py stop --device DEVICE_ID

# Run example
python anova_oven_cli.py example --env development

Advanced Usage

Multi-stage cooking

from anova_oven_sdk import (
    AnovaOven, CookStage, Temperature, Timer,
    SteamSettings, SteamMode, HeatingElements,
    TemperatureMode, TimerStartType
)

async with AnovaOven() as oven:
    devices = await oven.discover_devices()
    
    # Sous vide then sear
    stages = [
        CookStage(
            temperature=Temperature.from_celsius(60),
            mode=TemperatureMode.WET,
            timer=Timer(initial=3600),
            steam=SteamSettings(
                mode=SteamMode.STEAM_PERCENTAGE,
                steam_percentage=100
            ),
            title="Sous Vide"
        ),
        CookStage(
            temperature=Temperature.from_celsius(250),
            timer=Timer(
                initial=300,
                start_type=TimerStartType.WHEN_PREHEATED
            ),
            heating_elements=HeatingElements(
                top=True,
                bottom=True,
                rear=False
            ),
            title="Sear"
        )
    ]
    
    await oven.start_cook(devices[0].id, stages=stages)

Configuration Reference

See settings.yaml for all available configuration options:

  • WebSocket settings (timeout, retries)
  • Logging configuration (level, file, rotation)
  • Environment-specific overrides
  • Feature flags

Pydantic Validation

All models are validated automatically:

from anova_oven_sdk import Temperature, HeatingElements

# Automatic validation
temp = Temperature(celsius=200)  # ✓ Valid
# temp = Temperature(celsius=-300)  # ✗ ValidationError

# Heating elements validation
heating = HeatingElements(rear=True)  # ✓ Valid
# heating = HeatingElements(top=True, bottom=True, rear=True)  # ✗ ValidationError

Cooking Presets

Available presets:

  • roast() - High heat roasting
  • steam() - Steam cooking
  • sous_vide() - Precise temperature control
  • bake() - Conventional baking
  • dehydrate() - Bread proofing
  • toast_v1_oven() - Replicate the Anova v1 Toast Recipe

Error Handling

from anova_oven_sdk import (
    AnovaOven, ConfigurationError,
    DeviceNotFoundError
)

try:
    async with AnovaOven() as oven:
        devices = await oven.discover_devices()
        await oven.start_cook(devices[0].id, temperature=200)
        
except ConfigurationError as e:
    print(f"Config error: {e}")
except DeviceNotFoundError as e:
    print(f"Device not found: {e}")
except ValueError as e:
    print(f"Invalid parameters: {e}")

Testing

import pytest
from anova_oven_sdk import Temperature, CookStage, HeatingElements, AnovaOven

def test_temperature_validation():
    temp = Temperature.from_celsius(200)
    assert temp.celsius == 200
    assert temp.fahrenheit == 392

def test_heating_elements_validation():
    # Valid configuration
    heating = HeatingElements(rear=True)
    assert heating.rear is True
    
    # Invalid - all elements
    with pytest.raises(ValueError):
        HeatingElements(top=True, bottom=True, rear=True)

@pytest.mark.asyncio
async def test_oven_connection():
    async with AnovaOven() as oven:
        devices = await oven.discover_devices()
        assert len(devices) > 0

Project Structure

anova-oven-project/
├── settings.yaml         # Main configuration
├── .secrets.yaml         # Secrets (gitignored)
├── .env                  # Environment variables (gitignored)
├── .gitignore            # Git ignore file
├── pyproject.toml        # Project configuration
├── anova_oven_cli.py     # Anova SDK Command-line Interface(CLI)
├── logs/                 # Log files (gitignored)
│   ├── anova_dev.log
│   └── anova_prod.log
└── tests/                # Test files
    ├── __init__.py
    ├── conftest.py
    └── test_client.py
    └── test_commands.py
    └── test_exceptions.py
    └── test_logging_config.py
    └── test_models.py
    └── test_oven_part1.py
    └── test_oven_part2.py
    └── test_presets.py
    └── test_settings.py
    └── test_utils.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anova_precision_oven_sdk-2025.11.0.tar.gz (50.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anova_precision_oven_sdk-2025.11.0-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file anova_precision_oven_sdk-2025.11.0.tar.gz.

File metadata

File hashes

Hashes for anova_precision_oven_sdk-2025.11.0.tar.gz
Algorithm Hash digest
SHA256 1581a60ba2c87516bc618c53c9a1e97abbb71c58d9d1bcc9686ce75426c516a1
MD5 7de0834ecb166830ef3fdd5413165be8
BLAKE2b-256 0bd28723c7c92b1983f1e64dea400488e1c0b00aa95bd923552f3e52a960479e

See more details on using hashes here.

File details

Details for the file anova_precision_oven_sdk-2025.11.0-py3-none-any.whl.

File metadata

File hashes

Hashes for anova_precision_oven_sdk-2025.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abb5708c0273ed619ea8df16a07b504a88eca8612c8e2090a8c3d2858a8c872e
MD5 712b677e13ab226aeb615770f089bd1f
BLAKE2b-256 7b7d6063f3177f87b9ebf2fe4364faa334f447e0fc54808223abcb14e74b2d8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page