Skip to content

Add optional virtual heat mode with asymmetric hysteresis control - #13

Draft
gllmlbrt with Claude wants to merge 9 commits into
mainfrom
claude/add-optional-heatmode-feature
Draft

Add optional virtual heat mode with asymmetric hysteresis control#13
gllmlbrt with Claude wants to merge 9 commits into
mainfrom
claude/add-optional-heatmode-feature

Conversation

@Claude

@Claude Claude AI commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Adds configurable HVAC action monitoring for climate entities with intelligent temperature-based state determination. The Roth Touchline controller doesn't expose heating state, so this implements virtual state tracking based on temperature deltas.

Changes

Config flow:

  • Fixed OptionsFlow crash (AttributeError: property 'config_entry' of 'TouchlineOptionsFlow' object has no setter)
  • Removed __init__ override—base class manages config_entry via property descriptor
  • Changed instantiation from TouchlineOptionsFlow(config_entry) to TouchlineOptionsFlow()
  • Added UI option for virtual heat mode toggle

Climate entity:

  • Asymmetric hysteresis thresholds:
    • Heating: triggers at ≥0.2°C below target (immediate)
    • Idle: triggers at ≥0.3°C above target (5-minute delay)
    • Hysteresis band: -0.3°C to +0.2°C maintains current state
  • State tracking with _is_heating flag and _last_heating_time timestamp
  • Returns None when disabled, OFF when HVAC mode is off

Tests:

  • Updated threshold values to match asymmetric band
  • Fixed floating-point precision issues in exact threshold tests
  • All 42 climate + 7 config flow tests passing

Documentation:

  • Added Virtual Heat Mode to enhanced features
  • Detailed configuration steps and technical behavior
  • Example use cases for automations and monitoring
# Hysteresis logic overview
temp_diff = target_temp - current_temp

if temp_diff >= 0.2:  # Below target
    return HVACAction.HEATING
elif temp_diff <= -0.3:  # Above target
    if heating and delay_expired:
        return HVACAction.IDLE
    return current_state
else:  # Within band [-0.3, +0.2]
    return current_state  # Prevent oscillation

Claude AI and others added 2 commits March 2, 2026 08:09
Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Add optional feature for heatmode reporting of climate entities Add optional virtual heat mode for climate entities Mar 2, 2026
Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
@Claude Claude AI changed the title Add optional virtual heat mode for climate entities Fix options flow 500 error by removing incorrect @callback decorator Mar 2, 2026
Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
@Claude Claude AI changed the title Fix options flow 500 error by removing incorrect @callback decorator Fix OptionsFlow initialization causing AttributeError in Python 3.13 Mar 2, 2026
Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
@Claude Claude AI changed the title Fix OptionsFlow initialization causing AttributeError in Python 3.13 Fix OptionsFlow instantiation error in config flow Mar 2, 2026
Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
@Claude Claude AI changed the title Fix OptionsFlow instantiation error in config flow Fix OptionsFlow config_entry property error and update heat mode threshold to 0.3°C Mar 2, 2026
@gllmlbrt

gllmlbrt commented Mar 3, 2026

Copy link
Copy Markdown
Owner

@claude[agent] change the threshold band to - 0.2 / +0.3.

Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
@Claude

Claude AI commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@claude[agent] change the threshold band to - 0.2 / +0.3.

Changed to asymmetric threshold band: -0.2°C for heating / +0.3°C for idle. Heating now triggers when temperature drops 0.2°C below target, while idle triggers when temperature rises 0.3°C above target (after 5min delay). See commit 29309ee.

@Claude Claude AI changed the title Fix OptionsFlow config_entry property error and update heat mode threshold to 0.3°C Fix OptionsFlow config_entry property error and update heat mode threshold to asymmetric -0.2°C / +0.3°C Mar 3, 2026
Co-authored-by: gllmlbrt <58825251+gllmlbrt@users.noreply.github.com>
@Claude Claude AI changed the title Fix OptionsFlow config_entry property error and update heat mode threshold to asymmetric -0.2°C / +0.3°C Add optional virtual heat mode with asymmetric hysteresis control Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants