Skip to content

2026-03-17 GoSungrow default_entity_id for HA#144

Open
Paraphraser wants to merge 1 commit intoMickMake:masterfrom
Paraphraser:20260317-default_entity_id-master
Open

2026-03-17 GoSungrow default_entity_id for HA#144
Paraphraser wants to merge 1 commit intoMickMake:masterfrom
Paraphraser:20260317-default_entity_id-master

Conversation

@Paraphraser
Copy link
Copy Markdown

Home Assistant has been logging errors with the following pattern:

The configuration for entity «thing» uses the deprecated option
'object_id' to set the default entity id. Replace the
"object_id": "«value»"' option with "default_entity_id": "«value»"
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

This post says that, rather than replacing object_id, one way to deal with this problem is to add the default_entity_id key to the MQTT JSON.

My testing shows this is correct. Adding the key has the desired effect of silencing the log messages from Home Assistant, whilst maintaining compatibility for anyone else who may be using GoSungrow in other contexts where downstream processing may assume that object_id just won't up and vanish someday to suit the whim of another ecosystem.

I have a simple Sungrow environment (SG5.0RS plus meter plus comms) so I can't claim that the patches proposed in this PR, which do work for me, will necessarily work in all environments.

The approach I adopted was to observe that, whenever the 'object_id' key was present in an MQTT message, the unique_id key was also present, and the two had the same value. I augmented each such instance with the default_entity_id key.

If anyone comes across situations where Home Assistant is still complaining then please comment on this PR and I will endeavour to nail the sucker.

I have updated the gist to remove part 2 (the triamazikamno binaries and associated Docker images won't work post Home Assistant Core 2026.4). I have rewritten part 5 accordingly.

Fixes: #142 #143

Home Assistant has been logging errors with the following pattern:

```
The configuration for entity «thing» uses the deprecated option
'object_id' to set the default entity id. Replace the
"object_id": "«value»"' option with "default_entity_id": "«value»"
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
```

[This post](https://community.home-assistant.io/t/mqtt-discovery-information-not-correctly-interpreted/976459/9)
says that, rather than **replacing** `object_id`, one way to deal with
this problem is to **add** the `default_entity_id` key to the MQTT JSON.

My testing shows this is correct. Adding the key has the desired effect
of silencing the log messages from Home Assistant, whilst maintaining
compatibility for anyone else who may be using GoSungrow in other
contexts where downstream processing may assume that `object_id`
just won't up and vanish someday to suit the whim of another ecosystem.

I have a simple Sungrow environment (SG5.0RS plus meter plus comms) so
I can't claim that the patches proposed in this PR, which do work for
me, will necessarily work in all environments.

The approach I adopted was to observe that, whenever the 'object_id'
key was present in an MQTT message, the `unique_id` key was also
present, and the two had the same value. I augmented each such instance
with the `default_entity_id` key.

If anyone comes across situations where Home Assistant is still
complaining then please comment on this PR and I will endeavour to
nail the sucker.

I have updated [the gist](https://gist.github.com/Paraphraser/cad3b0aa6428c58ee87bc835ac12ed37)
to remove part 2 (the triamazikamno binaries and associated Docker
images won't work post Home Assistant Core 2026.4). I have rewritten
part 5 accordingly.

Fixes: MickMake#142 MickMake#143

Signed-off-by: Phill Kelley <34226495+Paraphraser@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant