SoC for Opel Astra and other cars: OBD adapter + MQTT #25214
Replies: 7 comments 27 replies
|
Very nice, this will also help in the future once there is no 2G network coverage and the car cannot communicate with the PSA backend anymore. |
|
Great solution and very well explained! Should work for all other car brands too. |
|
As an addition: The WiCAN is in theory capable of an even better solution, as it allows listening for any data frame on the CAN bus instead of just querying specific OBD PIDs. Unfortunately, this solution was not working for @Formstation, probably because the newer Astra uses different CAN data frames. One could give it a try to sniff and analyze the data on the CAN bus to get that information, but that is not an easy task. But at least it is possible to use the WiCAN together with SavvyCAN for this purpose. |
|
Sadly this solutiuon will not work for e.g. Volkswagen Passat GTE - as they monitor the CAN bus while ignition is off. If the the WiCAN will be active the alarm system of the car will tigger. This behavior can not be disabled permanently for the Passat GTE :-(.... so if I use this - the car alarm goes on every time the HV Battery is beeing charged at night time! |
This comment was marked as disruptive content.
This comment was marked as disruptive content.
|
hi @Formstation and thank you for your great explanation. |
|
This looks really interesting, our Mokka-e is on its way and want to charge automatic. Is it possible to use this MQTT connection also in HomeAssistant? |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It's possible to get the charge status of your vehicle into evcc without car brand app madness and token terror!
I didn't want a subscription to the Stallantis app just for getting the SoC into evcc, so I started looking for an alternative. However, there wasn't one specifically for the Astra in connection with evcc yet. Nevertheless, thanks to the help of @hurzhurz, @moritzklein, @meatpiHQ and others, I managed to come up with a working solution for my Astra. That should also work for many other models, especially if there is a suitable vehicle profile in the WiCAN interface.
For this, you will need the WiCAN OBD-II adapter from meatpi and a machine that can run mosquitto/MQTT. I installed Mosquitto on the same device that runs evcc. In my case, this is an old Mac mini, which runs all day anyway as a media center and Minecraft server.
First, you need to plug the WiCAN adapter into the OBD port of your Astra on the left under the steering wheel. I recommend a 30 cm extension to hide the adapter under the cover. Make sure that it is actually connected.
Then set up the WiCAN adapter. To do this, you first connect to the device's Wi-Fi with a mobile phone, tablet or laptop. The SSID will look like "WiCAN_xxxxxxxxxxxx", default password: @meatpi#, and access the adapter settings via IP 192.168.80.1 in any browser. Enter your home Wi-Fi details there. Detailed instructions can be found here: https://www.meatpi.com/products/wican
The adapter should now appear in your router's device overview. There you will see its IP address, which you can now use to open the adapter interface in the browser of a device connected to your home Wi-Fi, in my case 192.168.178.63. The car's ignition must be on for this to work!
I recommend performing a firmware update first, you get the newest version here: https://github.com/meatpiHQ/wican-fw/releases/
Now it's time to get MQTT to work. Here you will find all the ways to get it running on your system. https://mosquitto.org/download/
As a complete novice, it was quite a challenge for me, but it's worth it. Don't give up!
It is also important to set a username and password. Please research for yourself how this works on your system. Also, how to start and stop the server in the terminal, or check its status.
To ensure that the MQTT server knows where to wait for the SoC from the WiCAN adapter and make it available for evcc, the following lines must be written to the MQTT configuration file:
Then make the following settings in the WiCAN interface in your browser:
To check whether MQTT is receiving the SoC from the WiCAN adapter, use an app such as MQTT Explorer. https://mqtt-explorer.com
Last but not least, the evcc.yaml file must be adjusted by adding MQTT and adjusting the values for the Opel Astra.
Since the WiCAN adapter only transmits the SoC when the vehicle's ignition is running, I set the timeout to 8 hours to avoid the evcc error message “Opel Astra: vehicle soc: outdated”. If anybody has a more efficient solution, please let me know.
And if you've managed to get it working with another model, please feel free to share your experience.
All reactions