1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-17 15:44:52 +01:00

Add AC charger sensor support to victron_ble (#165497)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Raj Laud
2026-03-16 15:59:30 -04:00
committed by GitHub
parent 3c2f696a23
commit 3dec70abce
5 changed files with 828 additions and 0 deletions

View File

@@ -408,6 +408,61 @@ SENSOR_DESCRIPTIONS = {
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
),
Keys.AC_CURRENT: VictronBLESensorEntityDescription(
key=Keys.AC_CURRENT,
translation_key=Keys.AC_CURRENT,
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
),
Keys.OUTPUT_VOLTAGE_1: VictronBLESensorEntityDescription(
key=Keys.OUTPUT_VOLTAGE_1,
translation_key="output_phase_voltage",
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
state_class=SensorStateClass.MEASUREMENT,
translation_placeholders={"phase": "1"},
),
Keys.OUTPUT_CURRENT_1: VictronBLESensorEntityDescription(
key=Keys.OUTPUT_CURRENT_1,
translation_key="output_phase_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
translation_placeholders={"phase": "1"},
),
Keys.OUTPUT_VOLTAGE_2: VictronBLESensorEntityDescription(
key=Keys.OUTPUT_VOLTAGE_2,
translation_key="output_phase_voltage",
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
state_class=SensorStateClass.MEASUREMENT,
translation_placeholders={"phase": "2"},
),
Keys.OUTPUT_CURRENT_2: VictronBLESensorEntityDescription(
key=Keys.OUTPUT_CURRENT_2,
translation_key="output_phase_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
translation_placeholders={"phase": "2"},
),
Keys.OUTPUT_VOLTAGE_3: VictronBLESensorEntityDescription(
key=Keys.OUTPUT_VOLTAGE_3,
translation_key="output_phase_voltage",
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
state_class=SensorStateClass.MEASUREMENT,
translation_placeholders={"phase": "3"},
),
Keys.OUTPUT_CURRENT_3: VictronBLESensorEntityDescription(
key=Keys.OUTPUT_CURRENT_3,
translation_key="output_phase_current",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
translation_placeholders={"phase": "3"},
),
}
for i in range(1, 9):

View File

@@ -34,6 +34,9 @@
},
"entity": {
"sensor": {
"ac_current": {
"name": "AC current"
},
"ac_in_power": {
"name": "AC-in power"
},
@@ -235,6 +238,12 @@
"switched_off_switch": "Switched off by switch"
}
},
"output_phase_current": {
"name": "Output phase {phase} current"
},
"output_phase_voltage": {
"name": "Output phase {phase} voltage"
},
"output_voltage": {
"name": "Output voltage"
},

View File

@@ -165,3 +165,19 @@ VICTRON_VEBUS_SENSORS = {
"inverter_charger_battery_temperature": "32",
"inverter_charger_state_of_charge": "unknown",
}
# AC charger
VICTRON_AC_CHARGER_SERVICE_INFO = BluetoothServiceInfo(
name="Smart Charger",
address="01:02:03:04:05:12",
rssi=-60,
manufacturer_data={
0x02E1: bytes.fromhex("100030a308f926c1b5170a0d2280335bf12d5ed083")
},
service_data={},
service_uuids=[],
source="local",
)
VICTRON_AC_CHARGER_TOKEN = "c129cf8f75c3fe5a1655b481e205fb7d"

View File

@@ -1,4 +1,748 @@
# serializer version: 1
# name: test_sensors[ac_charger][sensor.smart_charger_ac_current-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_ac_current',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'AC current',
'options': dict({
'sensor': dict({
'suggested_display_precision': 2,
}),
}),
'original_device_class': <SensorDeviceClass.CURRENT: 'current'>,
'original_icon': None,
'original_name': 'AC current',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': <Keys.AC_CURRENT: 'ac_current'>,
'unique_id': '01:02:03:04:05:12-ac_current',
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_ac_current-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'current',
'friendly_name': 'Smart Charger AC current',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_ac_current',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_charge_state-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'options': list([
'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',
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_charge_state',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Charge state',
'options': dict({
}),
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
'original_icon': None,
'original_name': 'Charge state',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'charge_state',
'unique_id': '01:02:03:04:05:12-charge_state',
'unit_of_measurement': None,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_charge_state-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
'friendly_name': 'Smart Charger Charge state',
'options': list([
'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',
]),
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_charge_state',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'storage',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_charger_error-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'options': list([
'no_error',
'temperature_battery_high',
'voltage_high',
'remote_temperature_auto_reset',
'remote_temperature_not_auto_reset',
'remote_battery',
'high_ripple',
'temperature_battery_low',
'temperature_charger',
'over_current',
'bulk_time',
'current_sensor',
'internal_temperature',
'fan',
'overheated',
'short_circuit',
'converter_issue',
'over_charge',
'input_voltage',
'input_current',
'input_power',
'input_shutdown_voltage',
'input_shutdown_current',
'input_shutdown_failure',
'inverter_shutdown_pv_isolation',
'inverter_shutdown_ground_fault',
'inverter_overload',
'inverter_temperature',
'inverter_peak_current',
'inverter_output_voltage',
'inverter_self_test',
'inverter_ac',
'communication',
'synchronisation',
'bms',
'network',
'pv_input_shutdown',
'cpu_temperature',
'calibration_lost',
'firmware',
'settings',
'tester_fail',
'internal_dc_voltage',
'self_test',
'internal_supply',
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_charger_error',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Charger error',
'options': dict({
}),
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
'original_icon': None,
'original_name': 'Charger error',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'charger_error',
'unique_id': '01:02:03:04:05:12-charger_error',
'unit_of_measurement': None,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_charger_error-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
'friendly_name': 'Smart Charger Charger error',
'options': list([
'no_error',
'temperature_battery_high',
'voltage_high',
'remote_temperature_auto_reset',
'remote_temperature_not_auto_reset',
'remote_battery',
'high_ripple',
'temperature_battery_low',
'temperature_charger',
'over_current',
'bulk_time',
'current_sensor',
'internal_temperature',
'fan',
'overheated',
'short_circuit',
'converter_issue',
'over_charge',
'input_voltage',
'input_current',
'input_power',
'input_shutdown_voltage',
'input_shutdown_current',
'input_shutdown_failure',
'inverter_shutdown_pv_isolation',
'inverter_shutdown_ground_fault',
'inverter_overload',
'inverter_temperature',
'inverter_peak_current',
'inverter_output_voltage',
'inverter_self_test',
'inverter_ac',
'communication',
'synchronisation',
'bms',
'network',
'pv_input_shutdown',
'cpu_temperature',
'calibration_lost',
'firmware',
'settings',
'tester_fail',
'internal_dc_voltage',
'self_test',
'internal_supply',
]),
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_charger_error',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_1_current-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_output_phase_1_current',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Output phase 1 current',
'options': dict({
'sensor': dict({
'suggested_display_precision': 2,
}),
}),
'original_device_class': <SensorDeviceClass.CURRENT: 'current'>,
'original_icon': None,
'original_name': 'Output phase 1 current',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'output_phase_current',
'unique_id': '01:02:03:04:05:12-output_current_1',
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_1_current-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'current',
'friendly_name': 'Smart Charger Output phase 1 current',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_output_phase_1_current',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.4',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_1_voltage-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_output_phase_1_voltage',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Output phase 1 voltage',
'options': dict({
'sensor': dict({
'suggested_display_precision': 0,
}),
}),
'original_device_class': <SensorDeviceClass.VOLTAGE: 'voltage'>,
'original_icon': None,
'original_name': 'Output phase 1 voltage',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'output_phase_voltage',
'unique_id': '01:02:03:04:05:12-output_voltage_1',
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_1_voltage-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'voltage',
'friendly_name': 'Smart Charger Output phase 1 voltage',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_output_phase_1_voltage',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '13.49',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_2_current-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_output_phase_2_current',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Output phase 2 current',
'options': dict({
'sensor': dict({
'suggested_display_precision': 2,
}),
}),
'original_device_class': <SensorDeviceClass.CURRENT: 'current'>,
'original_icon': None,
'original_name': 'Output phase 2 current',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'output_phase_current',
'unique_id': '01:02:03:04:05:12-output_current_2',
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_2_current-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'current',
'friendly_name': 'Smart Charger Output phase 2 current',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_output_phase_2_current',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_2_voltage-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_output_phase_2_voltage',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Output phase 2 voltage',
'options': dict({
'sensor': dict({
'suggested_display_precision': 0,
}),
}),
'original_device_class': <SensorDeviceClass.VOLTAGE: 'voltage'>,
'original_icon': None,
'original_name': 'Output phase 2 voltage',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'output_phase_voltage',
'unique_id': '01:02:03:04:05:12-output_voltage_2',
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_2_voltage-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'voltage',
'friendly_name': 'Smart Charger Output phase 2 voltage',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_output_phase_2_voltage',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_3_current-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_output_phase_3_current',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Output phase 3 current',
'options': dict({
'sensor': dict({
'suggested_display_precision': 2,
}),
}),
'original_device_class': <SensorDeviceClass.CURRENT: 'current'>,
'original_icon': None,
'original_name': 'Output phase 3 current',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'output_phase_current',
'unique_id': '01:02:03:04:05:12-output_current_3',
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_3_current-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'current',
'friendly_name': 'Smart Charger Output phase 3 current',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_output_phase_3_current',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_3_voltage-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_output_phase_3_voltage',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Output phase 3 voltage',
'options': dict({
'sensor': dict({
'suggested_display_precision': 0,
}),
}),
'original_device_class': <SensorDeviceClass.VOLTAGE: 'voltage'>,
'original_icon': None,
'original_name': 'Output phase 3 voltage',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'output_phase_voltage',
'unique_id': '01:02:03:04:05:12-output_voltage_3',
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_output_phase_3_voltage-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'voltage',
'friendly_name': 'Smart Charger Output phase 3 voltage',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_output_phase_3_voltage',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_signal_strength-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_signal_strength',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Signal strength',
'options': dict({
}),
'original_device_class': <SensorDeviceClass.SIGNAL_STRENGTH: 'signal_strength'>,
'original_icon': None,
'original_name': 'Signal strength',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '01:02:03:04:05:12-signal_strength',
'unit_of_measurement': 'dBm',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_signal_strength-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'signal_strength',
'friendly_name': 'Smart Charger Signal strength',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': 'dBm',
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_signal_strength',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '-60',
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.smart_charger_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Temperature',
'options': dict({
'sensor': dict({
'suggested_display_precision': 1,
}),
}),
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Temperature',
'platform': 'victron_ble',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '01:02:03:04:05:12-temperature',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_sensors[ac_charger][sensor.smart_charger_temperature-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'Smart Charger Temperature',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'sensor.smart_charger_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '21',
})
# ---
# name: test_sensors[battery_monitor][sensor.battery_monitor_alarm-entry]
EntityRegistryEntrySnapshot({
'aliases': set({

View File

@@ -8,6 +8,8 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from .fixtures import (
VICTRON_AC_CHARGER_SERVICE_INFO,
VICTRON_AC_CHARGER_TOKEN,
VICTRON_BATTERY_MONITOR_SERVICE_INFO,
VICTRON_BATTERY_MONITOR_TOKEN,
VICTRON_DC_ENERGY_METER_SERVICE_INFO,
@@ -31,6 +33,7 @@ from tests.components.bluetooth import inject_bluetooth_service_info
"access_token",
),
[
(VICTRON_AC_CHARGER_SERVICE_INFO, VICTRON_AC_CHARGER_TOKEN),
(VICTRON_BATTERY_MONITOR_SERVICE_INFO, VICTRON_BATTERY_MONITOR_TOKEN),
(VICTRON_DC_ENERGY_METER_SERVICE_INFO, VICTRON_DC_ENERGY_METER_TOKEN),
(VICTRON_SMART_LITHIUM_SERVICE_INFO, VICTRON_SMART_LITHIUM_TOKEN),
@@ -38,6 +41,7 @@ from tests.components.bluetooth import inject_bluetooth_service_info
(VICTRON_VEBUS_SERVICE_INFO, VICTRON_VEBUS_TOKEN),
],
ids=[
"ac_charger",
"battery_monitor",
"dc_energy_meter",
"smart_lithium",