Skip to content

Discover Fibaro FGMS001 v2.8 as a motion sensor for Z-Wave#169276

Merged
MartinHjelmare merged 4 commits into
home-assistant:devfrom
AlCalzone:fgms001-fw2.8
Apr 28, 2026
Merged

Discover Fibaro FGMS001 v2.8 as a motion sensor for Z-Wave#169276
MartinHjelmare merged 4 commits into
home-assistant:devfrom
AlCalzone:fgms001-fw2.8

Conversation

@AlCalzone
Copy link
Copy Markdown
Contributor

Proposed change

This PR adds a targeted discovery schema for the Fibaro FGMS001 Motion Sensor to actually detect it as a motion sensor rather than a light entity.
On firmware <= 2.8 the device supports Binary Sensor CC v1, which does not give us any information about the type of the sensor. As a result it is exposed via the generic "Any" sensor type, which fits no other discovery schema.

Note that this change will only take effect once zwave-js/zwave-js#8765 is released. Until then it does nothing.

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

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. tested manually with a simulated device
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI review requested due to automatic review settings April 27, 2026 11:07
@AlCalzone AlCalzone requested a review from a team as a code owner April 27, 2026 11:07
@home-assistant home-assistant Bot added bugfix cla-signed integration: zwave_js Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage Quality Scale: No score labels Apr 27, 2026
@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zwave_js can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign zwave_js Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @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

Adds a targeted Z-Wave JS discovery schema so the Fibaro FGMS001 (firmware <= 2.8) is discovered as a motion binary_sensor when it only exposes a Sensor Binary CC v1 Any value.

Changes:

  • Import FirmwareVersionRange for use in binary sensor discovery schemas.
  • Add a device-specific NewZWaveDiscoverySchema matching Fibaro FGMS001 identifiers, constrained to firmware <= 2.8, mapping Sensor Binary Any to BinarySensorDeviceClass.MOTION.

Comment thread homeassistant/components/zwave_js/binary_sensor.py
@MartinHjelmare MartinHjelmare marked this pull request as draft April 27, 2026 18:02
@AlCalzone AlCalzone marked this pull request as ready for review April 28, 2026 12:11
Copilot AI review requested due to automatic review settings April 28, 2026 12:11
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 adds a device-specific Z-Wave JS discovery schema so the Fibaro FGMS001 (firmware ≤ 2.8) is discovered as a motion binary_sensor when it only exposes a generic Binary Sensor CC “Any” value.

Changes:

  • Add a targeted NewZWaveDiscoverySchema for Fibaro FGMS001 (firmware ≤ 2.8) mapping Binary Sensor “Any” to BinarySensorDeviceClass.MOTION.
  • Add a simulated-device node state fixture for FGMS001 v2.8.
  • Add a discovery test to validate a motion binary_sensor is created for that fixture.

Reviewed changes

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

File Description
homeassistant/components/zwave_js/binary_sensor.py Adds a Fibaro FGMS001 (≤ 2.8) binary-sensor discovery override to classify “Any” as motion.
tests/components/zwave_js/test_binary_sensor.py Adds a test asserting the device is discovered as a motion binary sensor.
tests/components/zwave_js/conftest.py Adds fixtures to load the FGMS001 v2.8 node state and instantiate a Node.
tests/components/zwave_js/fixtures/fibaro_fgms001_v2_8_state.json Introduces the simulated device JSON fixture used by the new test.

type={ValueType.BOOLEAN},
),
entity_description=BinarySensorEntityDescription(
key="motion",
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.

I think this is not necessarily needed, right? By default, the sensor's name matches the device.

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.

It's nice to include the sensor feature in the name since there often is more than one sensor on a device. Lights and switches etc don't need an extra name since those seldom are more than one per device.

Comment thread tests/components/zwave_js/test_binary_sensor.py Outdated
Comment thread tests/components/zwave_js/test_binary_sensor.py Outdated
@MartinHjelmare MartinHjelmare marked this pull request as draft April 28, 2026 12:20
@AlCalzone AlCalzone marked this pull request as ready for review April 28, 2026 13:24
Copilot AI review requested due to automatic review settings April 28, 2026 13:24
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

Adds a device-specific Z-Wave JS discovery override so the Fibaro FGMS001 (firmware ≤ 2.8) is created as a motion binary_sensor (instead of being misclassified, e.g., as a light), and verifies it via a new discovery test + fixture.

Changes:

  • Add a targeted NewZWaveDiscoverySchema for Fibaro FGMS001 firmware ≤ 2.8 mapping Sensor Binary (Any) to BinarySensorDeviceClass.MOTION.
  • Add a new discovery test asserting exactly one enabled motion binary_sensor is created and no light entity is created.
  • Add node state + pytest fixtures for an FGMS001 (fw 2.8) from a simulated device.

Reviewed changes

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

File Description
homeassistant/components/zwave_js/binary_sensor.py Adds a firmware-bounded, device-specific discovery schema to classify FGMS001 “Any” binary sensor values as motion.
tests/components/zwave_js/test_discovery.py Adds an automated regression test covering the new discovery behavior and ensuring no light entity is created.
tests/components/zwave_js/conftest.py Adds fixtures to load the FGMS001 v2.8 node state and construct a Node for tests.
tests/components/zwave_js/fixtures/fibaro_fgms001_v2_8_state.json Provides the captured node state used by the new fixtures/test.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Let's merge here now. We can adjust the entity name in a follow up if wanted.

@MartinHjelmare MartinHjelmare changed the title Discover Fibaro FGMS001 v2.8 as a motion sensor Discover Fibaro FGMS001 v2.8 as a motion sensor for Z-Wave Apr 28, 2026
@MartinHjelmare MartinHjelmare merged commit d19c250 into home-assistant:dev Apr 28, 2026
36 of 37 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix cla-signed integration: zwave_js Quality Scale: No score Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants