Skip to main content

netatmo-energy

Setup

  1. Create an app at dev.netatmo.com to get your API credentials
  2. Either create a .env file:
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
ACCESS_TOKEN=your_access_token
REFRESH_TOKEN=your_refresh_token

of pass in the vars to Thermostat(client_id, client_secret, access_token, refresh_token) when initializing the API client.

Usage

t = Thermostat()
hd = t.homesdata()
home_id = hd.homes[0].id
room_id = hd.homes[0].rooms[0].id

# Get current status
t.room_temperatures(home_id)
[{'room_id': '3352988001',
  'temperature': 21.7,
  'setpoint': 21.5,
  'setpoint_mode': 'manual'}]
# Set room to 20°C for 1 hour
t.setroomthermpoint(home_id, room_id, mode='manual', temp=21, endtime=int(time())+3600)
{'status': 'ok', 'time_server': 1767753063}
t.room_temperatures(home_id)
[{'room_id': '3352988001',
  'temperature': 21.7,
  'setpoint': 21,
  'setpoint_mode': 'manual'}]
# Get temperature history
r = t.getroommeasure(home_id, room_id)[0]
list(r), r['value'][:3]
(['beg_time', 'step_time', 'value'], [[22.2], [22.2], [22.1]])

Methods

  • homesdata() — get homes and topology
  • homestatus(home_id) — current device status
  • room_temperatures(home_id) — quick view of all room temps
  • getroommeasure(home_id, room_id, ...) — temperature history
  • setroomthermpoint(home_id, room_id, mode, ...) — set room temperature
  • setthermmode(home_id, mode) — set home mode (schedule/away/hg)
  • getmeasure(device_id, ...) — boiler history
  • createnewhomeschedule(...) — create weekly schedule
  • synchomeschedule(...) — modify schedule
  • switchhomeschedule(home_id, schedule_id) — activate schedule

Thermostat Widget

The library includes a ready-to-use FastHTML/MonsterUI thermostat widget for building web dashboards. Use setup_thermostat_widget() to register the routes and get the widget component:

app, rt = fast_app()
t = Thermostat()

# Get your home and room IDs
homes = t.homesdata()
home_id = homes.homes[0].id
room_id = homes.homes[0].rooms[0].id

# Setup widget (registers /setpoint route and returns the component)
climate_widget = setup_thermostat_widget(rt, t, home_id, room_id)

@rt("/")
def get():
    return climate_widget

Thermostat Widget

The widget displays current temperature, target setpoint with +/- controls, and a temperature history chart. Clicking the controls makes HTMX requests to adjust the thermostat in real-time.

Note: the widget uses MonsterUI’s ApexCharts so you will have to include this in your headers Theme.blue.headers(apex_charts=True)

Dashboard

The main.py file includes a fully functional dashboard app with Google OAuth authentication, ready to be deployed. The solar energy widget is a placeholder—only the climate/thermostat functionality is connected to the Netatmo API.

Deployment was done using pla.sh and is documented in the nbs/00_core.ipynb notebook.

Dashboard

The house thumbnail was generated by copy-pasting a Google Maps screenshot into Gemini Nano Banana with this prompt:

Present a clear, 45° top-down isometric miniature 3D cartoon scene of [LOCATION], featuring its most iconic landmarks and architectural elements. Use soft, refined textures with realistic PBR materials and gentle, lifelike lighting and shadows. Integrate the current weather conditions directly into the city environment to create an immersive atmospheric mood. Use a clean, minimalistic composition with a soft, solid-colored background.

Background

Inspired by Andrej Karpathy’s tweet about using Claude Code for home automation. Instead of burning tokens on network scanning, this takes the “boring” approach: read the docs, write a simple SDK.

Metadata

Release files for netatmo-thermostat 0.0.4

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

Source distribution (sdist)

Source distribution for netatmo-thermostat 0.0.4
File Size Uploaded Provenance
netatmo_thermostat-0.0.4.tar.gz 23.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for netatmo-thermostat 0.0.4
File Interpreter ABI Platform
netatmo_thermostat-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 45.2 kB

Release files / netatmo_thermostat-0.0.4.tar.gz

Download URL netatmo_thermostat-0.0.4.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5013a69701d64e7ab8b114404e98227e33c0529cd4394ed8a7bf2a6c7b386554
BLAKE2b-256 checksum
How to use checksums
f78619c97b4c65b030cebc9437e787c42c349d702909fa0998a23e1509fb02d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / netatmo_thermostat-0.0.4-py3-none-any.whl

Download URL netatmo_thermostat-0.0.4-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
769cdb0653643bc5a41adb4814c5e8edd3e2125190011c7df1eff391b8cdb903
BLAKE2b-256 checksum
How to use checksums
95d5cbaf1560feedde9831c4cc39ef856ec9fd4f77551e826479e3ef5d97fb2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for netatmo-thermostat 0.0.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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