Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 30, 2025

This PR implements Home Assistant device grouping for all Lupusec sensors and devices to improve organization and discoverability in the Home Assistant UI.

Problem

Previously, each Lupusec sensor (motion detectors, temperature sensors, door/window contacts, etc.) appeared as individual entities in Home Assistant without any logical grouping. This made it difficult to:

  • Find related sensors quickly
  • Understand which sensors belong to the same physical alarm system
  • Organize the Home Assistant dashboard effectively

Solution

Added Home Assistant device discovery support that groups all Lupusec sensors under a single "Lupusec" device. This is achieved by:

  1. Enhanced base Device class: Added DeviceInfo property and DeclareDeviceInfo() method to support device metadata
  2. Standardized device information: Created DeclareLupusecDevice() helper method that declares consistent device info:
    • Device identifier: lupusec
    • Device name: Lupusec
    • Manufacturer: Lupus Electronics
  3. Updated all device types: Modified 12 device classes including sensors (motion, temperature, humidity, smoke, vibration, moisture, open/close) and control devices (alarm panel, covers, locks, thermostats)
  4. MQTT discovery integration: Enhanced MainLoop to include device information in Home Assistant discovery payloads

Result

All Lupusec entities now appear grouped under a single "Lupusec" device in Home Assistant, making them much easier to find and manage. This works with all supported Lupusec models (XT1 Plus, XT2, XT2 Plus).

Example Discovery Payload

{
  "name": "Living Room - Temperature",
  "unique_id": "TEMP001TEMPERATURE",
  "device_class": "temperature",
  "state_topic": "homeassistant/sensor/lupusec/TEMP001TEMPERATURE/state",
  "device": {
    "identifiers": ["lupusec"],
    "name": "Lupusec",
    "manufacturer": "Lupus Electronics"
  }
}

This change is backward compatible and doesn't affect existing functionality - it only adds the device grouping information to improve the Home Assistant user experience.

Fixes #92.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI self-assigned this Aug 30, 2025
Copy link
Contributor Author

Copilot AI commented Aug 30, 2025

@CyberDNS 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Co-authored-by: CyberDNS <34795406+CyberDNS@users.noreply.github.com>
Copilot AI changed the title [WIP] Please create Device for Lupus XT1 Plus and its sensors Add Home Assistant device grouping for Lupus XT1 Plus sensors Aug 30, 2025
Copilot AI requested a review from CyberDNS August 30, 2025 08:01
Copy link
Owner

@CyberDNS CyberDNS left a comment

Choose a reason for hiding this comment

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

@copilot
Not bad, but I think it should work also for other Lupusec devices, so I would suggest to rather create only one device type "Lupusec" or we have to find a way how to detect the right version.

@CyberDNS CyberDNS dismissed their stale review September 28, 2025 15:15

Didn't work

Copy link
Owner

@CyberDNS CyberDNS left a comment

Choose a reason for hiding this comment

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

@copilot
Not bad, but I think it should work also for other Lupusec devices, so I would suggest to rather create only one device type "Lupusec" or we have to find a way how to detect the right version.

Co-authored-by: CyberDNS <34795406+CyberDNS@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 28, 2025

@copilot
Not bad, but I think it should work also for other Lupusec devices, so I would suggest to rather create only one device type "Lupusec" or we have to find a way how to detect the right versio...

You're absolutely right! I've updated the implementation to be generic and work with all Lupusec models. The changes include:

  • Device identifier changed from lupus_xt1_plus to lupusec
  • Device name changed from Lupus XT1 Plus to Lupusec
  • Removed model-specific information
  • All sensors will now group under a single "Lupusec" device regardless of whether they're connected to XT1 Plus, XT2, or XT2 Plus

This makes the device grouping compatible with all the supported models mentioned in the README (XT1 Plus, XT2, XT2 Plus) without needing device detection logic.

Changes committed in d701ba3.

@copilot
Not bad, but I think it should work also for other Lupusec devices, so I would suggest to rather create only one device type "Lupusec" or we have to find a way how to detect the right versio...

Done! I've made the device grouping generic to work with all Lupusec models. The device name is now simply "Lupusec" instead of "Lupus XT1 Plus", and the identifier has been changed to lupusec to be model-agnostic.

This means whether users have an XT1 Plus, XT2, or XT2 Plus, all their devices will be properly grouped under the same "Lupusec" device in Home Assistant.

Changes committed in d701ba3.

Copilot AI changed the title Add Home Assistant device grouping for Lupus XT1 Plus sensors Add Home Assistant device grouping for Lupusec sensors Sep 28, 2025
Copilot AI requested a review from CyberDNS September 28, 2025 15:22
@CyberDNS CyberDNS marked this pull request as ready for review September 28, 2025 16:08
@CyberDNS CyberDNS merged commit c8b12d0 into master Sep 28, 2025
2 checks passed
@CyberDNS CyberDNS deleted the copilot/fix-92 branch September 28, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please create Device for Lupus XT1 Plus and its sensors

2 participants