diff --git a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/discovery/MercedesMeDiscoveryService.java b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/discovery/MercedesMeDiscoveryService.java index 3042c500133..cf2dafb8232 100644 --- a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/discovery/MercedesMeDiscoveryService.java +++ b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/discovery/MercedesMeDiscoveryService.java @@ -29,6 +29,7 @@ import org.osgi.service.component.annotations.Component; * associated vehicles and provides DiscoveryResults * * @author Bernd Weymann - Initial Contribution + * @author Bernd Weymann - Add vin as representation property */ @NonNullByDefault @Component(service = DiscoveryService.class, configurationPid = "discovery.mercedesme") @@ -56,8 +57,9 @@ public class MercedesMeDiscoveryService extends AbstractDiscoveryService { break; } if (ttuid != null) { + properties.put("vin", vin); thingDiscovered(DiscoveryResultBuilder.create(new ThingUID(ttuid, ac.getThing().getUID(), vin)) - .withBridge(ac.getThing().getUID()).withProperties(properties) + .withBridge(ac.getThing().getUID()).withProperties(properties).withRepresentationProperty("vin") .withLabel("Mercedes Benz " + ttuid.getId().toUpperCase()).build()); } } diff --git a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/AccountHandler.java b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/AccountHandler.java index 13e1d18710d..ded788084a3 100644 --- a/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/AccountHandler.java +++ b/bundles/org.openhab.binding.mercedesme/src/main/java/org/openhab/binding/mercedesme/internal/handler/AccountHandler.java @@ -324,7 +324,9 @@ public class AccountHandler extends BaseBridgeHandler implements AccessTokenRefr } else { if (!capabilitiesMap.containsKey(vin)) { // only report new discovery if capabilities aren't discovered yet - discoveryService.vehicleDiscovered(this, vin, getCapabilities(vin)); + Map discoveryProperties = getCapabilities(vin); + discoveryProperties.put("vin", vin); + discoveryService.vehicleDiscovered(this, vin, discoveryProperties); } } }