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

Closed
Pstart opened this issue Dec 11, 2024 · 99 comments · Fixed by #393
Closed

Invalid value active power after update HA core 2024.12 #316

Pstart opened this issue Dec 11, 2024 · 99 comments · Fixed by #393
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

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. 😉

@davidreher
Copy link

davidreher commented Jan 6, 2025

Sorry, was a bit busy over xmas ... I also updated to 2025.01 already, here are the necessary parts from the debug logs:

2025-01-06 07:20:03.990 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>...
    )
ValueError: Unique id 'inverter_2714000940_ambient_temperature_sensor' is already in use by 'sensor.inverter_ambient_temperature'
2025-01-06 07:20:14.589 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.ractualtemp (<class 'custom_components.bosch.sensor.recording.RecordingSensor'>) is using state class 'total' which is impossible considering device class ('temperature') it is using; expected None or one of 'measurement'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/bosch-thermostat/home-assistant-bosch-custom-component/issues

and then I tried to change the config to sofar_hyd-es.yaml and back to sofar_g3hyd.yaml, which resulted in the following output:

2025-01-06 13:50:16.550 DEBUG (MainThread) [custom_components.solarman.config_flow] ConfigFlowHandler.async_get_options_flow: <ConfigEntry entry_id=01J6HE6KWV1C1TCW7KWWF1WJWR version=1 domain=solarman title=Inverter state=ConfigEntryState.SETUP_ERROR unique_id=None>
2025-01-06 13:50:16.551 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.__init__: <ConfigEntry entry_id=01J6HE6KWV1C1TCW7KWWF1WJWR version=1 domain=solarman title=Inverter state=ConfigEntryState.SETUP_ERROR unique_id=None>
2025-01-06 13:50:16.551 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.async_step_init: user_input: None, current: {'additional_options': {'battery_nominal_voltage': 400}, 'host': '172.16.43.200', 'lookup_file': 'sofar_g3hyd.yaml'}
2025-01-06 13:50:16.555 DEBUG (MainThread) [custom_components.solarman.config_flow] step_user_data_schema: custom_components/solarman/inverter_definitions/: ['Auto', 'afore_2mppt.yaml', 'afore_BNTxxxKTL-2mppt.yaml', 'afore_hybrid.yaml', 'chint_cps-scetl.yaml', 'deye_hybrid.yaml', 'deye_micro.yaml', 'deye_p3.yaml', 'deye_string.yaml', 'invt_xd-tl.yaml', 'kstar_hybrid.yaml', 'megarevo_r-3h.yaml', 'pylontech_Force-H+.yaml', 'pylontech_Force-H.yaml', 'renon_ifl.yaml', 'sofar_g3hyd.yaml', 'sofar_hyd-es.yaml', 'sofar_lsw3.yaml', 'sofar_tlx-g3.yaml', 'sofar_wifikit.yaml', 'solarman_dtsd422-d3.yaml', 'solis_1p-5g.yaml', 'solis_3p-4g+.yaml', 'solis_3p-4g.yaml', 'solis_3p-5g.yaml', 'solis_hybrid.yaml', 'solis_s6-gr1p.yaml', 'swatten_sih-th.yaml', 'tsun_tsol-ms.yaml', 'zcs_azzurro-1ph-tl-v3.yaml', 'zcs_azzurro-hyd-zss-hp.yaml', 'zcs_azzurro-ktl-v3.yaml']
2025-01-06 13:50:16.556 DEBUG (MainThread) [custom_components.solarman.config_flow] step_user_data_schema: data_schema: {'host': <class 'str'>, 'port': All(Coerce(int, msg=None), Range(min=1, max=65535, min_included=True, max_included=True, msg=None), msg=None), 'lookup_file': In(['Auto', 'afore_2mppt.yaml', 'afore_BNTxxxKTL-2mppt.yaml', 'afore_hybrid.yaml', 'chint_cps-scetl.yaml', 'deye_hybrid.yaml', 'deye_micro.yaml', 'deye_p3.yaml', 'deye_string.yaml', 'invt_xd-tl.yaml', 'kstar_hybrid.yaml', 'megarevo_r-3h.yaml', 'pylontech_Force-H+.yaml', 'pylontech_Force-H.yaml', 'renon_ifl.yaml', 'sofar_g3hyd.yaml', 'sofar_hyd-es.yaml', 'sofar_lsw3.yaml', 'sofar_tlx-g3.yaml', 'sofar_wifikit.yaml', 'solarman_dtsd422-d3.yaml', 'solis_1p-5g.yaml', 'solis_3p-4g+.yaml', 'solis_3p-4g.yaml', 'solis_3p-5g.yaml', 'solis_hybrid.yaml', 'solis_s6-gr1p.yaml', 'swatten_sih-th.yaml', 'tsun_tsol-ms.yaml', 'zcs_azzurro-1ph-tl-v3.yaml', 'zcs_azzurro-hyd-zss-hp.yaml', 'zcs_azzurro-ktl-v3.yaml']), 'additional_options': <homeassistant.data_entry_flow.section object at 0x7f52fcaa50>}
2025-01-06 13:50:19.287 WARNING (MainThread) [bosch_thermostat_client.sensors.sensor] Can't update data for Actual supply temperature for HC. Trying uri: /heatingCircuits/hc2/actualSupplyTemperature. Error message: URI /heatingCircuits/hc2/actualSupplyTemperature doesn not exist: 404, message='Not Found', url='http://172.16.43.14/heatingCircuits/hc2/actualSupplyTemperature'
2025-01-06 13:50:25.399 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.async_step_init: user_input: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_hyd-es.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}, current: {'additional_options': {'battery_nominal_voltage': 400}, 'host': '172.16.43.200', 'lookup_file': 'sofar_g3hyd.yaml'}
2025-01-06 13:50:25.400 DEBUG (MainThread) [custom_components.solarman.config_flow] validate_connection: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_hyd-es.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}
2025-01-06 13:50:25.403 DEBUG (MainThread) [custom_components.solarman.config_flow] validate_connection: validation passed: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_hyd-es.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}
2025-01-06 13:50:27.683 DEBUG (MainThread) [custom_components.solarman.config_flow] ConfigFlowHandler.async_get_options_flow: <ConfigEntry entry_id=01J6HE6KWV1C1TCW7KWWF1WJWR version=1 domain=solarman title=Inverter state=ConfigEntryState.SETUP_ERROR unique_id=None>
2025-01-06 13:50:27.684 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.__init__: <ConfigEntry entry_id=01J6HE6KWV1C1TCW7KWWF1WJWR version=1 domain=solarman title=Inverter state=ConfigEntryState.SETUP_ERROR unique_id=None>
2025-01-06 13:50:27.684 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.async_step_init: user_input: None, current: {'host': '172.16.43.200', 'lookup_file': 'sofar_hyd-es.yaml', 'additional_options': {'battery_nominal_voltage': 400}}
2025-01-06 13:50:27.690 DEBUG (MainThread) [custom_components.solarman.config_flow] step_user_data_schema: custom_components/solarman/inverter_definitions/: ['Auto', 'afore_2mppt.yaml', 'afore_BNTxxxKTL-2mppt.yaml', 'afore_hybrid.yaml', 'chint_cps-scetl.yaml', 'deye_hybrid.yaml', 'deye_micro.yaml', 'deye_p3.yaml', 'deye_string.yaml', 'invt_xd-tl.yaml', 'kstar_hybrid.yaml', 'megarevo_r-3h.yaml', 'pylontech_Force-H+.yaml', 'pylontech_Force-H.yaml', 'renon_ifl.yaml', 'sofar_g3hyd.yaml', 'sofar_hyd-es.yaml', 'sofar_lsw3.yaml', 'sofar_tlx-g3.yaml', 'sofar_wifikit.yaml', 'solarman_dtsd422-d3.yaml', 'solis_1p-5g.yaml', 'solis_3p-4g+.yaml', 'solis_3p-4g.yaml', 'solis_3p-5g.yaml', 'solis_hybrid.yaml', 'solis_s6-gr1p.yaml', 'swatten_sih-th.yaml', 'tsun_tsol-ms.yaml', 'zcs_azzurro-1ph-tl-v3.yaml', 'zcs_azzurro-hyd-zss-hp.yaml', 'zcs_azzurro-ktl-v3.yaml']
2025-01-06 13:50:27.691 DEBUG (MainThread) [custom_components.solarman.config_flow] step_user_data_schema: data_schema: {'host': <class 'str'>, 'port': All(Coerce(int, msg=None), Range(min=1, max=65535, min_included=True, max_included=True, msg=None), msg=None), 'lookup_file': In(['Auto', 'afore_2mppt.yaml', 'afore_BNTxxxKTL-2mppt.yaml', 'afore_hybrid.yaml', 'chint_cps-scetl.yaml', 'deye_hybrid.yaml', 'deye_micro.yaml', 'deye_p3.yaml', 'deye_string.yaml', 'invt_xd-tl.yaml', 'kstar_hybrid.yaml', 'megarevo_r-3h.yaml', 'pylontech_Force-H+.yaml', 'pylontech_Force-H.yaml', 'renon_ifl.yaml', 'sofar_g3hyd.yaml', 'sofar_hyd-es.yaml', 'sofar_lsw3.yaml', 'sofar_tlx-g3.yaml', 'sofar_wifikit.yaml', 'solarman_dtsd422-d3.yaml', 'solis_1p-5g.yaml', 'solis_3p-4g+.yaml', 'solis_3p-4g.yaml', 'solis_3p-5g.yaml', 'solis_hybrid.yaml', 'solis_s6-gr1p.yaml', 'swatten_sih-th.yaml', 'tsun_tsol-ms.yaml', 'zcs_azzurro-1ph-tl-v3.yaml', 'zcs_azzurro-hyd-zss-hp.yaml', 'zcs_azzurro-ktl-v3.yaml']), 'additional_options': <homeassistant.data_entry_flow.section object at 0x7f52fcaa50>}
2025-01-06 13:50:36.606 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.async_step_init: user_input: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}, current: {'host': '172.16.43.200', 'lookup_file': 'sofar_hyd-es.yaml', 'additional_options': {'battery_nominal_voltage': 400}}
2025-01-06 13:50:36.606 DEBUG (MainThread) [custom_components.solarman.config_flow] validate_connection: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}
2025-01-06 13:50:36.606 DEBUG (MainThread) [custom_components.solarman.config_flow] validate_connection: validation passed: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}
2025-01-06 13:51:19.168 WARNING (MainThread) [bosch_thermostat_client.sensors.sensor] Can't update data for Actual supply temperature for HC. Trying uri: /heatingCircuits/hc2/actualSupplyTemperature. Error message: URI /heatingCircuits/hc2/actualSupplyTemperature doesn not exist: 404, message='Not Found', url='http://172.16.43.14/heatingCircuits/hc2/actualSupplyTemperature'
2025-01-06 13:51:30.019 WARNING (MainThread) [ring_doorbell.doorbot] Your Ring account does not have an active subscription.
2025-01-06 13:52:19.086 WARNING (MainThread) [bosch_thermostat_client.sensors.sensor] Can't update data for Actual supply temperature for HC. Trying uri: /heatingCircuits/hc2/actualSupplyTemperature. Error message: URI /heatingCircuits/hc2/actualSupplyTemperature doesn not exist: 404, message='Not Found', url='http://172.16.43.14/heatingCircuits/hc2/actualSupplyTemperature'
2025-01-06 13:53:19.026 WARNING (MainThread) [bosch_thermostat_client.sensors.sensor] Can't update data for Actual supply temperature for HC. Trying uri: /heatingCircuits/hc2/actualSupplyTemperature. Error message: URI /heatingCircuits/hc2/actualSupplyTemperature doesn not exist: 404, message='Not Found', url='http://172.16.43.14/heatingCircuits/hc2/actualSupplyTemperature'
2025-01-06 13:53:19.165 DEBUG (MainThread) [custom_components.solarman.config_flow] ConfigFlowHandler.async_get_options_flow: <ConfigEntry entry_id=01J6HE6KWV1C1TCW7KWWF1WJWR version=1 domain=solarman title=Inverter state=ConfigEntryState.SETUP_ERROR unique_id=None>
2025-01-06 13:53:19.165 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.__init__: <ConfigEntry entry_id=01J6HE6KWV1C1TCW7KWWF1WJWR version=1 domain=solarman title=Inverter state=ConfigEntryState.SETUP_ERROR unique_id=None>
2025-01-06 13:53:19.166 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.async_step_init: user_input: None, current: {'host': '172.16.43.200', 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400}}
2025-01-06 13:53:19.171 DEBUG (MainThread) [custom_components.solarman.config_flow] step_user_data_schema: custom_components/solarman/inverter_definitions/: ['Auto', 'afore_2mppt.yaml', 'afore_BNTxxxKTL-2mppt.yaml', 'afore_hybrid.yaml', 'chint_cps-scetl.yaml', 'deye_hybrid.yaml', 'deye_micro.yaml', 'deye_p3.yaml', 'deye_string.yaml', 'invt_xd-tl.yaml', 'kstar_hybrid.yaml', 'megarevo_r-3h.yaml', 'pylontech_Force-H+.yaml', 'pylontech_Force-H.yaml', 'renon_ifl.yaml', 'sofar_g3hyd.yaml', 'sofar_hyd-es.yaml', 'sofar_lsw3.yaml', 'sofar_tlx-g3.yaml', 'sofar_wifikit.yaml', 'solarman_dtsd422-d3.yaml', 'solis_1p-5g.yaml', 'solis_3p-4g+.yaml', 'solis_3p-4g.yaml', 'solis_3p-5g.yaml', 'solis_hybrid.yaml', 'solis_s6-gr1p.yaml', 'swatten_sih-th.yaml', 'tsun_tsol-ms.yaml', 'zcs_azzurro-1ph-tl-v3.yaml', 'zcs_azzurro-hyd-zss-hp.yaml', 'zcs_azzurro-ktl-v3.yaml']
2025-01-06 13:53:19.172 DEBUG (MainThread) [custom_components.solarman.config_flow] step_user_data_schema: data_schema: {'host': <class 'str'>, 'port': All(Coerce(int, msg=None), Range(min=1, max=65535, min_included=True, max_included=True, msg=None), msg=None), 'lookup_file': In(['Auto', 'afore_2mppt.yaml', 'afore_BNTxxxKTL-2mppt.yaml', 'afore_hybrid.yaml', 'chint_cps-scetl.yaml', 'deye_hybrid.yaml', 'deye_micro.yaml', 'deye_p3.yaml', 'deye_string.yaml', 'invt_xd-tl.yaml', 'kstar_hybrid.yaml', 'megarevo_r-3h.yaml', 'pylontech_Force-H+.yaml', 'pylontech_Force-H.yaml', 'renon_ifl.yaml', 'sofar_g3hyd.yaml', 'sofar_hyd-es.yaml', 'sofar_lsw3.yaml', 'sofar_tlx-g3.yaml', 'sofar_wifikit.yaml', 'solarman_dtsd422-d3.yaml', 'solis_1p-5g.yaml', 'solis_3p-4g+.yaml', 'solis_3p-4g.yaml', 'solis_3p-5g.yaml', 'solis_hybrid.yaml', 'solis_s6-gr1p.yaml', 'swatten_sih-th.yaml', 'tsun_tsol-ms.yaml', 'zcs_azzurro-1ph-tl-v3.yaml', 'zcs_azzurro-hyd-zss-hp.yaml', 'zcs_azzurro-ktl-v3.yaml']), 'additional_options': <homeassistant.data_entry_flow.section object at 0x7f52fcaa50>}
2025-01-06 13:53:20.320 DEBUG (MainThread) [custom_components.solarman.config_flow] OptionsFlowHandler.async_step_init: user_input: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}, current: {'host': '172.16.43.200', 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400}}
2025-01-06 13:53:20.320 DEBUG (MainThread) [custom_components.solarman.config_flow] validate_connection: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}
2025-01-06 13:53:20.320 DEBUG (MainThread) [custom_components.solarman.config_flow] validate_connection: validation passed: {'host': '172.16.43.200', 'port': 8899, 'lookup_file': 'sofar_g3hyd.yaml', 'additional_options': {'battery_nominal_voltage': 400, 'mod': False, 'phase': 3, 'mppt': 4, 'battery_life_cycle_rating': 6000, 'mb_slave_id': 1}}

@davidrapan
Copy link
Owner

davidrapan commented Jan 6, 2025

That first part is not full error and in this state I have no chance to find out what the error is about.

@davidreher
Copy link

davidreher commented Jan 6, 2025

You are right, I missed a crucial part in the first log: ValueError: Unique id 'inverter_2714000940_ambient_temperature_sensor' is already in use by 'sensor.inverter_ambient_temperature' ... sorry.

I also updated to log at the top ...

@davidrapan
Copy link
Owner

That should not happen. You can fix that by removing and re-adding device back.

@davidreher
Copy link

That did solve it for me 🎉

@Pstart
Copy link
Author

Pstart commented Jan 8, 2025

@davidrapan attachment it is my debug log. Now I have
Core 2025.1.1
Supervisor 2024.12.3
Operating System 14.1
There are always invalid values:
home-assistant_2025-01-08T10-45-20.455Z.log

ActivePower_PCC_R - 65,496 W
ActivePower_PCC_S - 65,496 W
ActivePower_PCC_T - 65,506 W
ActivePower_PCC_Total - 65,406 W

@Pstart
Copy link
Author

Pstart commented Jan 8, 2025

Hi @davidrapan, attached log is good?

@davidrapan
Copy link
Owner

I need debug log from latest version of integration (and correctly formatted if possible).

@Pstart
Copy link
Author

Pstart commented Jan 17, 2025

Hi @davidrapan , all is latest version
Home Assistant

Core 2025.1.2
Supervisor 2024.12.3
Operating System 14.1
Frontend 20250109.0
Solarman 24.12.22

home-assistant_solarman_2025-01-17T11-25-22.125Z.log

@davidrapan
Copy link
Owner

davidrapan commented Jan 17, 2025

F*ck, there is an error w/ if statement somewhere

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

which prevents most of the requests from completion.

But it has nothing to do w/ the original issue though.

@davidrapan
Copy link
Owner

davidrapan commented Jan 26, 2025

fix: ValueError: The truth value of an array with more than one element is ambiguous for the issue above.

And can someone test latest version of the code in the repo (requires manual installation) and change row

value += (temp & 0xFFFF) << shift

to

            value += int((temp & 0xFFFF) << shift)

and see if it helps w/ reporting of incorrect values?

Thanks!

@davidrapan
Copy link
Owner

davidrapan commented Jan 27, 2025

Hi @githubDante, would you mind help me understand what's going on?

  • They introduced Python 3.13 in HA 2024.12
  • Reading of signed int (in some occasions) is now producing RuntimeWarning: overflow encountered in scalar multiply/subtract/...
  • int(X) beforehand is possibly solving the issue?

I don't want to just blatantly fix it and call it a day, but rather understand what they did?

@werfpsa
Copy link

werfpsa commented Jan 27, 2025

I can only test the latest version next week when back 'home'. Hope someone else can do before....

@werfpsa
Copy link

werfpsa commented Feb 5, 2025

Yes.
{
"domain": "solarman",
"name": "Solarman",
"codeowners": ["@davidrapan"],
"config_flow": true,
"dependencies": ["network", "template", "dhcp"],
"documentation": "https://github.com/davidrapan/ha-solarman",
"integration_type": "device",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/davidrapan/ha-solarman/issues",
"loggers": ["pymodbus"],
"requirements": ["propcache", "aiofiles", "pyyaml", "pymodbus==3.8.3"],
"version": "24.12.22"

@davidrapan
Copy link
Owner

davidrapan commented Feb 5, 2025

So, your installation is not updating modules for some reason.

@werfpsa
Copy link

werfpsa commented Feb 5, 2025

Maybe a problem with the DEV zip file not correct?

ha-solarman-dev.zip

@werfpsa
Copy link

werfpsa commented Feb 5, 2025

If I install the zip files in the folder I have the not loaded problem.
Installing the old files again gives no problem with starting

@davidrapan
Copy link
Owner

No, HA should install pymodbus==3.8.3 module during startup but he's not for some reason.

@werfpsa
Copy link

werfpsa commented Feb 5, 2025 via email

@davidrapan
Copy link
Owner

davidrapan commented Feb 5, 2025

Can this have influence?

Nope.

Can I install pymodbus by hand?

Yes, but it's not that easy. You would need to run pip install pymodbus --upgrade inside supervisor. You can try to google exact steps for your specific installation: HAOS, containerized, etc.

Or you can wait few hours for new core release as 3.8.3 will be part of it natively.

@werfpsa
Copy link

werfpsa commented Feb 5, 2025 via email

@davidrapan
Copy link
Owner

davidrapan commented Feb 5, 2025

Still the same error

It's not the same error, just status report which can have only two states [Loaded, Not loaded]. Error is completely different...

Remove and re-add device back.

@werfpsa
Copy link

werfpsa commented Feb 5, 2025 via email

@davidrapan
Copy link
Owner

You are doing something wrong then.

@werfpsa
Copy link

werfpsa commented Feb 5, 2025 via email

@davidrapan
Copy link
Owner

davidrapan commented Feb 5, 2025

I told you to remove and re-add device back after restart...

Steps:

  • Copy over all dev files
  • Restart HA
  • Remove device
  • Re-add back again

Edit: And if it still doesn't work then enable debug log and try to add device w/ it enabled... Always attach debug log, ALWAYS. I can't conjure up what's happening w/o it. "It doesn't work" is never enough information, NEVER.

@davidrapan davidrapan added the invalid This doesn't seem right label Feb 5, 2025
@werfpsa
Copy link

werfpsa commented Feb 5, 2025 via email

@davidrapan
Copy link
Owner

Add device w/ debug log enabled.

@werfpsa
Copy link

werfpsa commented Feb 5, 2025 via email

@werfpsa
Copy link

werfpsa commented Feb 6, 2025 via email

@davidrapan
Copy link
Owner

pymodbus==3.8.3 is missing again. Did you update to new Ha Core release?

@werfpsa
Copy link

werfpsa commented Feb 6, 2025 via email

@werfpsa
Copy link

werfpsa commented Feb 6, 2025 via email

@werfpsa
Copy link

werfpsa commented Feb 6, 2025

Just a question....
Why do you need pymodbus 3.8.3? can you not do with 3.7.4?

@davidrapan
Copy link
Owner

Because the code is written for 3.8.3. Update HA Core.

@werfpsa
Copy link

werfpsa commented Feb 6, 2025 via email

@davidrapan
Copy link
Owner

I'm glad you made it! 🎉

@werfpsa
Copy link

werfpsa commented Feb 6, 2025 via email

@werfpsa
Copy link

werfpsa commented Feb 6, 2025

@davidrapan
Copy link
Owner

davidrapan commented Feb 6, 2025

Update integration from main because I don't know which version of dev are you running now.

Edit: Try latest 912b9f9

@werfpsa
Copy link

werfpsa commented Feb 6, 2025 via email

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

Successfully merging a pull request may close this issue.

8 participants