Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

vtherm-api

Latest version: v0.13.1

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
PyPI package Publisher: jmcollin78
3 Stars
6 Forks
9 Versions
65.6K Downloads
Python Repo language

Scan summary

vtherm-api was last scanned on 23 Nov 2026 at version 0.13.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 9 versions; the latest 3 were published within 5 days (19–23 Nov 2026).
  • Findings: No rules fired in version 0.13.1.
  • Downloads: 65,629 downloads.

Versions

9 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.13.1 LATEST 23 Nov 2026 No rules fired
0.12.0 23 Nov 2026 No rules fired
0.11.0 19 Nov 2026 No rules fired
0.9.0 9 Nov 2026 Not shown
0.8.0 31 Oct 2026 Not shown

No rules fired in 0.13.1

Findings

Findings for v0.13.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.13.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

vtherm_api

Developer-facing API for integrating with Versatile Thermostat inside Home Assistant.

This package currently exposes two main building blocks:

  • VThermAPI: a singleton stored in hass.data that gives an integration access to the Home Assistant runtime, the proportional algorithm registry, feature-manager registration, and optional plugin-climate linking helpers.
  • PluginClimate: an event-driven helper that subscribes to Versatile Thermostat events for one linked thermostat and forwards service calls back to that thermostat.
  • A proportional algorithm plugin surface: runtime protocols plus a registry that lets an external integration register a proportional control handler by name.
  • A thermostat runtime contract for feature managers: await thermostat.async_request_state_refresh() applies a decision immediately, while has_valve_regulation and vtherm_hvac_modes expose eligibility facts. These three members require a matching VTherm core implementation with API 0.13.0; see the API reference.
  • A minimal inhibition façade (issue #2087): await VThermAPI.set_inhibition(vtherm_entity_id, stop_underlyings) and await VThermAPI.unset_inhibition(vtherm_entity_id). The plugin owns detection, policy, and ACTIVE / INACTIVE / UNKNOWN; the VTherm core owns the inhibition state and command gate. See the API reference.
  • An optional command-receipt surface: InterfaceCommandReceiptScheduler extends InterfaceCycleScheduler so that a proportional algorithm plugin can tag a start_cycle request with a request_id and receive an AppliedCommandReceipt describing the command the scheduler really applied. See the API reference.
  • An optional temperature-timestamp surface: InterfaceTemperatureTimestampRuntime exposes VTherm's existing room and outdoor freshness clocks without changing the base runtime contract. These clocks can be reset without a new measurement; see the API reference.
  • An optional regulated-temperature surface: InterfaceSetpointModifier lets a feature manager adjust the temperature an over_climate thermostat sends to its underlyings. See the API reference.
  • Optional underlying-command hooks: InterfaceUnderlyingHvacModeHook, InterfaceValveCommandHook and InterfaceUnderlyingPowerHook let a feature manager follow the HVAC mode, valve and power commands the core sends to the underlyings. See the API reference.
  • An optional valve-write hook: InterfaceValveWriteHook lets a feature manager change the opening degree before the core writes it to a valve-regulation underlying, or write the valve itself. See the API reference.
  • An optional calibration-offset modifier: InterfaceCalibrationOffsetModifier lets a feature manager adjust the offset written to the calibration entity of a device. See the API reference.

The package is designed for Home Assistant integration code, not as a standalone HTTP or REST API.

Full documentation: documentation/en/index.md

Table of contents

  • vtherm_api
    • Table of contents
    • What this package solves
    • Requirements
    • Installation for development
    • Architecture
    • Public imports
    • Using VThermAPI
      • Main responsibilities
      • Create or retrieve the singleton
      • Reset the singleton
    • Registering a proportional algorithm plugin
      • Link a plugin climate through the API helper
    • Creating a FeatureManager
      • Example: OddMinuteFeatureManager
      • Register the manager through VThermAPI
      • Minimal thermostat side contract
    • Registering a FeatureManager factory (per-thermostat)
    • Registering a dashboard UI plugin
    • Using PluginClimate
      • What happens when you link it
      • Basic usage
      • Subclass PluginClimate to react to events
      • Simulate a VTherm event
      • Forward an action to the linked thermostat
      • Remove listeners on unload
    • Supported VTherm events
    • Practical patterns
      • Pattern 1: register a proportional algorithm factory
      • Pattern 2: build a plugin that mirrors temperature updates
      • Pattern 3: replicate another climate entity to a target VTherm
      • Pattern 4: expose a command through your own integration code
    • Testing your integration
    • Summary

What this package solves

When you build custom Home Assistant code around Versatile Thermostat, you usually need to:

  1. Keep a stable reference to the integration runtime.
  2. Track one specific VTherm climate entity.
  3. Listen only to that thermostat's events.
  4. Relay actions such as HVAC mode or target temperature changes back to the linked thermostat.

This package provides those responsibilities out of the box. It also lets an external integration register a proportional algorithm factory that VT can resolve dynamically.

Requirements

  • Python 3.14+
  • Home Assistant runtime objects such as HomeAssistant, ConfigEntry, Event, and the service bus
  • A Versatile Thermostat entity already registered in Home Assistant

For local development, the repository uses Home Assistant 2026.3.1.

Installation for development

Install the local development dependencies:

python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install -e .

Run the test suite:

pytest

Architecture

flowchart LR
    CE[ConfigEntry] --> API[VThermAPI singleton]
    API --> HD[hass.data]
    VT[Versatile Thermostat entity] -->|emits HA events| BUS[Home Assistant event bus]
    BUS --> PC[PluginClimate]
    PC -->|stores latest payload by event type| STATE[In-memory event cache]
    PC -->|calls services on domain versatile_thermostat| SVC[Home Assistant service registry]
    SVC --> VT
sequenceDiagram
    participant VT as Linked VTherm entity
    participant BUS as HA event bus
    participant PC as PluginClimate
    participant HA as HA services

    VT->>BUS: versatile_thermostat_temperature_event
    BUS->>PC: event with entity_id
    PC->>PC: ignore if entity_id does not match
    PC->>PC: store payload in get_event_data cache
    PC->>PC: call matching handle_* method
    PC->>HA: async_call(versatile_thermostat, action, target)
    HA->>VT: execute service for linked entity

Public imports

The package root exports PluginClimate and __version__.

Use these imports in integration code:

from vtherm_api import (
    InterfaceFeatureManager,
    InterfaceFeatureManagerFactory,
    InterfacePropAlgorithmFactory,
    InterfacePropAlgorithmHandler,
    InterfaceThermostatRuntime,
    PluginClimate,
    UiPlugin,
    VThermAPI,
)
from vtherm_api.const import DOMAIN, EventType

Using VThermAPI

VThermAPI is a singleton attached to the Home Assistant runtime through hass.data[DOMAIN][VTHERM_API_NAME].

Main responsibilities
  • attach the API instance to a HomeAssistant object
  • expose the active HomeAssistant object through api.hass
  • expose a timezone-aware api.now
  • register and unregister proportional algorithm factories
  • register feature managers on compatible VTherm entities
  • register and unregister the UI plugins of the Versatile Thermostat dashboard
  • optionally link a plugin climate entity to a VTherm climate entity
Create or retrieve the singleton
from vtherm_api.vtherm_api import VThermAPI


async def async_setup_entry(hass, entry) -> bool:
    api = VThermAPI.get_vtherm_api(hass)
    if api is None:
        return False

    print(api.name)  # VThermAPI
    print(api.hass is hass)  # True
    print(api.now)  # timezone-aware datetime from HA
    return True


async def async_unload_entry(hass, entry) -> bool:
    # No explicit unregister call is required for the singleton itself.
    return True
Reset the singleton

This is mainly useful in tests:

from vtherm_api.vtherm_api import VThermAPI


def teardown_function() -> None:
    VThermAPI.reset_vtherm_api()

Registering a proportional algorithm plugin

VThermAPI exposes a small registry for proportional algorithm factories:

  • register_prop_algorithm(factory)
  • unregister_prop_algorithm(name)
  • get_prop_algorithm(name)
  • list_prop_algorithms()

Each registered factory must expose a stable name and a create(thermostat) method. The thermostat object passed to the factory implements InterfaceThermostatRuntime.

from typing import Any

from vtherm_api import (
    InterfacePropAlgorithmFactory,
    InterfacePropAlgorithmHandler,
    InterfaceThermostatRuntime,
    VThermAPI,
)


class SmartPIHandler(InterfacePropAlgorithmHandler):
    def __init__(self, thermostat: InterfaceThermostatRuntime) -> None:
        self._thermostat = thermostat

    def init_algorithm(self) -> None:
        self._thermostat.prop_algorithm = object()

    async def async_added_to_hass(self) -> None:
        return None

    async def async_startup(self) -> None:
        return None

    def remove(self) -> None:
        return None

    async def control_heating(self, timestamp=None, force: bool = False) -> None:
        return None

    async def on_state_changed(self, changed: bool) -> None:
        return None

    def on_scheduler_ready(self, scheduler) -> None:
        return None

    def should_publish_intermediate(self) -> bool:
        return True


class SmartPIFactory(InterfacePropAlgorithmFactory):
    @property
    def name(self) -> str:
        return "smart_pi"

    def create(
        self,
        thermostat: InterfaceThermostatRuntime,
    ) -> InterfacePropAlgorithmHandler:
        return SmartPIHandler(thermostat)


def register_plugin(hass: Any) -> None:
    api = VThermAPI.get_vtherm_api(hass)
    if api is not None:
        api.register_prop_algorithm(SmartPIFactory())
Link a plugin climate through the API helper

VThermAPI.link_to_vtherm(vtherm, plugin_vtherm_entity_id) searches registered climate entities and links the matching plugin entity to the provided VTherm object.

Use this helper only if your plugin climate is already registered as a Home Assistant climate entity and can be found in the climate component.

from types import SimpleNamespace

from vtherm_api.vtherm_api import VThermAPI


async def async_bind_plugin(hass):
    api = VThermAPI.get_vtherm_api(hass)

    linked_vtherm = SimpleNamespace(entity_id="climate.living_room")
    api.link_to_vtherm(
        linked_vtherm,
        plugin_vtherm_entity_id="climate.living_room_plugin",
    )

If you are working with a subclass of PluginClimate, direct linking is usually simpler and more explicit. That pattern is shown below.

Creating a FeatureManager

InterfaceFeatureManager defines the contract expected by VThermAPI.register_manager(...).

When you call api.register_manager(manager), the API scans the Home Assistant climate component and forwards the manager to every entity that:

  • exposes device_info["model"] == DOMAIN
  • implements InterfaceThermostat

In practice, your custom manager only needs to implement the protocol and then be registered once.

Example: OddMinuteFeatureManager

The example below toggles is_detected to True when the current minute is even, and to False when it is odd.

from typing import Any

from homeassistant.core import CALLBACK_TYPE, HomeAssistant

from vtherm_api.interfaces import InterfaceFeatureManager
from vtherm_api.vtherm_api import VThermAPI


class OddMinuteFeatureManager(InterfaceFeatureManager):
    def __init__(self, hass: HomeAssistant) -> None:
        self._hass = hass
        self._is_configured = False
        self._is_detected = False
        self._listeners: list[CALLBACK_TYPE] = []

    def post_init(self, entry_infos: dict[str, Any]) -> None:
        self._is_configured = bool(entry_infos)

    async def start_listening(self, force: bool = False) -> None:
        return None

    def stop_listening(self) -> bool:
        for listener in list(self._listeners):
            listener()
        self._listeners.clear()
        return True

    async def refresh_state(self) -> bool:
        api = VThermAPI.get_vtherm_api(self._hass)
        self._is_detected = bool(api and api.now.minute % 2 == 0)
        return self._is_detected

    def restore_state(self, old_state: Any) -> None:
        return None

    def add_listener(self, func: CALLBACK_TYPE) -> None:
        self._listeners.append(func)

    @property
    def is_configured(self) -> bool:
        return self._is_configured

    @property
    def is_detected(self) -> bool:
        return self._is_detected

    @property
    def name(self) -> str:
        return "OddMinuteFeatureManager"

    @property
    def hass(self) -> HomeAssistant:
        return self._hass
Register the manager through VThermAPI
from homeassistant.core import HomeAssistant

from vtherm_api.vtherm_api import VThermAPI


async def async_setup_entry(hass: HomeAssistant) -> None:
    api = VThermAPI.get_vtherm_api(hass)

    manager = OddMinuteFeatureManager(hass)
    manager.post_init({"enabled": True})
    await manager.refresh_state()

    api.register_manager(manager)
Minimal thermostat side contract

The thermostat receiving the manager must implement InterfaceThermostat and expose a register_manager(...) method. A minimal test double looks like this:

from vtherm_api.const import DOMAIN
from vtherm_api.interfaces import InterfaceFeatureManager, InterfaceThermostat


class FakeVTherm(InterfaceThermostat):
    def __init__(self) -> None:
        self._registered_managers: list[InterfaceFeatureManager] = []

    @property
    def name(self) -> str:
        return "FakeVTherm"

    def register_manager(self, manager: InterfaceFeatureManager) -> None:
        self._registered_managers.append(manager)

    @property
    def unique_id(self) -> str:
        return "fake-vtherm"

    @property
    def device_info(self) -> dict[str, str]:
        return {"model": DOMAIN}

This is the same registration flow used in the test suite to validate manager instantiation and registration.

Registering a FeatureManager factory (per-thermostat)

api.register_manager(...) attaches a single manager instance to the thermostats that already exist. When a feature must be instantiated once per thermostat (including thermostats built later), and optionally restricted to a given scope (for example over_climate), use the feature manager factory registry instead.

This mechanism mirrors the proportional algorithm factory: the plugin registers a factory, and the core iterates over the registered factories when building each thermostat, calling factory.create(runtime) for every eligible thermostat.

from typing import Any

from vtherm_api.interfaces import (
    InterfaceFeatureManager,
    InterfaceFeatureManagerFactory,
    InterfaceThermostatRuntime,
)
from vtherm_api.vtherm_api import VThermAPI


class AutoFanFeatureManager(InterfaceFeatureManager):
    def __init__(self, thermostat: InterfaceThermostatRuntime) -> None:
        self._thermostat = thermostat

    # ... implement the InterfaceFeatureManager contract ...


class AutoFanManagerFactory(InterfaceFeatureManagerFactory):
    @property
    def name(self) -> str:
        return "auto_fan"

    def supports(self, thermostat: InterfaceThermostatRuntime) -> bool:
        # Restrict the manager to thermostats exposing underlying fan modes.
        return thermostat.underlying_fan_modes is not None

    def create(
        self,
        thermostat: InterfaceThermostatRuntime,
    ) -> InterfaceFeatureManager:
        return AutoFanFeatureManager(thermostat)


def register_plugin(hass: Any) -> None:
    api = VThermAPI.get_vtherm_api(hass)
    if api is not None:
        api.register_feature_manager(AutoFanManagerFactory())

The registry exposes:

  • register_feature_manager(factory) / unregister_feature_manager(name)
  • get_feature_manager(name) / list_feature_managers()
  • get_feature_manager_factories() — used by the core to iterate over the registered factories when constructing a thermostat.

To drive an underlying climate fan from the manager, InterfaceThermostatRuntime exposes regulated_target_temperature, underlying_fan_modes, and async_set_underlying_fan_mode(fan_mode).

Registering a dashboard UI plugin

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases vtherm-api

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

Frame 2085668439 (1)
Group 1261154229