geniushub: fix hvac_action and expose output for cloud API users#167631
geniushub: fix hvac_action and expose output for cloud API users#167631wibbit wants to merge 1 commit intohome-assistant:devfrom
Conversation
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.
|
Hey there @manzanotti, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
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_ATTRSto expose it in status attributes for all zone entities (climate, water_heater, switch) - Modified
hvac_actionlogic to check theoutputfield first (present in both API versions) before relying on v3-only_statefield - 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 |
|
|
||
| # 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"] |
There was a problem hiding this comment.
Why do we add this to the attributes? Ideally we make separate entities for them
There was a problem hiding this comment.
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.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
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
outputfield 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:
hvac_actionon 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 zoneswere heating or idle.
outputwas absent fromGH_ZONE_ATTRS, so it was silently dropped fromextra_state_attributeson all zone entities regardless of API version.Fix: Check
outputfirst (present in both API versions) when determininghvac_action:output=1→HEATING,output=0→IDLE. The v3-only_state.bIsActivecheck ispreserved to additionally distinguish
IDLEfromOFF.Fix: Add
outputtoGH_ZONE_ATTRSso it appears in thestatusattribute on climate,water_heater and switch entities.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed: