-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vwweconnect] [WIP] Initial contribution #8314
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add yourself to the CODEOWNERS file?
You need to add your binding to bundles/pom.xml and bom/openhab-addons/pom.xml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I peeked into the first files of your code. Here is my feedback.
@@ -0,0 +1,367 @@ | |||
# VW We Connect Binding | |||
|
|||
This is an OpenHAB binding for VW We Connect Portal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an OpenHAB binding for VW We Connect Portal. | |
This is an openHAB binding for VW We Connect Portal. |
You will have to configure the bridge with username and password, these must be the same credentials as used when logging into: | ||
https://www.portal.volkswagen-we.com. | ||
|
||
You must also configure your secure pin to be able to lock/unlock and start/stop the heater/ventilation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the binding doesn't have any general configuration, this chapter could be removed.
## Disclaimer | ||
|
||
Any side effects using this binding is the responsibility of the person installing and using the binding and not the binding developer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bindings don't need a disclaimer as this is covered by the framework's license.
|
||
#### Channels | ||
|
||
([vwweconnectapi]) supports the following channel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you intent to get a special formatting with the brackets? The GitHub preview doesn't render them in a special way.
| details#name | String | Vehicle name | | ||
| details#model | String | Vehicle model | | ||
| details#modelCode | String | Vehicle model code | | ||
| details#modelYear | String | Vehicle model year | | ||
| details#enrollmentDate | DateTime | Vehicle enrollment date | | ||
| details#dashboardURL | String | User's home URL | | ||
| details#imageURL | Image | Vehicle picture | | ||
| details#engineTypeCombustian | Switch | Is engine type combustian | | ||
| details#engineTypeElectric | Switch | Is engine type electric | | ||
| details#engineTypeHybridOCU1 | Switch | Is engine type hybrid OCU1 | | ||
| details#engineTypeHybridOCU2 | Switch | Is engine type hybrid OCU2 | | ||
| details#engineTypeCNG | Switch | Is engine type compressed natural gas | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are rather properties than Channels.
for (int i = 0; i < vinList.size(); i++) { | ||
String vin = (String) vinList.get(i); | ||
String dashboardUrl = (String) dashboardUrlList.get(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better check if both lists have the same length.
for (int i = 0; i < vinList.size(); i++) { | ||
String vin = (String) vinList.get(i); | ||
logger.debug("Trying to fetch status for vehicle with VIN {}", vin); | ||
String dashboardUrl = (String) dashboardUrlList.get(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
while (requestStatus != null && requestStatus.equals(REQUEST_IN_PROGRESS)) { | ||
try { | ||
long currentTime = System.currentTimeMillis(); | ||
logger.debug("Time: {}", new Timestamp(currentTime)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use the SQL class by intention?
private @Nullable VehicleHandler handler; | ||
|
||
public VWWeConnectActions() { | ||
logger.info("VW We Connect actions service instanciated"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this message be replaced by using the debugger or by increasing the framework's log level? See point 4 https://www.openhab.org/docs/developer/guidelines.html#f-logging
|
||
public static void heaterStartCommand(@Nullable ThingActions actions) { | ||
if (actions instanceof VWWeConnectActions) { | ||
((VWWeConnectActions) actions).heaterStartCommand(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you aware of this bug openhab/openhab-core#1265?
You could add the workaround like here:
https://github.com/openhab/openhab-addons/blob/2.5.x/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/action/EcobeeActions.java#L89
Travis tests were successfulHey @jannegpriv, |
Signed-off-by: Jan Gustafsson <[email protected]>
Signed-off-by: Jan Gustafsson <[email protected]>
Signed-off-by: Jan Gustafsson <[email protected]>
a0ffa81
to
1b89e77
Compare
Automatic code migration to openHAB 3 succeeded. The resulting code can be found at https://ci.openhab.org/job/openHAB-Addons-Migration/30/artifact/bundles/. You can download the migrated code from there and create a new PR against the master branch of the openhab-addons repo to contribute it for being included in openHAB 3.x. Please see this issue about the details on how to proceed with your existing PR. |
Signed-off-by: Jan Gustafsson <[email protected]>
@Hilbrand I've changed my upstream to point to openhab-addons after the name change but I fail to merge into my 2,5,x branch:
Do I have to fork and clone the openhab-addons from start? |
It might be easier to start over. Nevertheless, you need to migrate your code manually to OH3 or use the migrated code by the openhab-bot. |
By start-over you mean to close this PR, do a new fork/clone and adapt my binding to 3.0 and then open a new PR towards 3.0? |
Correct. The procedure is described here #8512. The bot posted a link to the migrated code above: #8314 (comment) |
OK, thanks for the tips! :-) |
@fwolter @Hilbrand
I've added the binding to the
I'm not sure this is a new problem or if I had it on my old build environment for 2.5.x and resolved it there in a way I cannot remember now, do you have any tips how to fix this? |
The groupId |
After doing some When debugging and starting a scan from the new GUI I got the following WARN:
That is a new warning, how do I fix that? I got the following definitions in the vehicle.xml:
What is the |
DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withLabel(label) | ||
.withBridge(bridgeUID).withProperty(VIN, vin).withRepresentationProperty(vin).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The representation property must be the name of the property, not the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[vwweconnect] [WIP] Initial contribution.
My goal is to add support for the VW We Connect portal to openHAB.
Link to community thread with URL to latest built jar-file:
https://community.openhab.org/t/new-binding-volkswagen-we-connect/92057