Skip to main content

Simple API to interact with the Traeger-Grill API

Project description

PyTraeger

This Project enables Traeger Grill Monitoring. For my Use-Case a Grafana Dashboard utilizes a PostgreSQL Database (demo/example02.py).

This lib does 3 things.

  1. It initiates authentication with AWS
  2. It starts the MQTT-Client (thread 1)
  3. It polls for updates (thread 2)
  4. It dies after 2 hours as i havent had time to implement accesstoken reneval yet

Usage in a Nutshell:

-- DEMO 1 --
from pytraeger.manager import Manager as TraegerManager

def call_me(event_grill):
    _LOGGER.info("Message from %s. Grill: %-5s | Probe: %-5s",
                    event_grill.identifier,
                    event_grill.data['status']['grill'],event_grill.data['status']['probe'] )


a = TraegerManager(interval_idle=10, interval_busy=5)
for grill in a.api.grills:
    grill.register_listener(call_me)

Getting Started

Fill the environmentfile.

cat .devcontainer/devcontainer.env 
PYTRAEGER_PASSWORD=xxx
PYTRAEGER_USERNAME=xxx

# Optional for DB. Enabled in Dockerfile
PGHOST=xxx
PGUSER=xxx
PGPASSWORD=xxx
$ docker build . -t traegertest
$ docker run --env-file .devcontainer/devcontainer.env  traegertest
2023-08-04 20:00:31,474 - root - INFO - Debugging of API
2023-08-04 20:00:37,449 - root - INFO - Message from XXXXXXXXX. Grill: 35    | Probe: 37
2023-08-04 20:00:42,569 - root - INFO - Message from XXXXXXXXX. Grill: 35    | Probe: 37

Known Issues:

  • EMail-Login is case sensitive
  • Accesstoken reneval is not implemented.
  • The Watchdog
  • DB-Usecase doesnt clean up

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

pytraeger-0.4.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

pytraeger-0.4-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pytraeger-0.4.tar.gz.

File metadata

  • Download URL: pytraeger-0.4.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pytraeger-0.4.tar.gz
Algorithm Hash digest
SHA256 d7aa2d48911bec4d476e3772f5b768f833d0bad8a514d392374f0ce35649bae1
MD5 d75e173780d4314f03e742b7524e7e0d
BLAKE2b-256 05386363efaf01c431cdeeffcfad9d87a485056439c5adec17f6d70d87d88d0d

See more details on using hashes here.

File details

Details for the file pytraeger-0.4-py3-none-any.whl.

File metadata

  • Download URL: pytraeger-0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for pytraeger-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2403231fbd3d451ed1aa855f71ba2b7f2b7bccfd5bb8ea1588226cc98b82cbcb
MD5 d7b77fc87dfac04b0036ba4c661192f2
BLAKE2b-256 adc6922fa5b49d4545df22a270442224b2d79883e044cb0a50b689c76c1b498c

See more details on using hashes here.

Supported by

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