solaredgeoptimizers icon indicating copy to clipboard operation
solaredgeoptimizers copied to clipboard

References non-existent device — warning in Home Assistant, will break in 2025.12

Open Migaddo opened this issue 7 months ago • 4 comments

I'm seeing the following warning in Home Assistant when using the solaredgeoptimizers custom integration:

Detected code that calls device_registry.async_get_or_create referencing a non existing via_device ('solaredgeoptimizers', '760e67126f726cb9c7e00f308e8e9c69'), with device info: {'hw_version': '10285584-11', 'identifiers': {('solaredgeoptimizers', '10285584-11')}, 'manufacturer': 'Trina Solar Energy', 'model': 'TSM-270DC05A.08', 'name': '1.1.1', 'via_device': ('solaredgeoptimizers', '760e67126f726cb9c7e00f308e8e9c69')}.

This is triggered at: custom_components/solaredgeoptimizers/sensor.py, line 103

According to the warning, this will become a breaking error in Home Assistant 2025.12 if via_device references are not validated against existing registered devices.

The via_device reference should only be used after the parent device is created in the device registry.

Home Assistant version: 2025.5.x

Integration installed via: HACS

Migaddo avatar May 04 '25 10:05 Migaddo

+1

mxwi avatar May 12 '25 12:05 mxwi

Current home assistant version 2025.7.1. Hopefully the code will be updated soon within the next five months. 😉😎

rinyheuvelman avatar Jul 14 '25 03:07 rinyheuvelman

Still getting the warning message…

rinyheuvelman avatar Aug 22 '25 01:08 rinyheuvelman

I think that https://github.com/ProudElm/solaredgeoptimizers/pull/86/ fixes this but there hasn't been any release yet.

I fetched the init.py, coordinator.py and sensor.py and it seems to be working (although it's night so i don't have solar data).

@ProudElm something seems off with the HACS versions. Downloading version 1.2.4 gives me 1.2.2 on disk. Could it be the wrong version got published and could you release a new one with correct manifest?

slyoldfox avatar Sep 08 '25 18:09 slyoldfox