skagmo / ha_vwid

Volkswagen ID component for Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Service to start preheating manually

esbenr opened this issue · comments

commented

It could be awesome of it was possible to call a service and start preheating.
I would like to contribute with this, if you can help me out with some basic info on the the API.

It would be a nice feature and it's on my to-do list, however I haven't had the time to do it. Would be great if you could give it a try.

Unfortunately I don't have any more info on the We Connect API. It's not documented anywhere, and the only thing I can recommend is to collect snippets of information from various forums or look at source code for other projects using the API. To be honest the lack of API documentation is the biggest blocker for me to get features like this done.

commented

That's all fine.
My approach will be to hook my phone up though Charles proxy and record the API call when the preheating is started.
In that way I can possibly expand the pyton library to perform the same call.
At least that's how I found out how to pull data from the MyVolkswagen app into HA. So I will try that and let you know of my progress.

Is this relevant? https://pypi.org/project/weconnect/#files
Unpack and check \weconnect-0.25.1\weconnect\elements
I don't know if this is helpful but I am also interested to get some more features, the WeConnectID app isn't very impressing (the previous WeConnect app [for non-ID cars] was a lot better).

A service that can set any settable attribute would be great. In a similar way as mqtt.publish.

service: ha_vwid.set_value
data:
  attribute: /vehicles/WVWABCE1ZSD057394/controls/climatization
  value: start

Till Steinbach's Github should be a good source of inspiration, especially WeConnect-python and WeConnect-cli.

Edit: Maybe /vehicles/WVWABCE1ZSD057394 is not needed, since that information is available to the integration already.

Edit2: The following attributes seems settable for me:

/status/chargingSettings/maxChargeCurrentAC
/status/chargingSettings/autoUnlockPlugWhenCharged
/status/chargingSettings/targetSOC_pct
/status/climatisationSettings/targetTemperature_K
/status/climatisationSettings/targetTemperature_C
/status/climatisationSettings/targetTemperature_F
/status/climatisationSettings/climatisationWithoutExternalPower
/status/climatisationSettings/climatizationAtUnlock
/status/climatisationSettings/windowHeatingEnabled
/status/climatisationSettings/zoneFrontLeftEnabled
/status/climatisationSettings/zoneFrontRightEnabled
/controls/charging
/controls/climatization

Shameless kick for a little attention.

Being able to send commands to the car is probably the #1 item on my wishlist, not just for this HASS component but for all of my home automations. I'd love to contribute but I just don't have the skills to do so.

Totally up to you @skagmo of course, but I think it would be worth while to consider using https://github.com/tillsteinbach/WeConnect-python. It seems to be very actively maintained, and already contains the functionality to send commands. It would "just" be the HA integration needed.

Also take a look at this: https://github.com/mitch-dc/volkswagen_we_connect_id

Mitch-dc already created a HA integration based on the library mentioned by @jonasbkarlsson. And also provides services in HA to start the preheating, change charging speed and target SoC.

@jonasbkarlsson Thanks for the heads up. I wasn't aware his library supported WeConnect ID (though it was only WeConnect). It would make sense to move over and don't maintain two similar libraries, however 80 % of this project is the WeConnect ID library, so if I ever use his library I think it will be pretty much a new project. I really don't have the time to do that now, and like @MichelBarneveld points out there are already projects that have started using his library, so I'd suggest trying out that instead if you want to enable communication back to your car anytime soon.

@MichelBarneveld That's nice to see. @BugBasher28 I'd suggest trying that out for the features you request.