keshavdv / victron-hacs

Home Assistant plug-in for Victron Instant Readout compatible devices
60 stars 21 forks source link

No data anymore in homeassistant #116

Open MarkusPVHM opened 4 months ago

MarkusPVHM commented 4 months ago

After updates in home assistant, there is no transfer of data anymore. Advertisement key and addresses are correct.

rmrozinsky commented 4 months ago

All my Victron Energy devices now indicate they have failed to set up. This is a fairly recent occurrence that I would guess coincided with upgrading the HA software. The following is from my logs on one of the devices:

Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 6:31:31 AM (2 occurrences) Last logged: 7:02:43 AM

Error setting up entry SmartBatterySense for victron_ble Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/victron_ble/sensor.py", line 216, in PassiveBluetoothDataProcessor[Optional[Union[float, int]]]


  File "/usr/local/lib/python3.12/typing.py", line 384, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/typing.py", line 1066, in _generic_class_getitem
    _check_generic(cls, params, len(cls.__parameters__))
  File "/usr/local/lib/python3.12/site-packages/typing_extensions.py", line 2947, in _check_generic
    raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments"
TypeError: Too few arguments for <class 'homeassistant.components.bluetooth.passive_update_processor.PassiveBluetoothDataProcessor'>; actual 1, expected at least 2

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/victron_ble/__init__.py", line 36, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, in async_forward_entry_setups
    await integration.async_get_platforms(platforms)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1162, in async_get_platforms
    import_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1150, in async_get_platforms
    platforms.update(self._load_platforms(platform_names))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, in _load_platforms
    platform_name: self._load_platform(platform_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1269, in _load_platform
    raise ImportError(
ImportError: Exception importing custom_components.victron_ble.sensor
taylor-snow33 commented 4 months ago

I have a pull request for a fix to the sensor.py file in how it works with HA Core's PassiveBluetoothDataProcessor. https://github.com/keshavdv/victron-hacs/pull/117/commits/72f3ef29db91438a2cd0df9f1f4ba42ea85b65b4

You can use my sensor.py file as a quick hack to get this working until merged.

wmichael3 commented 4 months ago

Confirmed that the new sensor.py fixed it for me - SmartSolar and SmartShunt.

MarkusPVHM commented 4 months ago

Thank you very much, by editing the sensor.py it is working again

rmrozinsky commented 4 months ago

Not sure what I'm doing wrong. I edited the sensor.py file to what was provided. The entities are still not found. The following is what is annotated in the logs:

Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 7:01:08 PM (2 occurrences) Last logged: 7:01:08 PM

Error setting up entry SmartSolar MPPT for victron_ble Error setting up entry SmartBMV 712 for victron_ble Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 991, in exec_module File "", line 1129, in get_code File "", line 1059, in source_to_code File "", line 488, in _call_with_frames_removed File "/config/custom_components/victron_ble/sensor.py", line 198 PassiveBluetoothDataProcessor[Optional[Union[float, int]]] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma?

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/init.py", line 36, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, in async_forward_entry_setups await integration.async_get_platforms(platforms) File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in async_get_platforms platforms[platform_name] = await future ^^^^^^^^^^^^ ImportError: Exception importing custom_components.victron_ble.sensor

On Sat, Jun 8, 2024 at 3:48 PM MarkusPVHM @.***> wrote:

Thank you very much, by editing the sensor.py it is working again

— Reply to this email directly, view it on GitHub https://github.com/keshavdv/victron-hacs/issues/116#issuecomment-2156177892, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIMEU7ENR753CCE2J3DLJODZGNUZNAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE3TOOBZGI . You are receiving this because you commented.Message ID: @.***>

taylor-snow33 commented 4 months ago

Not sure what I'm doing wrong. I edited the sensor.py file to what was

provided. The entities are still not found. The following is what is

annotated in the logs:

Logger: homeassistant.config_entries

Source: config_entries.py:594

First occurred: 7:01:08 PM (2 occurrences)

Last logged: 7:01:08 PM

Error setting up entry SmartSolar MPPT for victron_ble

Error setting up entry SmartBMV 712 for victron_ble

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in

_load_platform

cache[full_name] = self._import_platform(platform_name)

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in

_import_platform

return importlib.import_module(f"{self.pkg_path}.{platform_name}")

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in

protected_loop_func

return func(*args, **kwargs)

       ^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/importlib/init.py", line 90, in

import_module

return _bootstrap._gcd_import(name[level:], package, level)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "", line 1387, in _gcd_import

File "", line 1360, in _find_and_load

File "", line 1331, in

_find_and_load_unlocked

File "", line 935, in _load_unlocked

File "", line 991, in exec_module

File "", line 1129, in get_code

File "", line 1059, in

source_to_code

File "", line 488, in

_call_with_frames_removed

File "/config/custom_components/victron_ble/sensor.py", line 198

PassiveBluetoothDataProcessor[Optional[Union[float, int]]]

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: invalid syntax. Perhaps you forgot a comma?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594,

in async_setup

result = await component.async_setup_entry(hass, self)

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/config/custom_components/victron_ble/init.py", line 36, in

async_setup_entry

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031,

in async_forward_entry_setups

await integration.async_get_platforms(platforms)

File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in

async_get_platforms

platforms[platform_name] = await future

                           ^^^^^^^^^^^^

ImportError: Exception importing custom_components.victron_ble.sensor

On Sat, Jun 8, 2024 at 3:48 PM MarkusPVHM @.***> wrote:

Thank you very much, by editing the sensor.py it is working again

Reply to this email directly, view it on GitHub

https://github.com/keshavdv/victron-hacs/issues/116#issuecomment-2156177892,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AIMEU7ENR753CCE2J3DLJODZGNUZNAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE3TOOBZGI

.

You are receiving this because you commented.Message ID:

@.***>

It appears you have a syntax error or missing comma. Double check your copy paste of the file. Should be fine but happy to look further in the morning if needed.

rmrozinsky commented 4 months ago

Thanks, I appreciate the help. I'm doing a copy and paste from the file provided. I did find the missing comma. However, it didn't resolve the issue. Here is a copy of the error from my logs:

Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 8:27:41 PM (2 occurrences) Last logged: 8:27:41 PM

Error setting up entry SmartSolar MPPT for victron_ble Error setting up entry SmartBMV 712 for victron_ble Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/victron_ble/sensor.py", line 198, in

PassiveBluetoothDataProcessor[Optional[Union[float, int]]], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 384, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 1066, in _generic_class_getitem _check_generic(cls, params, len(cls.__parameters__)) File "/usr/local/lib/python3.12/site-packages/typing_extensions.py", line 2947, in _check_generic raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments" TypeError: Too few arguments for ; actual 1, expected at least 2 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/__init__.py", line 36, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, in async_forward_entry_setups await integration.async_get_platforms(platforms) File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in async_get_platforms platforms[platform_name] = await future ^^^^^^^^^^^^ ImportError: Exception importing custom_components.victron_ble.sensor On Sat, Jun 8, 2024 at 8:15 PM Taylor Snow ***@***.***> wrote: > Not sure what I'm doing wrong. I edited the sensor.py file to what was > > provided. The entities are still not found. The following is what is > > annotated in the logs: > > Logger: homeassistant.config_entries > > Source: config_entries.py:594 > > First occurred: 7:01:08 PM (2 occurrences) > > Last logged: 7:01:08 PM > > Error setting up entry SmartSolar MPPT for victron_ble > > Error setting up entry SmartBMV 712 for victron_ble > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in > > _load_platform > > cache[full_name] = self._import_platform(platform_name) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in > > _import_platform > > return importlib.import_module(f"{self.pkg_path}.{platform_name}") > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in > > protected_loop_func > > return func(*args, **kwargs) > > ^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/local/lib/python3.12/importlib/*init*.py", line 90, in > > import_module > > return _bootstrap._gcd_import(name[level:], package, level) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "", line 1387, in _gcd_import > > File "", line 1360, in _find_and_load > > File "", line 1331, in > > _find_and_load_unlocked > > File "", line 935, in _load_unlocked > > File "", line 991, in exec_module > > File "", line 1129, in get_code > > File "", line 1059, in > > source_to_code > > File "", line 488, in > > _call_with_frames_removed > > File "/config/custom_components/victron_ble/sensor.py", line 198 > > PassiveBluetoothDataProcessor[Optional[Union[float, int]]] > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > SyntaxError: invalid syntax. Perhaps you forgot a comma? > > The above exception was the direct cause of the following exception: > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, > > in async_setup > > result = await component.async_setup_entry(hass, self) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/config/custom_components/victron_ble/*init*.py", line 36, in > > async_setup_entry > > await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, > > in async_forward_entry_setups > > await integration.async_get_platforms(platforms) > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in > > async_get_platforms > > platforms[platform_name] = await future > > ^^^^^^^^^^^^ > > ImportError: Exception importing custom_components.victron_ble.sensor > > On Sat, Jun 8, 2024 at 3:48 PM MarkusPVHM *@*.***> wrote: > > Thank you very much, by editing the sensor.py it is working again > > — > > Reply to this email directly, view it on GitHub > > #116 (comment) > > , > > or unsubscribe > > > https://github.com/notifications/unsubscribe-auth/AIMEU7ENR753CCE2J3DLJODZGNUZNAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE3TOOBZGI > > . > > You are receiving this because you commented.Message ID: > > *@*.***> > > It appears you have a syntax error or missing comma. Double check your > copy paste of the file. Should be fine but happy to look further in the > morning if needed. > > — > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . > You are receiving this because you commented.Message ID: > ***@***.***> >
rmrozinsky commented 4 months ago

Any chance anyone has any insight into why Taylor's sensor.py is not working for me? Seems straight forward, but I not getting good results. Basically, cut and paste Taylor's file into /homeassistant/custom_components/victron_ble/sensor.py, and restarted HA.

I'd sure like to get this working again. Thanks.

On Sat, Jun 8, 2024 at 8:40 PM Richard Mrozinsky @.***> wrote:

Thanks, I appreciate the help. I'm doing a copy and paste from the file provided. I did find the missing comma. However, it didn't resolve the issue. Here is a copy of the error from my logs:

Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 8:27:41 PM (2 occurrences) Last logged: 8:27:41 PM

Error setting up entry SmartSolar MPPT for victron_ble Error setting up entry SmartBMV 712 for victron_ble Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/victron_ble/sensor.py", line 198, in

PassiveBluetoothDataProcessor[Optional[Union[float, int]]], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 384, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 1066, in _generic_class_getitem _check_generic(cls, params, len(cls.__parameters__)) File "/usr/local/lib/python3.12/site-packages/typing_extensions.py", line 2947, in _check_generic raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments" TypeError: Too few arguments for ; actual 1, expected at least 2 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/__init__.py", line 36, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, in async_forward_entry_setups await integration.async_get_platforms(platforms) File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in async_get_platforms platforms[platform_name] = await future ^^^^^^^^^^^^ ImportError: Exception importing custom_components.victron_ble.sensor On Sat, Jun 8, 2024 at 8:15 PM Taylor Snow ***@***.***> wrote: > Not sure what I'm doing wrong. I edited the sensor.py file to what was > > provided. The entities are still not found. The following is what is > > annotated in the logs: > > Logger: homeassistant.config_entries > > Source: config_entries.py:594 > > First occurred: 7:01:08 PM (2 occurrences) > > Last logged: 7:01:08 PM > > Error setting up entry SmartSolar MPPT for victron_ble > > Error setting up entry SmartBMV 712 for victron_ble > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in > > _load_platform > > cache[full_name] = self._import_platform(platform_name) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in > > _import_platform > > return importlib.import_module(f"{self.pkg_path}.{platform_name}") > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in > > protected_loop_func > > return func(*args, **kwargs) > > ^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/local/lib/python3.12/importlib/*init*.py", line 90, in > > import_module > > return _bootstrap._gcd_import(name[level:], package, level) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "", line 1387, in _gcd_import > > File "", line 1360, in _find_and_load > > File "", line 1331, in > > _find_and_load_unlocked > > File "", line 935, in _load_unlocked > > File "", line 991, in exec_module > > File "", line 1129, in get_code > > File "", line 1059, in > > source_to_code > > File "", line 488, in > > _call_with_frames_removed > > File "/config/custom_components/victron_ble/sensor.py", line 198 > > PassiveBluetoothDataProcessor[Optional[Union[float, int]]] > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > SyntaxError: invalid syntax. Perhaps you forgot a comma? > > The above exception was the direct cause of the following exception: > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, > > in async_setup > > result = await component.async_setup_entry(hass, self) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/config/custom_components/victron_ble/*init*.py", line 36, in > > async_setup_entry > > await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, > > in async_forward_entry_setups > > await integration.async_get_platforms(platforms) > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in > > async_get_platforms > > platforms[platform_name] = await future > > ^^^^^^^^^^^^ > > ImportError: Exception importing custom_components.victron_ble.sensor > > On Sat, Jun 8, 2024 at 3:48 PM MarkusPVHM *@*.***> wrote: > > Thank you very much, by editing the sensor.py it is working again > > — > > Reply to this email directly, view it on GitHub > > #116 (comment) > > , > > or unsubscribe > > > https://github.com/notifications/unsubscribe-auth/AIMEU7ENR753CCE2J3DLJODZGNUZNAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE3TOOBZGI > > . > > You are receiving this because you commented.Message ID: > > *@*.***> > > It appears you have a syntax error or missing comma. Double check your > copy paste of the file. Should be fine but happy to look further in the > morning if needed. > > — > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . > You are receiving this because you commented.Message ID: > ***@***.***> >
MarkusPVHM commented 4 months ago

You can not copy paste the file. You have to edit your original file, remove or add the relevant lines there... Von meinem HONOR-Telefon gesendet-------- Ursprüngliche Nachricht --------Von: rmrozinsky @.>Datum: Di., 11. Juni 2024, 03:04An: keshavdv/victron-hacs @.>Cc: MarkusPVHM @.>, Author @.>Betreff: Re: [keshavdv/victron-hacs] No data anymore in homeassistant (Issue #116) Any chance anyone has any insight into why Taylor's sensor.py is not

working for me? Seems straight forward, but I not getting good results.

Basically, cut and paste Taylor's file

into /homeassistant/custom_components/victron_ble/sensor.py, and restarted

HA.

I'd sure like to get this working again. Thanks.

On Sat, Jun 8, 2024 at 8:40 PM Richard Mrozinsky @.***>

wrote:

Thanks, I appreciate the help. I'm doing a copy and paste from the file

provided. I did find the missing comma. However, it didn't resolve the

issue. Here is a copy of the error from my logs:

Logger: homeassistant.config_entries

Source: config_entries.py:594

First occurred: 8:27:41 PM (2 occurrences)

Last logged: 8:27:41 PM

Error setting up entry SmartSolar MPPT for victron_ble

Error setting up entry SmartBMV 712 for victron_ble

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in

_load_platform

cache[full_name] = self._import_platform(platform_name)

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in

_import_platform

return importlib.import_module(f"{self.pkg_path}.{platform_name}")

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in

protected_loop_func

return func(*args, **kwargs)

       ^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/importlib/init.py", line 90, in

import_module

return _bootstrap._gcd_import(name[level:], package, level)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "", line 1387, in _gcd_import

File "", line 1360, in _find_and_load

File "", line 1331, in

_find_and_load_unlocked

File "", line 935, in _load_unlocked

File "", line 995, in exec_module

File "", line 488, in

_call_with_frames_removed

File "/config/custom_components/victron_ble/sensor.py", line 198, in

PassiveBluetoothDataProcessor[Optional[Union[float, int]]], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 384, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 1066, in _generic_class_getitem _check_generic(cls, params, len(cls.__parameters__)) File "/usr/local/lib/python3.12/site-packages/typing_extensions.py", line 2947, in _check_generic raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments" TypeError: Too few arguments for ; actual 1, expected at least 2 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/__init__.py", line 36, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, in async_forward_entry_setups await integration.async_get_platforms(platforms) File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in async_get_platforms platforms[platform_name] = await future ^^^^^^^^^^^^ ImportError: Exception importing custom_components.victron_ble.sensor On Sat, Jun 8, 2024 at 8:15 PM Taylor Snow ***@***.***> wrote: > Not sure what I'm doing wrong. I edited the sensor.py file to what was > > provided. The entities are still not found. The following is what is > > annotated in the logs: > > Logger: homeassistant.config_entries > > Source: config_entries.py:594 > > First occurred: 7:01:08 PM (2 occurrences) > > Last logged: 7:01:08 PM > > Error setting up entry SmartSolar MPPT for victron_ble > > Error setting up entry SmartBMV 712 for victron_ble > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in > > _load_platform > > cache[full_name] = self._import_platform(platform_name) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in > > _import_platform > > return importlib.import_module(f"{self.pkg_path}.{platform_name}") > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in > > protected_loop_func > > return func(*args, **kwargs) > > ^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/local/lib/python3.12/importlib/*init*.py", line 90, in > > import_module > > return _bootstrap._gcd_import(name[level:], package, level) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "", line 1387, in _gcd_import > > File "", line 1360, in _find_and_load > > File "", line 1331, in > > _find_and_load_unlocked > > File "", line 935, in _load_unlocked > > File "", line 991, in exec_module > > File "", line 1129, in get_code > > File "", line 1059, in > > source_to_code > > File "", line 488, in > > _call_with_frames_removed > > File "/config/custom_components/victron_ble/sensor.py", line 198 > > PassiveBluetoothDataProcessor[Optional[Union[float, int]]] > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > SyntaxError: invalid syntax. Perhaps you forgot a comma? > > The above exception was the direct cause of the following exception: > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, > > in async_setup > > result = await component.async_setup_entry(hass, self) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/config/custom_components/victron_ble/*init*.py", line 36, in > > async_setup_entry > > await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, > > in async_forward_entry_setups > > await integration.async_get_platforms(platforms) > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in > > async_get_platforms > > platforms[platform_name] = await future > > ^^^^^^^^^^^^ > > ImportError: Exception importing custom_components.victron_ble.sensor > > On Sat, Jun 8, 2024 at 3:48 PM MarkusPVHM *@*.***> wrote: > > Thank you very much, by editing the sensor.py it is working again > > — > > Reply to this email directly, view it on GitHub > > #116 (comment) > > , > > or unsubscribe > > > https://github.com/notifications/unsubscribe-auth/AIMEU7ENR753CCE2J3DLJODZGNUZNAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE3TOOBZGI > > . > > You are receiving this because you commented.Message ID: > > *@*.***> > > It appears you have a syntax error or missing comma. Double check your > copy paste of the file. Should be fine but happy to look further in the > morning if needed. > > — > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . > You are receiving this because you commented.Message ID: > ***@***.***> >

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

rmrozinsky commented 4 months ago

Thanks, learning something new all the time. I restored the previous version of HA because I felt I really screwed up the sensor.py doing the full copy and paste. When I did that, all the sensors started working. Am I correct that the sensor.py fix is required because of a conflict with HA Core 2024.6.1? I think I'll leave things as they are for now and wait until the new sensor.py file is merged. How will I be able to tell when that happens?

Thanks for the hard work. The ability to monitor the Victron sensors remotely is very helpful.

On Tue, Jun 11, 2024 at 12:25 AM MarkusPVHM @.***> wrote:

You can not copy paste the file. You have to edit your original file, remove or add the relevant lines there... Von meinem HONOR-Telefon gesendet-------- Ursprüngliche Nachricht --------Von: rmrozinsky @.>Datum: Di., 11. Juni 2024, 03:04An: keshavdv/victron-hacs @.>Cc: MarkusPVHM @.>, Author @.>Betreff: Re: [keshavdv/victron-hacs] No data anymore in homeassistant (Issue #116) Any chance anyone has any insight into why Taylor's sensor.py is not

working for me? Seems straight forward, but I not getting good results.

Basically, cut and paste Taylor's file

into /homeassistant/custom_components/victron_ble/sensor.py, and restarted

HA.

I'd sure like to get this working again. Thanks.

On Sat, Jun 8, 2024 at 8:40 PM Richard Mrozinsky @.***>

wrote:

Thanks, I appreciate the help. I'm doing a copy and paste from the file

provided. I did find the missing comma. However, it didn't resolve the

issue. Here is a copy of the error from my logs:

Logger: homeassistant.config_entries

Source: config_entries.py:594

First occurred: 8:27:41 PM (2 occurrences)

Last logged: 8:27:41 PM

Error setting up entry SmartSolar MPPT for victron_ble

Error setting up entry SmartBMV 712 for victron_ble

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in

_load_platform

cache[full_name] = self._import_platform(platform_name)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in

_import_platform

return importlib.import_module(f"{self.pkg_path}.{platform_name}")

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in

protected_loop_func

return func(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/importlib/init.py", line 90, in

import_module

return _bootstrap._gcd_import(name[level:], package, level)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "", line 1387, in _gcd_import

File "", line 1360, in _find_and_load

File "", line 1331, in

_find_and_load_unlocked

File "", line 935, in _load_unlocked

File "", line 995, in exec_module

File "", line 488, in

_call_with_frames_removed

File "/config/custom_components/victron_ble/sensor.py", line 198, in

PassiveBluetoothDataProcessor[Optional[Union[float, int]]], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 384, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/typing.py", line 1066, in _generic_class_getitem _check_generic(cls, params, len(cls.__parameters__)) File "/usr/local/lib/python3.12/site-packages/typing_extensions.py", line 2947, in _check_generic raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments" TypeError: Too few arguments for ; actual 1, expected at least 2 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/__init__.py", line 36, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, in async_forward_entry_setups await integration.async_get_platforms(platforms) File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in async_get_platforms platforms[platform_name] = await future ^^^^^^^^^^^^ ImportError: Exception importing custom_components.victron_ble.sensor On Sat, Jun 8, 2024 at 8:15 PM Taylor Snow ***@***.***> wrote: > Not sure what I'm doing wrong. I edited the sensor.py file to what was > > provided. The entities are still not found. The following is what is > > annotated in the logs: > > Logger: homeassistant.config_entries > > Source: config_entries.py:594 > > First occurred: 7:01:08 PM (2 occurrences) > > Last logged: 7:01:08 PM > > Error setting up entry SmartSolar MPPT for victron_ble > > Error setting up entry SmartBMV 712 for victron_ble > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in > > _load_platform > > cache[full_name] = self._import_platform(platform_name) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in > > _import_platform > > return importlib.import_module(f"{self.pkg_path}.{platform_name}") > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in > > protected_loop_func > > return func(*args, **kwargs) > > ^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/local/lib/python3.12/importlib/*init*.py", line 90, in > > import_module > > return _bootstrap._gcd_import(name[level:], package, level) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "", line 1387, in _gcd_import > > File "", line 1360, in _find_and_load > > File "", line 1331, in > > _find_and_load_unlocked > > File "", line 935, in _load_unlocked > > File "", line 991, in exec_module > > File "", line 1129, in get_code > > File "", line 1059, in > > source_to_code > > File "", line 488, in > > _call_with_frames_removed > > File "/config/custom_components/victron_ble/sensor.py", line 198 > > PassiveBluetoothDataProcessor[Optional[Union[float, int]]] > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > SyntaxError: invalid syntax. Perhaps you forgot a comma? > > The above exception was the direct cause of the following exception: > > Traceback (most recent call last): > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, > > in async_setup > > result = await component.async_setup_entry(hass, self) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/config/custom_components/victron_ble/*init*.py", line 36, in > > async_setup_entry > > await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) > > File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, > > in async_forward_entry_setups > > await integration.async_get_platforms(platforms) > > File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in > > async_get_platforms > > platforms[platform_name] = await future > > ^^^^^^^^^^^^ > > ImportError: Exception importing custom_components.victron_ble.sensor > > On Sat, Jun 8, 2024 at 3:48 PM MarkusPVHM *@*.***> wrote: > > Thank you very much, by editing the sensor.py it is working again > > — > > Reply to this email directly, view it on GitHub > > #116 (comment) > < https://github.com/keshavdv/victron-hacs/issues/116#issuecomment-2156177892> > , > > or unsubscribe > > > https://github.com/notifications/unsubscribe-auth/AIMEU7ENR753CCE2J3DLJODZGNUZNAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE3TOOBZGI > > . > > You are receiving this because you commented.Message ID: > > *@*.***> > > It appears you have a syntax error or missing comma. Double check your > copy paste of the file. Should be fine but happy to look further in the > morning if needed. > > — > Reply to this email directly, view it on GitHub > < https://github.com/keshavdv/victron-hacs/issues/116#issuecomment-2156255308>, > or unsubscribe > < https://github.com/notifications/unsubscribe-auth/AIMEU7GG6D666VKE4HQVNBTZGOUDTAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGI2TKMZQHA> > . > You are receiving this because you commented.Message ID: > ***@***.***> >

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/keshavdv/victron-hacs/issues/116#issuecomment-2159819790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIMEU7DJBITRFVQQ3UMNAODZG2C3RAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJZHAYTSNZZGA . You are receiving this because you commented.Message ID: @.***>

phuse commented 4 months ago

update fixed the data from the Smart solars and smart battery sense but not for BMV-712

JamesPerrins commented 4 months ago

Same for me - smart solars now working but BMV-712 isn't

brooksben11 commented 4 months ago

Finally

update fixed the data from the Smart solars and smart battery sense but not for BMV-712

Same for me - smart solars now working but BMV-712 isn't

Finally got around to making this change; no issues with my BMV-712 reporting data now. I assume you reloaded the integration after making the changes to the file?

JamesPerrins commented 4 months ago

Yes. Reloaded the integration at which point is the solar data appear.

I'm new to this so didn't have a working setup before I just saw others say it didn't for BMV so when I didn't see any sensors I didn't try very hard. If it's working for you I'll have another go.

Thanks James

On Mon, 1 Jul 2024, 16:41 Ben Brooks, @.***> wrote:

Finally

update fixed the data from the Smart solars and smart battery sense but not for BMV-712

Same for me - smart solars now working but BMV-712 isn't

Finally got around to making this change; no issues with my BMV-712 reporting data now. I assume you reloaded the integration after making the changes to the file?

— Reply to this email directly, view it on GitHub https://github.com/keshavdv/victron-hacs/issues/116#issuecomment-2200348155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYL54LD433FJUHH46SCTNOLZKFTCRAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGM2DQMJVGU . You are receiving this because you commented.Message ID: @.***>

JamesPerrins commented 4 months ago

Finally

update fixed the data from the Smart solars and smart battery sense but not for BMV-712

Same for me - smart solars now working but BMV-712 isn't

Finally got around to making this change; no issues with my BMV-712 reporting data now. I assume you reloaded the integration after making the changes to the file?

Well - no amount of removing, readding, refreshing and restarting has managed to get any BMV-712 sensors to show up I'm afraid

brooksben11 commented 4 months ago

Finally

update fixed the data from the Smart solars and smart battery sense but not for BMV-712

Same for me - smart solars now working but BMV-712 isn't

Finally got around to making this change; no issues with my BMV-712 reporting data now. I assume you reloaded the integration after making the changes to the file?

Well - no amount of removing, readding, refreshing and restarting has managed to get any BMV-712 sensors to show up I'm afraid

Weird. You do have 'Instant Readout via Bluetooth' enabled for your BMV-712, correct?

JamesPerrins commented 4 months ago

Weird. You do have 'Instant Readout via Bluetooth' enabled for your BMV-712, correct?

Yep. And latest firmware on BMV-712. HA finds the BMV Mac address OK - I enter advertisment key (even tried changing pin to generate a fresh one) and its added to the list of devices but with "No devices or entities" stated underneath it

brooksben11 commented 4 months ago

Weird. You do have 'Instant Readout via Bluetooth' enabled for your BMV-712, correct?

Yep. And latest firmware on BMV-712. HA finds the BMV Mac address OK - I enter advertisment key (even tried changing pin to generate a fresh one) and its added to the list of devices but with "No devices or entities" stated underneath it

Only other thing I can think of is if a more recent firmware version is causing issues. I very explicitly never upgraded mine after getting this setup as I didn't want them changing something that caused this to stop working as it's the only way I interact with mine anymore. But I'd also think there'd be a bunch of folks on here having the same issue...

JamesPerrins commented 4 months ago

Ok - not sure if this helps - I thought I'd found it but it doesn't seem to have solved it. I did have starter battery voltage display switched off (as its not connected) - so I saw below error in logs and thought bingo! But enabled it and I still get the error below so not as simple as I hoped Thanks for your help

2024-07-01 22:01:01.611 ERROR (MainThread) [custom_components.victron_ble] Unexpected error updating SmartBMV data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 576, in async_handle_update new_data = self.update_method(update) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/sensor.py", line 189, in update_method return sensor_update_to_bluetooth_data_update(sensor_update) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/sensor.py", line 154, in sensor_update_to_bluetooth_data_update ): SENSOR_DESCRIPTIONS[ ^^^^^^^^^^^^^^^^^^^^ KeyError: (<VictronSensor.STARTER_BATTERY_VOLTAGE: 'starter_battery_voltage'>, <Units.ELECTRIC_POTENTIAL_VOLT: 'V'>)

rmrozinsky commented 4 months ago

Just a data point. I did reattempt the recommended changes to the sensor.py file. All went well and all sensors, including the BMV, are working.

JamesPerrins commented 4 months ago

Ha - got it - well sort of - I was nearly there with stater battery setting. I had Misc, Aux Input set to starter battery. If I changed this to "None" it all works. Looking briefly at the code I'd suggest Victron have altered some of the measurement parameters - or else maybe this was a bug in the code originally. It does look as if it sets out to handle the aux parameters in device.py - I think by discarding them - except its not

Anyway - its working for e now :-)

archer37 commented 3 months ago

Ha - got it - well sort of - I was nearly there with stater battery setting. I had Misc, Aux Input set to starter battery. If I changed this to "None" it all works. Looking briefly at the code I'd suggest Victron have altered some of the measurement parameters - or else maybe this was a bug in the code originally. It does look as if it sets out to handle the aux parameters in device.py - I think by discarding them - except its not

Anyway - its working for e now :-)

Thanks James! I was having the same issue with the 712 and no entities in HA, but after updating the Aux Input setting in the Victron App and reloading the HA Integration, I now have my battery entities again. (except for Starter voltage, but I use the HA info more that I use the stater volt info.)

Oldie-driver commented 3 months ago

I have a pull request for a fix to the sensor.py file in how it works with HA Core's PassiveBluetoothDataProcessor. 72f3ef2

You can use my sensor.py file as a quick hack to get this working until merged.

Thanks very much. It is here not really working with passive scan on a raspberry 4, need very long time ( more then one hour ) to found maybe all 3 Victron devices. But without your sensor.py, it found in any case no device. Active scan work now perfect.

Maybe, this patch should merged, help beginner like me. I need a week for found add-one fileeditor^^

rmrozinsky commented 2 months ago

I just updated HA to 24.8.1 and lost all my Victron sensors again. I verified previous changes to the sensor.py were still intact. Has anyone else had this problem? If all else fails I guess I can roll back the update.

archer37 commented 2 months ago

I just updated HA to 24.8.1 and lost all my Victron sensors again. I verified previous changes to the sensor.py were still intact. Has anyone else had this problem? If all else fails I guess I can roll back the update.

I upgraded to 24.8.1 this morning, and experienced no change in Victron data function. I only have the BMV-712, but all data is still coming across as expected (post- sensor.py fix).

Oldie-driver commented 2 months ago

Core 2024.8.1 Supervisor 2024.08.0 Operating System 12.4 Frontend 20240809.0

Work here with Smartblue Charger 100/30, 75/15 and a Smartshunt on a Raspberry 4+

rmrozinsky commented 2 months ago

Thanks, archer37 and Oldie. I now believe it has to do with my encryption key used by my esp32 bluetooth device. Your response was helpful in eliminating an upgrade issue.

velo443 commented 2 months ago

Thanks for the fix.

brickatius commented 2 months ago

I had the same issue. Error Log showed: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 575, in async_handle_update new_data = self.update_method(update) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/sensor.py", line 172, in sensor_update_to_bluetooth_data_update ): SENSOR_DESCRIPTIONS[ ^^^^^^^^^^^^^^^^^^^^ KeyError: (<VictronSensor.EXTERNAL_DEVICE_LOAD: 'external_device_load'>, <Units.ELECTRIC_CURRENT_AMPERE: 'A'>)

Line 93 to 99 in sensor.py read (VictronSensor.EXTERNAL_DEVICE_LOAD, None, ): SensorEntityDescription( key=VictronSensor.EXTERNAL_DEVICE_LOAD, device_class=SensorDeviceClass.CURRENT, (VictronSensor.EXTERNAL_DEVICE_LOAD, Units.ELECTRIC_CURRENT_AMPERE,native_unit_of_measurement=Units.ELECTRIC_CURRENT_AMPERE, state_class=SensorStateClass.MEASUREMENT, ), Change line 93 to this: (VictronSensor.EXTERNAL_DEVICE_LOAD, Units.ELECTRIC_CURRENT_AMPERE,

Reload the integration and all is now working.

seamus65 commented 1 month ago

I made the changes to sensor.py, which looked to have worked, but now I am getting the following error:

Unexpected error updating SmartSolar HQ2135KC9JH data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 371, in _async_handle_bluetooth_event update = self._update_method(service_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/bluetooth_sensor_state_data/init.py", line 70, in update self._start_update(data) File "/config/custom_components/victron_ble/device.py", line 58, in _start_update self._process_mfr_data(address, local_name, mfr_id, mfr_data, service_uuids) File "/config/custom_components/victron_ble/device.py", line 73, in _process_mfr_data parsed = device_parser(self.key).parse(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/solar_charger.py", line 69, in parse decrypted = self.decrypt(data) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/base.py", line 395, in decrypt bytes.fromhex(self.advertisement_key), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: non-hexadecimal number found in fromhex() arg at position 0

And from the debug logs, a little more detail:

2024-09-11 09:19:23.882 DEBUG (MainThread) [custom_components.victron_ble.device] Parsing Victron BLE advertisement data: {737: b'\x10\x02S\xa0\x01W\x82z\x14\x9bTj4(\xe2zd\xd5\x16\x11'} 2024-09-11 09:19:23.882 ERROR (MainThread) [custom_components.victron_ble] Unexpected error updating SmartSolar HQ2135KC9JH data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 371, in _async_handle_bluetooth_event update = self._update_method(service_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/bluetooth_sensor_state_data/init.py", line 70, in update self._start_update(data) File "/config/custom_components/victron_ble/device.py", line 58, in _start_update self._process_mfr_data(address, local_name, mfr_id, mfr_data, service_uuids) File "/config/custom_components/victron_ble/device.py", line 73, in _process_mfr_data parsed = device_parser(self.key).parse(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/solar_charger.py", line 69, in parse decrypted = self.decrypt(data) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/base.py", line 395, in decrypt bytes.fromhex(self.advertisement_key), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: non-hexadecimal number found in fromhex() arg at position 0

Anyone have any tips for this one?

kevinkey619 commented 1 month ago

Not sure what I'm doing wrong. I edited the sensor.py file to what was provided. The entities are still not found. The following is what is annotated in the logs: Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 7:01:08 PM (2 occurrences) Last logged: 7:01:08 PM Error setting up entry SmartSolar MPPT for victron_ble Error setting up entry SmartBMV 712 for victron_ble Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1249, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1281, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, in protected_loop_func return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 991, in exec_module File "", line 1129, in get_code File "", line 1059, in source_to_code File "", line 488, in _call_with_frames_removed File "/config/custom_components/victron_ble/sensor.py", line 198 PassiveBluetoothDataProcessor[Optional[Union[float, int]]] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/init.py", line 36, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2031, in async_forward_entry_setups await integration.async_get_platforms(platforms) File "/usr/src/homeassistant/homeassistant/loader.py", line 1180, in async_get_platforms platforms[platform_name] = await future ^^^^^^^^^^^^ ImportError: Exception importing custom_components.victron_ble.sensor On Sat, Jun 8, 2024 at 3:48 PM MarkusPVHM @.> wrote: Thank you very much, by editing the sensor.py it is working again — Reply to this email directly, view it on GitHub <#116 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIMEU7ENR753CCE2J3DLJODZGNUZNAVCNFSM6AAAAABI7ZZFM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE3TOOBZGI . You are receiving this because you commented.Message ID: @.***>

Be sure line 208 looks like below. I overlooked this change at first. Once I modified it property, things started working.

PassiveBluetoothDataProcessor[Optional[Union[float, int]], SensorUpdate]

seamus65 commented 3 weeks ago

I made the changes to sensor.py, which looked to have worked, but now I am getting the following error:

Unexpected error updating SmartSolar HQ2135KC9JH data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 371, in _async_handle_bluetooth_event update = self._update_method(service_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/bluetooth_sensor_state_data/init.py", line 70, in update self._start_update(data) File "/config/custom_components/victron_ble/device.py", line 58, in _start_update self._process_mfr_data(address, local_name, mfr_id, mfr_data, service_uuids) File "/config/custom_components/victron_ble/device.py", line 73, in _process_mfr_data parsed = device_parser(self.key).parse(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/solar_charger.py", line 69, in parse decrypted = self.decrypt(data) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/base.py", line 395, in decrypt bytes.fromhex(self.advertisement_key), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: non-hexadecimal number found in fromhex() arg at position 0

And from the debug logs, a little more detail:

2024-09-11 09:19:23.882 DEBUG (MainThread) [custom_components.victron_ble.device] Parsing Victron BLE advertisement data: {737: b'\x10\x02S\xa0\x01W\x82z\x14\x9bTj4(\xe2zd\xd5\x16\x11'} 2024-09-11 09:19:23.882 ERROR (MainThread) [custom_components.victron_ble] Unexpected error updating SmartSolar HQ2135KC9JH data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 371, in _async_handle_bluetooth_event update = self._update_method(service_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/bluetooth_sensor_state_data/init.py", line 70, in update self._start_update(data) File "/config/custom_components/victron_ble/device.py", line 58, in _start_update self._process_mfr_data(address, local_name, mfr_id, mfr_data, service_uuids) File "/config/custom_components/victron_ble/device.py", line 73, in _process_mfr_data parsed = device_parser(self.key).parse(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/solar_charger.py", line 69, in parse decrypted = self.decrypt(data) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/victron_ble/devices/base.py", line 395, in decrypt bytes.fromhex(self.advertisement_key), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: non-hexadecimal number found in fromhex() arg at position 0

Anyone have any tips for this one?

I figured it out. There was a single quotation mark in the advertisement key.

Sorted now