Skip to content

Conversation

@brechtvhb
Copy link

@brechtvhb brechtvhb commented Dec 24, 2025

Breaking change

Proposed change

This pull request updates the MQTT Entity Manager to improve how entity IDs are handled when creating MQTT entities. The main change is the replacement of the ObjectId property with a new DefaultEntityId property, which is now constructed using both the domain and identifier for greater clarity and uniqueness. The old ObjectId will be deprecated in 2026.4.

NetDaemon generated entities generate these warnings in the home assistant logs:

The configuration for entity switch.flexilights_terrace uses the deprecated option `object_id` to set the default entity id. Replace the `"object_id": "flexilights_terrace"` option with `"default_entity_id": "switch.flexilights_terrace"` in your published discovery configuration to fix this issue, or contact the maintainer of the integration that published this config to fix this. This will stop working in Home Assistant Core 2026.4

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • The code compiles without warnings (code quality check)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration are added/changed:

Copilot AI review requested due to automatic review settings December 24, 2025 14:29
Copy link
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 updates the MQTT Entity Manager to use default_entity_id instead of the deprecated object_id property when creating MQTT entities in Home Assistant. The main change is that default_entity_id now contains the full entity ID in the format domain.identifier (e.g., "sensor.kitchen_temp") rather than just the identifier portion (e.g., "kitchen_temp").

Key Changes:

  • Replaced ObjectId property with DefaultEntityId in EntityCreationPayload
  • Updated JSON serialization to use default_entity_id instead of object_id
  • Implemented DefaultEntityId() helper method that constructs the full entity ID format

Reviewed changes

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

File Description
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MqttEntityManager.cs Added DefaultEntityId() helper method and updated entity creation to use it instead of passing just the identifier to ObjectId
src/Extensions/NetDaemon.Extensions.MqttEntityManager/Models/EntityCreationPayload.cs Renamed ObjectId property to DefaultEntityId and updated JSON property name from object_id to default_entity_id; minor whitespace cleanup

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.

MQTT warning: deprecated option object_id

1 participant