Skip to main content

pyhearth - A Python client for Hearth's home API

Version Python Versions Coverage Build GitHub License

pyhearth is a Python client for Hearth's home API. It posts thermostat and/or room sensor readings to a Hearth home with the home's API key, and returns the thermostat setting Hearth answers with. It's what ha-hearth, Hearth's Home Assistant integration, uses to talk to Hearth.

Download on the App Store   Get it on Google Play

Support on Patreon

Installation

pyhearth is available on PyPI and can be installed using pip:

pip install pyhearth

Basic Usage

In the Hearth app, create the home's API key in Settings, then Manage home, then Sensors, then "Other sensors (Hearth API)". Then post readings:

import asyncio

import aiohttp

from pyhearth.client import HearthClient


async def main():
    async with aiohttp.ClientSession() as session:
        client = HearthClient(session, "<your API key>", source="my-hub", source_name="My hub")
        result = await client.post_readings([
            {"id": "office", "name": "Office", "temperature": 20.8, "humidity": 41}
        ])
        print(result.not_added)


asyncio.run(main())

A sensor's readings are kept once it's added to a room in the Hearth app; until then, it's listed in not_added. The fields each endpoint takes are in Hearth's API docs.

Errors are raised as subclasses of HearthError (in pyhearth.exception): HearthAuthError when Hearth doesn't take the key, HearthRateLimitedError when it asks for fewer posts (meta["retry_after"] says how many seconds to wait), HearthRejectedError when it can't read a post, and HearthConnectionError when it can't be reached.

Contributing

If you would like to get involved, be sure to review the Contribution Guide.

Want to contribute financially? If you've found pyhearth useful, sponsorship would also be greatly appreciated!

Metadata

Release files for pyhearth 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyhearth 1.1.3
File Size Uploaded Provenance Actions
pyhearth-1.1.3.tar.gz 9.7 kB With provenance Details for pyhearth-1.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyhearth 1.1.3
File Interpreter ABI Platform Actions
pyhearth-1.1.3-py3-none-any.whl Python 3 none any Details for pyhearth-1.1.3-py3-none-any.whl

Total release size: 17.2 kB

Release files / pyhearth-1.1.3.tar.gz

Download URL pyhearth-1.1.3.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
baa422e60ab1352ac93eed29b8aadbf5ebe6a60defcba589b116abbf8e7d5c5d
BLAKE2b-256 checksum
How to use checksums
38ee5cc2bd222db60a63bd72850483de70e3fbec45258311365ef6318ea434f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / pyhearth-1.1.3-py3-none-any.whl

Download URL pyhearth-1.1.3-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5682ef21083c6fa604c47f5f3988ca5b6905c8a4b0a386397ff89380e91086ba
BLAKE2b-256 checksum
How to use checksums
4cce3480d4e5b8b749e22d3e082c8c1f402a085719da2a2b0c3702555bd5f736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for pyhearth 1.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyhearth-1.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page