Skip to content

Commit b338ea3

Browse files
tomer-wgithub-actions[bot]
authored andcommitted
Update victron_mqtt to 2026.6.4
## Changes - Adding support for the new EV device type: #430 - Add missing battery alerts: tomer-w/victron_mqtt#98 ## Contributors @tomer-w
1 parent 10fbff7 commit b338ea3

8 files changed

Lines changed: 1462 additions & 154 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.6.3"
3+
VICTRON_MQTT_VERSION = "2026.6.4"

custom_components/victron_mqtt/_vendor/victron_mqtt/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
EvChargerMode,
2929
EvChargerPosition,
3030
EvChargerStatus,
31+
EvChargingState,
3132
FluidType,
3233
GeneratorRunningByConditionCode,
3334
GenericAlarmEnum,
@@ -89,6 +90,7 @@
8990
"EvChargerMode",
9091
"EvChargerPosition",
9192
"EvChargerStatus",
93+
"EvChargingState",
9294
"FluidType",
9395
"FormulaMetric",
9496
"GeneratorRunningByConditionCode",

custom_components/victron_mqtt/_vendor/victron_mqtt/_victron_enums.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class DeviceType(VictronDeviceEnum):
1616
GRID = ("grid", "grid", "Grid")
1717
VEBUS = ("vebus", "vebus", "VE.Bus")
1818
EVCHARGER = ("evcharger", "evcharger", "EV charging station")
19+
EV = ("ev", "ev", "Electric vehicle")
1920
PVINVERTER = ("pvinverter", "pvinverter", "PV inverter")
2021
TEMPERATURE = ("temperature", "temperature", "Temperature")
2122
GENERATOR = ("generator", "generator", "Generator")
@@ -173,6 +174,20 @@ class EvChargerMode(VictronEnum):
173174
SCHEDULED_CHARGE = (2, "scheduled_charge", "Scheduled charge")
174175

175176

177+
class EvChargingState(VictronEnum):
178+
"""EV Charging State Enum"""
179+
180+
NOT_CHARGING = (0, "not_charging", "Not charging")
181+
LOW_POWER_MODE = (1, "low_power_mode", "Low power mode")
182+
CHARGING = (3, "charging", "Charging")
183+
SUSTAIN = (244, "sustain", "Sustain")
184+
WAKE_UP = (245, "wake_up", "Wake up")
185+
BLOCKED = (250, "blocked", "Blocked")
186+
UNAVAILABLE = (255, "unavailable", "Unavailable")
187+
DISCHARGING = (256, "discharging", "Discharging")
188+
SCHEDULED_CHARGING = (259, "scheduled_charging", "Scheduled charging")
189+
190+
176191
class EvChargerPosition(VictronEnum):
177192
"""EVCharger Position Enum"""
178193

custom_components/victron_mqtt/_vendor/victron_mqtt/_victron_formulas.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
GenericOnOff,
1414
PreferRenewableEnergyEnum,
1515
)
16-
from .constants import MetricType
16+
from .constants import MetricKind, MetricType
1717
from .data_classes import GpsLocation
1818
from .formula_common import left_riemann_sum_internal
1919
from .writable_metric import WritableMetric
@@ -161,26 +161,31 @@ def gps_location(
161161
depends_on: dict[str, Metric],
162162
_transient_state: FormulaTransientState | None,
163163
) -> tuple[GpsLocation | None, None]:
164-
"""Combine GPS metrics into a single GpsLocation. Returns None when there is no GPS fix."""
164+
"""Combine GPS metrics into a single GpsLocation. Returns None when there is no GPS fix.
165+
166+
Matches dependencies by MetricType so this works generically for any
167+
device type that provides location sensors (gps, ev, etc.).
168+
"""
165169
lat_metric = None
166170
lon_metric = None
167171
fix_metric = None
168172
alt_metric = None
169173
course_metric = None
170174
speed_metric = None
171175
for metric in depends_on.values():
172-
if metric.generic_short_id == "gps_latitude":
176+
mt = metric.metric_type
177+
if mt == MetricType.LATITUDE:
173178
lat_metric = metric
174-
elif metric.generic_short_id == "gps_longitude":
179+
elif mt == MetricType.LONGITUDE:
175180
lon_metric = metric
176-
elif metric.generic_short_id == "gps_fix":
177-
fix_metric = metric
178-
elif metric.generic_short_id == "gps_altitude":
181+
elif mt == MetricType.ALTITUDE:
179182
alt_metric = metric
180-
elif metric.generic_short_id == "gps_course":
183+
elif mt == MetricType.HEADING:
181184
course_metric = metric
182-
elif metric.generic_short_id == "gps_speed":
185+
elif mt == MetricType.SPEED:
183186
speed_metric = metric
187+
elif metric.metric_kind == MetricKind.BINARY_SENSOR:
188+
fix_metric = metric
184189

185190
if lat_metric is None or lon_metric is None:
186191
return None, None

0 commit comments

Comments
 (0)