PON the importer of VAG (Volkswagen, Audi, Skoda, Seat) cars in the Netherlands is equipping a lot of the new cars they sell with connected technology.
You can check the state of your car and see where it is and where it has been. Really nice, but I wanted to have it in Home Assistant.
So I asked PON nicely, but as expected they were not giving me access to the API.
So I reversed engineered their App and I seems their API is protected very poorly.
So now I have it integrated into my Hass.
At the moment it makes a device_tracker with the location, shows a few binary_sensors (ignition, locked, park break) and a few sensors (fuel, mileage)
A lot more can be added, I just didn’t yet… If you want something added let me know.
I have setup the mijnpon: statements in my configuration. But it seems it has an issue getting a TOKEN.
2017-09-14 10:07:16 ERROR (MainThread) [homeassistant.setup] Error during setup of component mijnpon
Traceback (most recent call last):
File “/home/homeassistant/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py”, line 194, in _async_setup_component
component.setup, hass, processed_config)
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/mijnpon.py”, line 42, in setup
hass.data[DATA_MIJNPON] = MijnPon(hass, conf)
File “/home/homeassistant/.homeassistant/custom_components/mijnpon.py”, line 64, in init
password=conf.get(CONF_PASSWORD), cache_ttl=conf.get(CONF_SCAN_INTERVAL))
File “/home/homeassistant/homeassistant/lib/python3.4/site-packages/mijnpon/init.py”, line 201, in init
self._auth()
File “/home/homeassistant/homeassistant/lib/python3.4/site-packages/mijnpon/init.py”, line 227, in _auth
token = self._mijnPonApi.fetch_token(token_url=TOKEN_URL, username=‘pon\’+self._username, password=self._password, client_id=self._client_id, client_secret=self._client_secret, scope=SCOPE)
File “/home/homeassistant/homeassistant/lib/python3.4/site-packages/requests_oauthlib/oauth2_session.py”, line 244, in fetch_token
self._client.parse_request_body_response(r.text, scope=self.scope)
File “/home/homeassistant/homeassistant/lib/python3.4/site-packages/oauthlib/oauth2/rfc6749/clients/base.py”, line 409, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File “/home/homeassistant/homeassistant/lib/python3.4/site-packages/oauthlib/oauth2/rfc6749/parameters.py”, line 376, in parse_token_response
validate_token_parameters(params)
File “/home/homeassistant/homeassistant/lib/python3.4/site-packages/oauthlib/oauth2/rfc6749/parameters.py”, line 386, in validate_token_parameters
raise MissingTokenError(description=“Missing access token parameter.”)
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
what could be the reason for that? I changed the password to be more “readable” but that does not resolve the thing above.
Hmm interesting. I have shortened my password, but that does not work. So something else is off. It might be because I get redirected to the German version of the site. I already asked VW to correct it to the Dutch location, but … no response yet …
I can now. I used to login to “Car-Net” which apparently has different login credentials then your URL. It seems that my email address was known and I resetted it to the one I use for Car-Net. It works now
(I never ever logged in to mijnvolkswagen at all, I didn’t even know it existed, thanks for that!)
Thanks for this great plugin You mentioned that a lot can be added. Do you know if the car temperature can be read? Would be nice to be able to configure a notification like “Car temperature is below 0 degrees, possible window frost” or something.
I don’t see it in the data, just the Engine Coolant Temperature.
I don’t think anything is updated while the car is not powered, so not sure it would be useful anyway…
Indeed (hi FrankT!), the statistics and information is not updated when the car is off and/or there is no “trigger” (door unlock, open, etc). I see that with my graphs, the statistics are updated because I use the car during the week. but the interval is… interesting. Same goes for the weekend when the car is mostly not in use or much less. The gap between the updates is sometimest too long, making the stats go nuts (in grafana, after them being exported by HASS).
I had contact with VW already, but I did not get an conclusive answer about this yet.
To bad. this info isn’t available. since most other info doesn’t change when the car is parked, it makes sense the information isn’t updated in the meantime. I’ll find another temperature source to control the block heater.
Pretty old topic, but i’m trying to get this to work on my Raspberry Pi Home Assistant setup but when enabling mijnpon: in my config i get an error:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/mijnpon.py", line 42, in setup
hass.data[DATA_MIJNPON] = MijnPon(hass, conf)
File "/home/homeassistant/.homeassistant/custom_components/mijnpon.py", line 58, in __init__
import mijnpon
File "/srv/homeassistant/lib/python3.5/site-packages/mijnpon/__init__.py", line 9, in <module>
from requests_oauthlib import OAuth2Session
File "/srv/homeassistant/lib/python3.5/site-packages/requests_oauthlib/__init__.py", line 9, in <module>
if requests.__version__ < '2.0.0':
TypeError: unorderable types: module() < str()
Seems to me something is missing from my python setup but i’m not sure what. I did run:
pip3 install requests requests_oauthlib but thats not enough i think?