Skip to content

Commit 3a73fca

Browse files
Update victron_mqtt to 2026.5.13 (#424)
## Changes - Fix wrong metric type: #422 - Add dynamic MetricType for when the units should be taken from the library directly in runtime ## Contributors @tomer-w Co-authored-by: tomer-w <57483589+tomer-w@users.noreply.github.com>
1 parent 86627e1 commit 3a73fca

5 files changed

Lines changed: 22 additions & 18 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Vendored third-party packages."""
22

3-
VICTRON_MQTT_VERSION = "2026.5.12"
3+
VICTRON_MQTT_VERSION = "2026.5.13"

custom_components/victron_mqtt/_vendor/victron_mqtt/_victron_topics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
message_type=MetricKind.SENSOR,
410410
short_id="battery_average_discharge",
411411
name="Average discharge",
412-
metric_type=MetricType.ENERGY,
412+
metric_type=MetricType.ELECTRIC_STORAGE_CAPACITY,
413413
),
414414
TopicDescriptor(
415415
topic="N/{installation_id}/battery/{device_id}/History/ChargeCycles",
@@ -432,7 +432,7 @@
432432
message_type=MetricKind.SENSOR,
433433
short_id="battery_deepest_discharge",
434434
name="Deepest discharge",
435-
metric_type=MetricType.ENERGY,
435+
metric_type=MetricType.ELECTRIC_STORAGE_CAPACITY,
436436
),
437437
TopicDescriptor(
438438
topic="N/{installation_id}/battery/{device_id}/History/DischargedEnergy",
@@ -446,7 +446,7 @@
446446
message_type=MetricKind.SENSOR,
447447
short_id="battery_last_discharge",
448448
name="Last discharge",
449-
metric_type=MetricType.ENERGY,
449+
metric_type=MetricType.ELECTRIC_STORAGE_CAPACITY,
450450
),
451451
TopicDescriptor(
452452
topic="N/{installation_id}/battery/{device_id}/History/MaximumVoltage",
@@ -2624,7 +2624,7 @@
26242624
short_id="switch_{output}_dimming",
26252625
name="Dimming",
26262626
value_type=ValueType.FLOAT,
2627-
metric_type=MetricType.PERCENTAGE,
2627+
metric_type=MetricType.DYNAMIC,
26282628
min="switch_{output}_dimming_min:0",
26292629
max="switch_{output}_dimming_max:100",
26302630
step="switch_{output}_step_size:1",

custom_components/victron_mqtt/_vendor/victron_mqtt/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class MetricType(Enum):
5959
SPEED = "speed"
6060
COST = "cost"
6161
IRRADIANCE = "irradiance"
62+
DYNAMIC = "dynamic"
6263
PROBLEM = "problem"
6364
CONNECTIVITY = "connectivity"
6465
RESTART = "restart"

custom_components/victron_mqtt/translations/en.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,8 @@
684684
"unit_of_measurement": "syncs"
685685
},
686686
"battery_average_discharge": {
687-
"name": "Average discharge"
687+
"name": "Average discharge",
688+
"unit_of_measurement": "Ah"
688689
},
689690
"battery_capacity": {
690691
"name": "Capacity",
@@ -719,7 +720,8 @@
719720
"name": "DC bus current"
720721
},
721722
"battery_deepest_discharge": {
722-
"name": "Deepest discharge"
723+
"name": "Deepest discharge",
724+
"unit_of_measurement": "Ah"
723725
},
724726
"battery_discharged_energy": {
725727
"name": "Discharged energy"
@@ -761,7 +763,8 @@
761763
}
762764
},
763765
"battery_last_discharge": {
764-
"name": "Last discharge"
766+
"name": "Last discharge",
767+
"unit_of_measurement": "Ah"
765768
},
766769
"battery_low_cell_voltage": {
767770
"name": "Low cell voltage",

victron_mqtt.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -983,9 +983,9 @@
983983
"message_type": "MetricKind.SENSOR",
984984
"short_id": "battery_average_discharge",
985985
"name": "Average discharge",
986-
"unit_of_measurement": "kWh",
987-
"metric_type": "MetricType.ENERGY",
988-
"metric_nature": "MetricNature.TOTAL",
986+
"unit_of_measurement": "Ah",
987+
"metric_type": "MetricType.ELECTRIC_STORAGE_CAPACITY",
988+
"metric_nature": "MetricNature.MEASUREMENT",
989989
"value_type": "ValueType.FLOAT",
990990
"precision": 1,
991991
"enum": null,
@@ -1064,9 +1064,9 @@
10641064
"message_type": "MetricKind.SENSOR",
10651065
"short_id": "battery_deepest_discharge",
10661066
"name": "Deepest discharge",
1067-
"unit_of_measurement": "kWh",
1068-
"metric_type": "MetricType.ENERGY",
1069-
"metric_nature": "MetricNature.TOTAL",
1067+
"unit_of_measurement": "Ah",
1068+
"metric_type": "MetricType.ELECTRIC_STORAGE_CAPACITY",
1069+
"metric_nature": "MetricNature.MEASUREMENT",
10701070
"value_type": "ValueType.FLOAT",
10711071
"precision": 1,
10721072
"enum": null,
@@ -1118,9 +1118,9 @@
11181118
"message_type": "MetricKind.SENSOR",
11191119
"short_id": "battery_last_discharge",
11201120
"name": "Last discharge",
1121-
"unit_of_measurement": "kWh",
1122-
"metric_type": "MetricType.ENERGY",
1123-
"metric_nature": "MetricNature.TOTAL",
1121+
"unit_of_measurement": "Ah",
1122+
"metric_type": "MetricType.ELECTRIC_STORAGE_CAPACITY",
1123+
"metric_nature": "MetricNature.MEASUREMENT",
11241124
"value_type": "ValueType.FLOAT",
11251125
"precision": 1,
11261126
"enum": null,
@@ -8375,7 +8375,7 @@
83758375
"short_id": "switch_{output}_dimming",
83768376
"name": "Dimming",
83778377
"unit_of_measurement": "switch_{output}_unit:%",
8378-
"metric_type": "MetricType.PERCENTAGE",
8378+
"metric_type": "MetricType.DYNAMIC",
83798379
"metric_nature": "MetricNature.NONE",
83808380
"value_type": "ValueType.FLOAT",
83818381
"precision": null,

0 commit comments

Comments
 (0)