diff --git a/CHANGELOG.md b/CHANGELOG.md index 539f631..b9dbb25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## v0.1.6 * Added: Set device type to `grid`, `genset` or `acload` +* Changed: Add VRM ID to MQTT client name * Changed: Fix registration to dbus https://github.com/victronenergy/velib_python/commit/494f9aef38f46d6cfcddd8b1242336a0a3a79563 ## v0.1.5 diff --git a/dbus-mqtt-grid/dbus-mqtt-grid.py b/dbus-mqtt-grid/dbus-mqtt-grid.py index a230481..870b980 100644 --- a/dbus-mqtt-grid/dbus-mqtt-grid.py +++ b/dbus-mqtt-grid/dbus-mqtt-grid.py @@ -13,7 +13,8 @@ # import Victron Energy packages sys.path.insert(1, os.path.join(os.path.dirname(__file__), "ext", "velib_python")) -from vedbus import VeDbusService +from vedbus import VeDbusService # noqa: E402 +from ve_utils import get_vrm_portal_id # noqa: E402 # get values from config.ini file @@ -406,7 +407,7 @@ def __init__( self._dbusservice.add_path("/ProductId", 0xFFFF) self._dbusservice.add_path("/ProductName", productname) self._dbusservice.add_path("/CustomName", customname) - self._dbusservice.add_path("/FirmwareVersion", "0.1.6 (20240703)") + self._dbusservice.add_path("/FirmwareVersion", "0.1.6 (20240819)") # self._dbusservice.add_path('/HardwareVersion', '') self._dbusservice.add_path("/Connected", 1) @@ -617,7 +618,7 @@ def main(): DBusGMainLoop(set_as_default=True) # MQTT setup - client = mqtt.Client("MqttGrid_" + str(config["DEFAULT"]["device_instance"])) + client = mqtt.Client("MqttGrid_" + get_vrm_portal_id() + "_" + str(config["DEFAULT"]["device_instance"])) client.on_disconnect = on_disconnect client.on_connect = on_connect client.on_message = on_message