homematicip_cloud: fix HmIP-FLC lock state polarity#170159
Merged
Merged
Conversation
Contributor
|
Hey there @hahn-th, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
The Locked binary sensor uses BinarySensorDeviceClass.LOCK, where the HA convention is ON = unlocked / open and OFF = locked / closed. The sensor returned ON when the API reports LOCKED, displaying the opposite of the actual lock state. Reported on hahn-th/homematicip-rest-api#606 by user dennisiser. Update the test fixture-derived expectations accordingly: the FLC fixture starts with lockState=LOCKED (now STATE_OFF) and the test manipulates it to UNLOCKED (now STATE_ON).
4781616 to
ea4c749
Compare
frenck
approved these changes
May 11, 2026
lmaertin
pushed a commit
to lmaertin/homeassistant-core
that referenced
this pull request
May 11, 2026
raman325
added a commit
to raman325/home-assistant
that referenced
this pull request
May 12, 2026
…-timer * upstream/dev: Bump infrared-protocols to 5.1.0 (home-assistant#170365) Clean up template engine after extension modularization (home-assistant#170346) Bump axis to v71 (home-assistant#170347) Enhance WebDAV metadata download with concurrency (home-assistant#170223) Add target temperature sensor for ViCare RadiatorActuator devices (home-assistant#170102) Bump pyzbar to 0.1.9 (home-assistant#170076) homematicip_cloud: fix HmIP-FLC lock state polarity (home-assistant#170159) Watts: add timer mode service (home-assistant#169846) Set parallel updates for Ecowitt platforms (home-assistant#170349) Add config flow to Avea (home-assistant#168070) Cleanup Eurotronic number platform (home-assistant#170337) Add number platform to eurotronic_cometblue (home-assistant#168119)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
The HmIP-FLC
Lockedbinary sensor returns the inverted state. It usesBinarySensorDeviceClass.LOCK, where the HA convention is ON = unlocked / open and OFF = locked / closed. The sensor currently returns ON when the API reportsLOCKED, so it displays the opposite of the lock's actual state.Reported on hahn-th/homematicip-rest-api#606 by a user with an HmIP-FLC. After receiving their diagnostics, the polarity turns out to depend on the channel's
binaryBehaviorTypeconfiguration:NORMALLY_OPEN(default): contact closure (e.g. magnetic door contact registering door closed) puts the input in the active state, which the firmware reports aslockState=LOCKED. To present "door closed = off" in HA the value must be inverted.NORMALLY_CLOSE: the same physical event puts the input in the idle state, reported aslockState=UNLOCKED. Here the value must be used as-is.The fix reads
binaryBehaviorTypefrom the channel and inverts conditionally, so HA shows the right state regardless of how the user wired the contact in the HmIP app. Tests cover all four combinations ofbinaryBehaviorType × lockState.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: