keshavdv / victron-hacs

Home Assistant plug-in for Victron Instant Readout compatible devices
55 stars 20 forks source link

No Devices/Entities added #94

Open bvovk opened 1 year ago

bvovk commented 1 year ago

Hi,

thank you for your work!

I was able to retrieve the necessary data but the integration doesn't create any entities.

The address/key data must be OK as your CLI tool (victron read addr@key) is able to read the data provided by Victron equipment.

I am using the ESP32 to scan the BLE and llso the ESPhome (victron-ble) log shows all the provided values.

It seems I'm missing something here, but am at a loss how to proceed...

B.

Boots4747 commented 1 year ago

Same here, the integration doesnt create an entity

wasn-eu commented 1 year ago

same here. The Smart Shunt is found but with no entitites

bvovk commented 1 year ago

I was ultimately successful, but couldn't resolve the issue directly, here's the story:

https://community.home-assistant.io/t/victron-energy-vedirect-bluetooth/20726/172

Recent version of Victron Connect also provides the authentication keys - no Linux workaround necessary!

Ultimately, the most important thing is that it works.

wasn-eu commented 1 year ago

your solution is to use an other integration. so the problem here is not solved.

great that the other integration is working for you

wasn-eu commented 1 year ago

this is the error in HA:

`Logger: custom_components.victron_ble Source: custom_components/victron_ble/sensor.py:154 Integration: Victron BLE (documentation, issues) First occurred: 13:05:56 (185860 occurrences) Last logged: 22:10:37

Unexpected error updating SmartShunt data: (<VictronSensor.MIDPOINT_VOLTAGE: 'midpoint_voltage'>, <Units.ELECTRIC_POTENTIAL_VOLT: 'V'>) Unexpected error updating DD:F2:B0:C4:D6:1D data: (<VictronSensor.MIDPOINT_VOLTAGE: 'midpoint_voltage'>, <Units.ELECTRIC_POTENTIAL_VOLT: 'V'>) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 278, in async_handle_update new_data = self.update_method(update) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/sensor.py", line 151, in sensor_update_to_bluetooth_data_update entity_descriptions={ ^ File "/config/custom_components/victron_ble/sensor.py", line 154, in ): SENSOR_DESCRIPTIONS[ ^^^^^^^^^^^^^^^^^^^^ KeyError: (<VictronSensor.MIDPOINT_VOLTAGE: 'midpoint_voltage'>, <Units.ELECTRIC_POTENTIAL_VOLT: 'V'>)`

david-collett commented 1 year ago

I have the same issue. After adding a discovered smarthunt, no entities are created and the log is filled with the below.

homeassistant  | KeyError: (<VictronSensor.STARTER_BATTERY_VOLTAGE: 'starter_battery_voltage'>, <Units.ELECTRIC_POTENTIAL_VOLT: 'V'>)
homeassistant  | 2023-08-30 11:53:50.588 ERROR (MainThread) [custom_components.victron_ble] Unexpected error updating SmartShunt HQ2104BRD42 data: (<VictronSensor.STARTER_BATTERY_VOLTAGE: 'starter_battery_voltage'>, <Units.ELECTRIC_POTENTIAL_VOLT: 'V'>)
homeassistant  | Traceback (most recent call last):
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 278, in async_handle_update
homeassistant  |     new_data = self.update_method(update)
homeassistant  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/config/custom_components/victron_ble/sensor.py", line 151, in sensor_update_to_bluetooth_data_update
homeassistant  |     entity_descriptions={
homeassistant  |                         ^
homeassistant  |   File "/config/custom_components/victron_ble/sensor.py", line 154, in <dictcomp>
homeassistant  |     ): SENSOR_DESCRIPTIONS[
homeassistant  |        ^^^^^^^^^^^^^^^^^^^^
david-collett commented 1 year ago

In the two reports above (with logs), it appears to simply be SENSOR_DESCRIPTIONS is incomplete and doesnt have entries for MIDPOINT_VOLTAGE and STARTER_BATTERY_VOLTAGE. Perhaps not surprising as these are configurable functions of the additional sensor input. I'd say the author has not encountered these configurations yet. I will have a go an adding them and producing a PR.

wasn-eu commented 1 year ago

just added yout lines of code manually and now i have all entitites for my smartshunt. thank you very much

pfwilliam commented 1 year ago

EDIT: I figured it out :D thanks for the code @david-collett, and I also added Amp as unit to my external device load, not sure why that just said None, but anyways now it works. happy days!

@wasn-eu can you write what you did in short ? im a bit new still to all this git stuff, so unsure which code to pop where :) I have the same issue with my Smart Solar 75V 15A not showing any entities.

This error originated from a custom integration.

Logger: custom_components.victron_ble Source: custom_components/victron_ble/sensor.py:154 Integration: Victron BLE (documentation, issues) First occurred: 08:59:29 (818 occurrences) Last logged: 09:34:03

Unexpected error updating SmartSolar 75V 15Amp data: (<VictronSensor.EXTERNAL_DEVICE_LOAD: 'external_device_load'>, <Units.ELECTRIC_CURRENT_AMPERE: 'A'>) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 535, in async_handle_update new_data = self.update_method(update) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/victron_ble/sensor.py", line 151, in sensor_update_to_bluetooth_data_update entity_descriptions={ ^ File "/config/custom_components/victron_ble/sensor.py", line 154, in ): SENSOR_DESCRIPTIONS[ ^^^^^^^^^^^^^^^^^^^^ KeyError: (<VictronSensor.EXTERNAL_DEVICE_LOAD: 'external_device_load'>, <Units.ELECTRIC_CURRENT_AMPERE: 'A'>)

klehnst commented 7 months ago

@pfwilliam @david-collett I also have the same problem, but with the SmartShunt and aux port, could you help me solve the problem?

pfwilliam commented 7 months ago

@pfwilliam @david-collett I also have the same problem, but with the SmartShunt and aux port, could you help me solve the problem?

just see what the error message you have says, and go into the file its complaining about and see if you can figure out what is wrong. just check the lines that is in the error msg, usually the issue is close by.

the below image is my file after updating it, and i think it was the highlighted that was stated with some other value than Amps... sorry, dont entirely remember what i did.. will try to document better next time :D good luck!

image