Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid value active power after update HA core 2024.12 #316

Open
Pstart opened this issue Dec 11, 2024 · 16 comments
Open

Invalid value active power after update HA core 2024.12 #316

Pstart opened this issue Dec 11, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@Pstart
Copy link

Pstart commented Dec 11, 2024

Description

PV - HYD 10KTL-3PH-PRO

I had integration Solarman StephanJoubert but update core 2024.12 entered incorrect values many entity. I changed for new integration ha-solarman. Most of the values is ok but active_energe and battery power is incorect for more time. More time returning value is 65kW, like
ActivePower_Output_R 64,526 W
ActivePower_Output_S 910 W
ActivePower_Output_T 64,876 W
ActivePower_Output_Total 64,766 W
ActivePower_PCC_R 64,406 W
ActivePower_PCC_S 64,456 W
ActivePower_PCC_T 64,586 W
ActivePower_PCC_Total 62,356 W
Details is chart in attachment.
My max use energy is about 8kW
My profile is sofar_g3hyd.yaml
activePower

Reproduction Steps

I only use integration. Value active power is invalid.

Log

[33m2024-12-11 20:38:15.422 WARNING (MainThread) [py.warnings] /config/custom_components/solarman/parser.py:226: RuntimeWarning: overflow encountered in scalar subtract
value = (value - maxint) if not magnitude else -(value & (maxint >> 1))
[0m
[33m2024-12-11 20:38:15.423 WARNING (MainThread) [py.warnings] /config/custom_components/solarman/parser.py:229: RuntimeWarning: overflow encountered in scalar multiply
value *= scale
[0m
[33m2024-12-11 20:38:41.460 WARNING (MainThread) [py.warnings] /config/custom_components/solarman/parser.py:226: RuntimeWarning: overflow encountered in scalar subtract
value = (value - maxint) if not magnitude else -(value & (maxint >> 1))
[0m
[33m2024-12-11 20:38:41.460 WARNING (MainThread) [py.warnings] /config/custom_components/solarman/parser.py:229: RuntimeWarning: overflow encountered in scalar multiply
value *= scale

Version

24.12.10

Home Assistant Version

2024.12.2

@Pstart Pstart added the bug Something isn't working label Dec 11, 2024
@davidrapan
Copy link
Owner

Hi @Pstart, you are running containerized home assistant?

@Pstart
Copy link
Author

Pstart commented Dec 12, 2024

Hi, no i use Assistant OS on x86-64 hardware
Home Assistant

Core
2024.12.2
Supervisor
2024.11.4
Operating System
14.0
Interfejs użytkownika
20241127.7

@davidrapan
Copy link
Owner

davidrapan commented Dec 12, 2024

Did you try downgrade of the core (to some known to be working) to see of the problem prevails?

Edit: 2024.12 contains python upgrade to 3.13 and I'm for now not sure what's different there what could cause issues like this but it's the best candidate nevertheless.

@Pstart
Copy link
Author

Pstart commented Dec 12, 2024

@davidrapan Yes, I downgraded version to 2024.11.3 that's all working good. But when ha-sofarman well work good on 2024.12?

@davidrapan
Copy link
Owner

davidrapan commented Dec 13, 2024

Once I figure out what's wrong, because right now I don't have even slight idea... as everything works w/o any issues on my installation w/ 2024.12.2.

@werfpsa
Copy link

werfpsa commented Dec 14, 2024

Same problem with inverter file sofar_g3hyd.yaml

@DawidJan
Copy link

I also have the same issue with sofar_g3hyd.yaml file

@davidrapan
Copy link
Owner

Can someone record 10 minute debug log?

@davidreher
Copy link

@davidrapan this is the log from HA:

2024-12-16 20:31:55.636 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inverter for solarman
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/solarman/__init__.py", line 59, in async_setup_entry
    await async_migrate_entries(hass, config_entry.entry_id, partial(migrate_unique_ids, config.name, config.serial))
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1636, in async_migrate_entries
    ent_reg.async_update_entity(entry.entity_id, **updates)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1179, in async_update_entity
    return self._async_update_entity(
           ~~~~~~~~~~~~~~~~~~~~~~~~~^
        entity_id,
        ^^^^^^^^^^
    ...<21 lines>...
        unit_of_measurement=unit_of_measurement,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1118, in _async_update_entity
    raise ValueError(
    ...<2 lines>...
    )

How can I create the debug log? Happy to provide it ...

@davidreher
Copy link

Sent it to you via mail (hope that is fine) ...

@mariomurrent-softwaresolutions

@davidrapan this is the log from HA:

2024-12-16 20:31:55.636 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inverter for solarman
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/solarman/__init__.py", line 59, in async_setup_entry
    await async_migrate_entries(hass, config_entry.entry_id, partial(migrate_unique_ids, config.name, config.serial))
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1636, in async_migrate_entries
    ent_reg.async_update_entity(entry.entity_id, **updates)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1179, in async_update_entity
    return self._async_update_entity(
           ~~~~~~~~~~~~~~~~~~~~~~~~~^
        entity_id,
        ^^^^^^^^^^
    ...<21 lines>...
        unit_of_measurement=unit_of_measurement,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1118, in _async_update_entity
    raise ValueError(
    ...<2 lines>...
    )

How can I create the debug log? Happy to provide it ...

Having the same issue :(

@davidrapan
Copy link
Owner

I did not receive any debug logs. Please upload it here in the thread. 😉

@maconly34
Copy link

maconly34 commented Dec 30, 2024

Hello David,
I have similar error with Deye Sun inverter 6k SG03LP1.
Grid Power have a x10 factor shown.
Values is ok on iPhone Solarman App.

See screen copy.

Capture d’écran

IMG_1192

Capture d’écran

@maconly34
Copy link

Hi David,
I've managed to correct the problem by modifying the code in the "deye_hybrid.yaml" file
There are 9 lines (# out of date docs) where the scale function is "scale: [1, 10]" I've replaced it with "scale: 1".

part of the code corrected :

  • name: "External CT1 Power"
    l: 2
    class: "power"
    state_class: "measurement"
    uom: "W"
    rule: 2
    scale: 1 # out of date docs
    registers: [0x00AA]
    icon: "mdi:transmission-tower"

    - name: "External CT2 Power"
      l: 2
      class: "power"
      state_class: "measurement"
      uom: "W"
      rule: 2
      scale: 1 # out of date docs
      registers: [0x00AB]
      icon: "mdi:transmission-tower"
    
    - name: "External Power"
      l: 1
      class: "power"
      state_class: "measurement"
      uom: "W"
      rule: 2
      scale: 1 # out of date docs
      registers: [0x00AC]
      icon: "mdi:transmission-tower"
    

@davidrapan
Copy link
Owner

@maconly34, it's there for a reason. You proly checked scale modifier in the options. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants