Skip to content

Add system sensors to libreNMS - #180300

Open
mib1185 wants to merge 4 commits into
devfrom
librenms/add-system-sensors
Open

Add system sensors to libreNMS#180300
mib1185 wants to merge 4 commits into
devfrom
librenms/add-system-sensors

Conversation

@mib1185

@mib1185 mib1185 commented Aug 26, 2026

Copy link
Copy Markdown
Member

Proposed change

This adds the sensor platform and the first bunch of libreNMS system related sensors.

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.
  • 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds LibreNMS system-level sensors for device count and software versions.

Changes:

  • Registers and implements the sensor platform.
  • Adds a LibreNMS service device, translations, and icons.
  • Adds snapshot coverage for sensors and device metadata.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
homeassistant/components/librenms/__init__.py Registers the sensor platform.
homeassistant/components/librenms/entity.py Adds the system service entity base.
homeassistant/components/librenms/icons.json Defines sensor icons.
homeassistant/components/librenms/sensor.py Implements system sensors.
homeassistant/components/librenms/strings.json Adds sensor translations.
tests/components/librenms/test_sensor.py Tests sensor setup and registration.
tests/components/librenms/snapshots/test_sensor.ambr Captures sensor and device snapshots.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread homeassistant/components/librenms/sensor.py Outdated
Copilot AI review requested due to automatic review settings August 26, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Suppressed comments (1)

homeassistant/components/librenms/sensor.py:107

  • Use the config entry ID for these entity unique IDs. The config flow never assigns ConfigEntry.unique_id, so every sensor currently gets values such as None_device_count (as the snapshot confirms); a second LibreNMS entry would therefore collide with the first entry's entities.
        self._attr_unique_id = f"{coordinator.config_entry.unique_id}_{description.key}"

Copilot AI review requested due to automatic review settings August 26, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mib1185 mib1185 changed the title Add system sensors to linreNMS Add system sensors to libreNMS Aug 26, 2026
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.

2 participants