AI got my Zoe yesterday and wanted to ask if someone else here has used any integration with home assistant. My main goal would be to get the battery status inside Home Assistant. I looked at https://github.com/epenet/hassRenaultZE and this seemed to be a soloution. However it seems that Renaulut is migrating from My ZE to another app/page called My Renault. I I can not register at the old site. They said everyone was to be migrated here soon. Anyone else with the similar problem?
Did you ever get this sorted , just ordered the car myself
Nope. Seems like we will have to wait for a new Renault API.
Iâve lost access to the previous API. MyRenault have been launched in France recently.
I donât know if someone is working on reverse engineering the new API.
I have noticed there are some activity here and maybe someone will solve this soon: https://github.com/edent/Renault-Zoe-API/issues/18
I wrote this last year whilst using Domoticz, shouldnât be too difficult to convert over to HA.
Thank you for sharing. If I understand your Domoticz implementation is for the previous API. There is already an implementation for HA on Github.
Did you have already look at the new API only available in MyRenault app?
I have the following working using ZE Services. It relies on sending a âcharge nowâ to update the stats. This will generate lots of email/sms from ZE Services indicating failed charges. You will need to switch these alerts off in the web-page
It will also start a charge if the Zoe is plugged in So donât use if you schedules overnight charges without amending the scripts !
Bash Script zoe_battery.sh (uses two params username and password) ensure script is executable
#!/bin/sh
extract=`curl -H "Content-Type: application/json" -X POST -d "{\"username\":\"$1\",\"password\":\"$2\"}" https://www.services.renault-ze.com/api/user/login`
token=`echo $extract|jq -r ".token"`
vin=`echo $extract|jq -r ".user.vehicle_details.VIN"`
charge= `curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://www.services.renault-ze.com/api/vehicle/$vin/charge`
battery=`curl -H "Authorization: Bearer $token" https://www.services.renault-ze.com/api/vehicle/$vin/battery`
echo $battery|jq .
Sensor
platform: command_line
name: zoe_battery
scan_interval: 1000
command: !secret zoe_batt
json_attributes:
- charging
- plugged
- charge_level
- remaining_range
- last_update
- charging_point
- remaining_time
Secret file
zoe_batt: âsh /config/zoe_battery.sh email passwordâ
Thanks for sharing. I think you are using the old API which is no more available in some countries. There is on github a custom components working for HA with a similar approach than yours.
Yes, the API is very crippled now, it does not seem to report back any updated battery details unless you post data to it. Been told it will be replaced here in the UK very shortly , hopefully we still be able to extract data from the new app
Difficulty seems to be related to pined certificate used for API request. Itâs above my current skills. Hope other will be able to help.
new api decoded
Iâve seen this and in conclusion he teases an incoming python package.
here it is
Yes and there is custom_component in development based on that by @epenet. You should have good news soon.
Hi all,
The new version of the component is available on Github
Please donât hesitate to download, test and confirm itâs all working for youâŚ
Currently itâs not working for me but I didnât had time to investigate why.
Iâve this type of error:
2019-07-26 23:36:05 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.zoe fails
Traceback (most recent call last):
File "/workspaces/home-assistant-container/homeassistant/helpers/entity.py", line 226, in async_update_ha_state
await self.async_device_update()
File "/workspaces/home-assistant-container/homeassistant/helpers/entity.py", line 383, in async_device_update
await self.async_update()
File "/workspaces/home-assistant-container/config/custom_components/renaultze/sensor.py", line 109, in async_update
jsonresult = await self._wrapper.apiGetBatteryStatus(self._vin)
File "/workspaces/home-assistant-container/config/custom_components/renaultze/myrenaultservice/MyRenaultService.py", line 165, in apiGetBatteryStatus
return await self.apiGetCall(path)
File "/workspaces/home-assistant-container/config/custom_components/renaultze/myrenaultservice/MyRenaultService.py", line 147, in apiGetCall
url = self._kamereon_root_url + path
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
It works ! Need some update compared to the initial code released by @epenet. a PR is waiting for make it available for everybody.
Thank you to jamesremuscat and @epenet for the this.
Thanks for all effort in this component!. Tried it now but get this error. I am based an Sweden where we have migrated to the new myrenault app.
Update. As usual i did try first without reading the entire thread. Just tried the PR by @oncleben31 and this works!