Skip to content

geniushub: fix hvac_action and expose output for cloud API users#167631

Draft
wibbit wants to merge 1 commit intohome-assistant:devfrom
wibbit:geniushub-fix-hvac-action-v1-api
Draft

geniushub: fix hvac_action and expose output for cloud API users#167631
wibbit wants to merge 1 commit intohome-assistant:devfrom
wibbit:geniushub-fix-hvac-action-v1-api

Conversation

@wibbit
Copy link
Copy Markdown
Contributor

@wibbit wibbit commented Apr 7, 2026

Repo: home-assistant/core
Branch: geniushub-fix-hvac-action-v1-api
URL: https://github.com/wibbit/core/pull/new/geniushub-fix-hvac-action-v1-api

Proposed change

The GeniusHub output field is the demand signal present in both the v1 (cloud) and v3 (local)
API responses, indicating whether a zone is actively calling for heat. Two issues prevented it
from reaching Home Assistant users:

  1. hvac_action on climate entities was gated behind _state, a field only present in the v3
    (local) API. Cloud API users always received None — no indication of whether their zones
    were heating or idle.

  2. output was absent from GH_ZONE_ATTRS, so it was silently dropped from
    extra_state_attributes on all zone entities regardless of API version.

Fix: Check output first (present in both API versions) when determining hvac_action:
output=1HEATING, output=0IDLE. The v3-only _state.bIsActive check is
preserved to additionally distinguish IDLE from OFF.

Fix: Add output to GH_ZONE_ATTRS so it appears in the status attribute on climate,
water_heater and switch entities.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

The zone output field — the demand signal for whether a zone is calling
for heat — was not surfaced to cloud API (v1) users:

- hvac_action on climate entities was gated behind _state, a field only
  present in the v3 (local) API. Cloud users always received None.
- output was absent from GH_ZONE_ATTRS so it was silently dropped from
  extra_state_attributes on all zone entities regardless of API version.

Fix hvac_action to check output first (present in both API versions):
output=1 → HEATING, output=0 → IDLE. The v3-only _state.bIsActive
check is preserved to additionally distinguish IDLE from OFF.

Add output to GH_ZONE_ATTRS so it appears in the status attribute on
climate, water_heater and switch entities.
Copilot AI review requested due to automatic review settings April 7, 2026 20:59
@home-assistant
Copy link
Copy Markdown

home-assistant bot commented Apr 7, 2026

Hey there @manzanotti, mind taking a look at this pull request as it has been labeled with an integration (geniushub) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of geniushub can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign geniushub Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes HVAC action reporting and exposes the output field for cloud API users in the GeniusHub integration. Previously, hvac_action was unavailable for cloud API users because it was gated behind the _state field (v3 local API only), and the output field was missing from exposed attributes.

Changes:

  • Added "output" field to GH_ZONE_ATTRS to expose it in status attributes for all zone entities (climate, water_heater, switch)
  • Modified hvac_action logic to check the output field first (present in both API versions) before relying on v3-only _state field
  • Updated test snapshots to reflect new hvac_action and output values

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
homeassistant/components/geniushub/entity.py Added "output" to GH_ZONE_ATTRS to expose the field in status attributes
homeassistant/components/geniushub/climate.py Updated hvac_action property to check output field first, enabling support for cloud API users
tests/components/geniushub/snapshots/test_climate.ambr Updated snapshots to reflect hvac_action and output in status attributes
tests/components/geniushub/snapshots/test_switch.ambr Updated snapshots to reflect output in status attributes

@wibbit wibbit marked this pull request as ready for review April 7, 2026 22:13

# temperature is repeated here, as it gives access to high-precision temps
GH_ZONE_ATTRS = ["mode", "temperature", "type", "occupied", "override"]
GH_ZONE_ATTRS = ["mode", "temperature", "type", "occupied", "override", "output"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we add this to the attributes? Ideally we make separate entities for them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output field indicates whether a zone is actively calling for heat (1) or satisfied (0). It is present in both the v1 (cloud) and v3 (local) API responses — the existing test fixture zones_cloud_test_data.json confirms this.

The original hvac_action implementation correctly identified _state as v3-only (comment: # only for v3 API), but output was gated behind the same _state check, meaning cloud API users could never reach it despite their data containing it — always returning None.

output was also absent from GH_ZONE_ATTRS, so it was dropped from extra_state_attributes for both API versions. v3 local users had hvac_action as an indirect indicator of heat demand; v1 cloud users had nothing at all.

The separate entities you're describing are being added in the companion feature PR #167632, which creates a binary_sensor entity with device_class: heat for each zone — motivated particularly by the hot water zone, where water_heater entities have no hvac_action equivalent. Happy to drop output from extra_state_attributes if you feel the binary sensor makes it redundant, but I felt both were valid given users may want the raw value for templates.

Hopefully, I've not misunderstood the code.

@home-assistant home-assistant bot marked this pull request as draft April 7, 2026 22:50
@home-assistant
Copy link
Copy Markdown

home-assistant bot commented Apr 7, 2026

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants