Skip to main content

Thermia Online API

A Python API for Thermia heat pumps using https://online.thermia.se

Confirmed Thermia models that API supports:

It is hard for me to keep track of all models that I have added feature support for in the past, so, to understand if your model is supported, please try running the example file and see if it works. If it does not, please submit a bug report.

Regarding unsupported models

I am willing to do my best to support them, but as there turns out to be many different Thermia models and configurations, it is hard for me to implement all functionalities and test them thoroughly. Thus, I have created a debug() function that runs when example.py is executed and creates a debug.txt file which has data about your heat pump and all its supported features. If you want to submit a bug or feature request, please include the debug file as it will make my development much easier.

Common issues

Logging in throws an error

Sometimes Thermia updates their privacy policy which causes the Thermia API to throw errors when logging in. To fix the issue, please visit https://online.thermia.se, log in, accept the privacy agreement and then try using the API again to see if it has fixed the issue. If not, please create a new bug report.

How to use api:

See example.py file for examples.

To execute the example file, first run pip install -r requirements.txt to install the required dependencies, then run python3 example.py to execute the example file. You will be prompted to enter your username and password, and then the example file will run. If do not want to manually enter your credentials every time, you can make a copy of .env.example, save it as a .env file, and add your credentials there.

Available functions in Thermia class:

Function Description
fetch_heat_pumps() Fetches all heat pumps from Thermia Online API and their data
update_data() Updates all heat pump data

Available properties within ThermiaHeatPump class:

Property Description
name Name of the Heat Pump
id Unique ID of the Heat Pump Thermia generates
is_online Boolean value indicating if the Heat Pump is online or not
model Model of the Heat Pump
last_online DateTime string indicating the last time the Heat Pump was online
has_indoor_temperature_sensor Boolean value indicating if the Heat Pump has an indoor temperature sensor
indoor_temperature Indoor temperature in Celsius, if has_indoor_temperature_sensor is False, this value is the same as heat_temperature
is_outdoor_temp_sensor_functioning Boolean value indicating if the Heat Pump has an outdoor temperature sensor
outdoor_temperature Outdoor temperature in Celsius
is_hot_water_active Boolean value indicating if the Heat Pump is heating water
hot_water_temperature Hot water temperature in Celsius
heat_temperature Heat Pump heating target temperature in Celsius
heat_min_temperature_value Minimum temperature value possible for Heat Pump to set
heat_max_temperature_value Maximum temperature value possible for Heat Pump to set
heat_temperature_step Step value for temperature setting
--- ---
Other temperatures
supply_line_temperature Supply line temperature in Celsius
buffer_tank_temperature Buffer tank temperature in Celsius
desired_supply_line_temperature Desired supply line temperature in Celsius
return_line_temperature Return line temperature in Celsius
brine_out_temperature Brine out temperature in Celsius
brine_in_temperature Brine in temperature in Celsius
cooling_tank_temperature Cooling tank temperature in Celsius
cooling_supply_line_temperature Cooling supply line temperature in Celsius
--- ---
Operational status
running_operational_statuses List of running operational statuses of the Heat Pump
available_operational_statuses List of available operational statuses
available_operational_statuses_map Dictionary mapping operational status names to their values
running_power_statuses List of running power statuses of the Heat Pump
available_power_statuses List of available power statuses
available_power_statuses_map Dictionary mapping power status names to their values
operational_status_integral Integral
operational_status_pid PID
--- ---
Operational Times
compressor_operational_time Compressor operational time in hours
heating_operation_time Heating operational time in hours
hot_water_operational_time Hot water operational time in hours
auxiliary_heater_1_operational_time Auxiliary heater 1 operational time in hours
auxiliary_heater_2_operational_time Auxiliary heater 2 operational time in hours
auxiliary_heater_3_operational_time Auxiliary heater 3 operational time in hours
--- ---
Alarms data
active_alarm_count Number of active alarms on the Heat Pump
active_alarms List of titles of active alarms on the Heat Pump
--- ---
Operation Mode data
operation_mode Current operation mode of the Heat Pump
available_operation_modes List of available operation modes for the Heat Pump
available_operation_mode_map Dictionary mapping operation mode names to their values
is_operation_mode_read_only Boolean value indicating if the Heat Pump operation mode is read-only
--- ---
Hot Water data
hot_water_switch_state Int value indicating the Heat Pump hot water switch state (0 or 1) or None if not available
hot_water_boost_switch_state Int value indicating the Heat Pump hot water boost switch state (0 or 1) or None if not available
--- ---
Historical data
historical_data_registers List of available registers to use for historical data fetching

Available functions within ThermiaHeatPump class:

Function Description
update_data() Refetch all data from Thermia for Heat Pump
--- ---
get_all_available_register_groups() Return a list of all available register groups for the heat pump
get_available_registers_for_group(register_group) Return a list of all available registers for specified register group
get_register_data_by_register_group_and_name(register_group, register_name) Return data for specified register group and name
set_register_data_by_register_group_and_name(register_group, register_name, value) Set register value for specified register group and name
--- ---
Change heat pump state
set_temperature() Set the target temperature for the Heat Pump
set_operation_mode() Set the operation mode for the Heat Pump
set_hot_water_switch_state() Set the hot water switch state to 0 (off) or 1 (on) for the Heat Pump
set_hot_water_boost_switch_state() Set the hot water boost switch state to 0 (off) or 1 (on) for the Heat Pump
--- ---
Fetch historical data
get_historical_data_for_register() Fetch historical data by using register name from historical_data_registers together with start_time and end_time of the data in Python datatime format. Returns list of dictionaries which contains data in format { "time": datetime, "value": int }
--- ---
Fetch debug data
debug() Fetch debug data from Thermia API and save it to debug.txt file

Checking against the Thermia Online web app

The web app at https://online.thermia.se reads the same registers as this library, and its code is public: no login is needed to download it. Only register values need an account. To compare how the library and the web app decode register data:

  • python scripts/fetch_thermia_web_app.py saves the web app's HTML, configuration and JavaScript to .thermia-web/ to search through.
  • PYTHONPATH=. python scripts/compare_operational_status_with_web.py [debug_file ...] decodes every operational status value with the library and with the web app's rule, and lists where they disagree. With no arguments it uses the debug files in ThermiaOnlineAPI/tests/debug_files. It needs pip install -r requirements_testing.txt.

Metadata

Release files for ThermiaOnlineAPI 6.3.2

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

Source distribution (sdist)

Source distribution for ThermiaOnlineAPI 6.3.2
File Size Uploaded Provenance Actions
thermiaonlineapi-6.3.2.tar.gz 30.4 kB Without provenance Details for thermiaonlineapi-6.3.2.tar.gz

Built distribution (wheel)

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

Total release size: 60.2 kB

Release files / thermiaonlineapi-6.3.2.tar.gz

Download URL thermiaonlineapi-6.3.2.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ae566128158531e2336494ba03b17f363fa541728c327970ba508217ca8ef61b
BLAKE2b-256 checksum
How to use checksums
d7b811297ad3c5addbc9ce077ce7e54d71d2f3fe84f197942117c2ff89f4cd08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / thermiaonlineapi-6.3.2-py3-none-any.whl

Download URL thermiaonlineapi-6.3.2-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bc007868a9fd9a075f324f2649373d6e483384e2d96dc00d30a4db8c51df893
BLAKE2b-256 checksum
How to use checksums
e421aa32ce6ca3c5b63a45d8612c0890a91b5f5a2ca9926b11c4d05548cd1300
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for ThermiaOnlineAPI 6.3.2

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.

Release history Release notifications | RSS feed

This release

6.3.2 This release

2 release files No provenance

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