j9brown / victron-hacs

Home Assistant plug-in for Victron Instant Readout compatible devices
13 stars 4 forks source link

SmartSolar MPPT stop giving updates and becomes unavailable #3

Open huafu opened 1 month ago

huafu commented 1 month ago

Version of the custom_component

Version 0.1.13

Configuration / description

All configuration has been done in the UI, I have a SmartShunt and a BlueSolar (with Victron VE to BLE module) which are working great. Only my new SmartSolar added yesterday seems to report correctly, but after some time the sensors' values don't change anymore, and finally it becomes unavailable. Restarting HA will make them come back.

Checked on BLE with Victron, BLE gatt get went correctly. I can't see any log in homeassistant.log, I'll try to see if I can add some debug and update this bug in such case.

huafu commented 1 month ago

I had to change the SmartSolar for a 150/35 one, and I am facing the same issue and even worst since after some time running HA, the device remains unavailable. Here are the log lines around the last line related to the device causing problems:

2024-08-07 22:09:40.587 DEBUG (MainThread) [custom_components.victron_ble.device] Parsing Victron BLE advertisement data: {737: b'\x01\xc3\x10\xb6Q\x98`\x0b\x06\x00\x00\x00\xfa\xf2\xc9\x1f'}
2024-08-07 22:09:40.589 DEBUG (MainThread) [custom_components.victron_ble.sensor] IN 2here: PassiveBluetoothDataUpdate(devices={None: {'name': 'SmartSolar', 'manufacturer': 'Victron', 'model': 'SmartSolar MPPT 150|35'}}, entity_descriptions={PassiveBluetoothEntityKey(key='power', device_id=None): SensorEntityDescription(key='power_W', device_class=<SensorDeviceClass.POWER: 'power'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.POWER_WATT: 'W'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key='voltage', device_id=None): SensorEntityDescription(key='voltage_V', device_class=<SensorDeviceClass.VOLTAGE: 'voltage'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.ELECTRIC_POTENTIAL_VOLT: 'V'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key='current', device_id=None): SensorEntityDescription(key='current_A', device_class=<SensorDeviceClass.CURRENT: 'current'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.ELECTRIC_CURRENT_AMPERE: 'A'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key=<VictronSensor.YIELD_TODAY: 'yield_today'>, device_id=None): SensorEntityDescription(key=<VictronSensor.YIELD_TODAY: 'yield_today'>, device_class=<SensorDeviceClass.ENERGY: 'energy'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.ENERGY_WATT_HOUR: 'Wh'>, options=None, state_class=<SensorStateClass.TOTAL_INCREASING: 'total_increasing'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key=<VictronSensor.OPERATION_MODE: 'operation_mode'>, device_id=None): SensorEntityDescription(key=<VictronSensor.OPERATION_MODE: 'operation_mode'>, device_class=<SensorDeviceClass.ENUM: 'enum'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=None, options=['off', 'low_power', 'fault', 'bulk', 'absorption', 'float', 'storage', 'equalize_manual', 'inverting', 'power_supply', 'starting_up', 'repeated_absorption', 'recondition', 'battery_safe', 'active', 'external_control', 'not_available'], state_class=None, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key='signal_strength', device_id=None): SensorEntityDescription(key='signal_strength_dBm', device_class=<SensorDeviceClass.SIGNAL_STRENGTH: 'signal_strength'>, entity_category=None, entity_registry_enabled_default=False, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.SIGNAL_STRENGTH_DECIBELS_MILLIWATT: 'dBm'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None)}, entity_names={PassiveBluetoothEntityKey(key='power', device_id=None): 'Power', PassiveBluetoothEntityKey(key='voltage', device_id=None): 'Voltage', PassiveBluetoothEntityKey(key='current', device_id=None): 'Current', PassiveBluetoothEntityKey(key=<VictronSensor.YIELD_TODAY: 'yield_today'>, device_id=None): 'Yield Today', PassiveBluetoothEntityKey(key=<VictronSensor.OPERATION_MODE: 'operation_mode'>, device_id=None): 'Operation Mode', PassiveBluetoothEntityKey(key='signal_strength', device_id=None): 'Signal Strength'}, entity_data={PassiveBluetoothEntityKey(key='power', device_id=None): 0, PassiveBluetoothEntityKey(key='voltage', device_id=None): 26.25, PassiveBluetoothEntityKey(key='current', device_id=None): 0.0, PassiveBluetoothEntityKey(key=<VictronSensor.YIELD_TODAY: 'yield_today'>, device_id=None): 2440, PassiveBluetoothEntityKey(key=<VictronSensor.OPERATION_MODE: 'operation_mode'>, device_id=None): 'off', PassiveBluetoothEntityKey(key='signal_strength', device_id=None): -100})
2024-08-07 22:10:21.449 DEBUG (MainThread) [custom_components.victron_ble.device] Parsing Victron BLE advertisement data: {737: b'\x10\x02\x89\xa3\x02\xed\x97^?1\x87j\xbc\xbf\xc2\xe8yg\xcf\xcf\x9c@\xad'}
2024-08-07 22:10:21.452 DEBUG (MainThread) [custom_components.victron_ble.device] Handle Victron BLE advertisement data: {'remaining_mins': 3875, 'aux_mode': <AuxMode.MIDPOINT_VOLTAGE: 1>, 'current': -4.986, 'voltage': 26.29, 'consumed_ah': -13.9, 'soc': 96.4, 'alarm': <AlarmReason.NO_ALARM: 0>, 'midpoint_voltage': 13.14}
2024-08-07 22:10:21.455 DEBUG (MainThread) [custom_components.victron_ble.sensor] IN 2here: PassiveBluetoothDataUpdate(devices={None: {'name': 'Smart Shunt', 'manufacturer': 'Victron', 'model': 'SmartShunt 500A/50mV'}}, entity_descriptions={PassiveBluetoothEntityKey(key='voltage', device_id=None): SensorEntityDescription(key='voltage_V', device_class=<SensorDeviceClass.VOLTAGE: 'voltage'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.ELECTRIC_POTENTIAL_VOLT: 'V'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key='current', device_id=None): SensorEntityDescription(key='current_A', device_class=<SensorDeviceClass.CURRENT: 'current'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.ELECTRIC_CURRENT_AMPERE: 'A'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key='battery', device_id=None): SensorEntityDescription(key='battery_%', device_class=<SensorDeviceClass.BATTERY: 'battery'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.PERCENTAGE: '%'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key=<VictronSensor.TIME_REMAINING: 'time_remaining'>, device_id=None): SensorEntityDescription(key=<VictronSensor.TIME_REMAINING: 'time_remaining'>, device_class=<SensorDeviceClass.DURATION: 'duration'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.TIME_MINUTES: 'min'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key=<VictronSensor.CONSUMED: 'consumed'>, device_id=None): SensorEntityDescription(key=<VictronSensor.CONSUMED: 'consumed'>, device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement='Ah', options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key=<VictronSensor.ALARM_REASON: 'alarm_reason'>, device_id=None): SensorEntityDescription(key=<VictronSensor.ALARM_REASON: 'alarm_reason'>, device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=None, options=None, state_class=None, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key=<VictronSensor.AUX_MODE: 'aux_mode'>, device_id=None): SensorEntityDescription(key=<VictronSensor.AUX_MODE: 'aux_mode'>, device_class=<SensorDeviceClass.ENUM: 'enum'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=None, options=['starter_voltage', 'midpoint_voltage', 'temperature', 'disabled'], state_class=None, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key=<VictronSensor.MIDPOINT_VOLTAGE: 'midpoint_voltage'>, device_id=None): SensorEntityDescription(key=<VictronSensor.MIDPOINT_VOLTAGE: 'midpoint_voltage'>, device_class=<SensorDeviceClass.VOLTAGE: 'voltage'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.ELECTRIC_POTENTIAL_VOLT: 'V'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None), PassiveBluetoothEntityKey(key='signal_strength', device_id=None): SensorEntityDescription(key='signal_strength_dBm', device_class=<SensorDeviceClass.SIGNAL_STRENGTH: 'signal_strength'>, entity_category=None, entity_registry_enabled_default=False, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name=<UndefinedType._singleton: 0>, translation_key=None, translation_placeholders=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<Units.SIGNAL_STRENGTH_DECIBELS_MILLIWATT: 'dBm'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None)}, entity_names={PassiveBluetoothEntityKey(key='voltage', device_id=None): 'Voltage', PassiveBluetoothEntityKey(key='current', device_id=None): 'Current', PassiveBluetoothEntityKey(key='battery', device_id=None): 'Battery', PassiveBluetoothEntityKey(key=<VictronSensor.TIME_REMAINING: 'time_remaining'>, device_id=None): 'Time remaining', PassiveBluetoothEntityKey(key=<VictronSensor.CONSUMED: 'consumed'>, device_id=None): 'Consumed', PassiveBluetoothEntityKey(key=<VictronSensor.ALARM_REASON: 'alarm_reason'>, device_id=None): 'Alarm', PassiveBluetoothEntityKey(key=<VictronSensor.AUX_MODE: 'aux_mode'>, device_id=None): 'Auxilliary Input Mode', PassiveBluetoothEntityKey(key=<VictronSensor.MIDPOINT_VOLTAGE: 'midpoint_voltage'>, device_id=None): 'Midpoint Voltage', PassiveBluetoothEntityKey(key='signal_strength', device_id=None): 'Signal Strength'}, entity_data={PassiveBluetoothEntityKey(key='voltage', device_id=None): 26.29, PassiveBluetoothEntityKey(key='current', device_id=None): -4.99, PassiveBluetoothEntityKey(key='battery', device_id=None): 96.4, PassiveBluetoothEntityKey(key=<VictronSensor.TIME_REMAINING: 'time_remaining'>, device_id=None): 3875, PassiveBluetoothEntityKey(key=<VictronSensor.CONSUMED: 'consumed'>, device_id=None): -13.9, PassiveBluetoothEntityKey(key=<VictronSensor.ALARM_REASON: 'alarm_reason'>, device_id=None): 'no_alarm', PassiveBluetoothEntityKey(key=<VictronSensor.AUX_MODE: 'aux_mode'>, device_id=None): 'midpoint_voltage', PassiveBluetoothEntityKey(key=<VictronSensor.MIDPOINT_VOLTAGE: 'midpoint_voltage'>, device_id=None): 13.14, PassiveBluetoothEntityKey(key='signal_strength', device_id=None): -73})

I also have a SmartShunt as you can see, and no issue with it. The device is very close to the RPi running HA, and the solar charger is broadcasting GATT. Screenshot_20240808-043813~2 (It's night so it's normal the zeros)

wutu commented 1 month ago

I have same problem with SmartSolar 100|50.

huafu commented 1 month ago

Just got a 150/45 Smart Solar and while it has worked perfectly for 24 hours, it is now starting to have the same issues as the 2 others I had previously... The BLE attrs are sent, it's definitely not a Victron' side issue. Nothing in the log which can help badly. I've tried with victron2mqtt and ESPHome victron_ble, both do work correctly but I'd like to avoid using multiple external tools