DIY OVMS (Open Vehicles) Integration

Heya!

I’ve just completed an integration with Home Assistant for my OVMS module installed on my Nissan LEAF. I couldn’t find any existing resources on doing this so I thought I’d write up a quick blog post that explains how to achieve it. It’s pretty simple, but the OVMS API docs were a bit hard to make sense of, so hopefully having this documented somewhere is useful to others!

I even did a (questionably useful lol) integration with HomeKit. It will remain a bit janky though until Apple adds an EV type of entity to HomeKit (which is hopefully not too far away!).

Hope this helps someone!

Cheers!

8 Likes

That’s cool. I wasn’t aware of OVMS.

Yeah it’s a pretty nice system! Way better than the garbage Nissan LEAF app. :sweat_smile:

Hi Jaimyn,

Thanks for your work!

I’m not able to generate an API Token from the openvehicles.com API.

Could you please help me?

Thanks!

> C:\Users\Vincent>curl -v --location --request GET "http://api.openvehicles.com:6868/api/token?username=******&password=******" 
> Note: Unnecessary use of -X or --request, GET is already inferred.                                                      
> * Trying 175.45.17.222...
> * TCP_NODELAY set
> * Connected to api.openvehicles.com (175.45.17.222) port 6868 (#0)                                                     
> > GET /api/token?username=******&password=****** HTTP/1.1                                                            
> > Host: api.openvehicles.com:6868                                                                                       
> > User-Agent: curl/7.55.1                                                                                               
> > Accept: */*                                                                                                           
> >                                                                                                                       
> * HTTP 1.0, assume close after body                                                                                     
> < HTTP/1.0 200 Logout ok                                                                                                
> < Content-Type: application/json                                                                                        
> < Access-Control-Allow-Origin: *                                                                                        
> < Expires: Sun, 27 Jun 2021 20:37:47 GMT                                                                                
> < Connection: close                                                                                                     
> < Content-Length: 3                                                                                                     
> < Cache-Control: max-age=0                                                                                              
> < Date: Sun, 27 Jun 2021 20:37:47 GMT                                                                                   
> <                                                                                                                       
> []                                                                                                                      
> * Closing connection 0

Apologies! I made a typo in the blog post! Replace GET with POST and it should work :slight_smile: I’ve updated the blog post.

Let me know how you find it! It’s been pretty cool to have the battery percent and range in HomeKit, even if it’s a little janky haha. I’ve also setup an additional template sensor for the SOH (state of health) so I can track it over time.

It worked! Thanks again!
Do you know if it’s possible to start the HVAC with the http API?

I don’t think so, you can see a list of all the current endpoints here: Requests — Open Vehicles documentation

I’ve seen the list already and it appears it’s not possible.
Do you know another way? MQTT?

I’m not sure sorry! I haven’t used their MQTT API at all yet as the HTTP API does what I wanted. :slight_smile:

1 Like

There is some info here, and if you type mqtt into the search it will find you the mqtt support. Nissan Leaf/e-NV200 — Open Vehicles documentation

1 Like

I looked at OVMS web and it is pretty poor. You cannot find anywhere if it is for electric cars only, or for any ODB-II compatible car, or what. Can you shed more light to it?

hello jabelone, seen your integration i OVMS, I have a Twizy with OVMS and I’m on https://dexters-web.de server
i might know if it is possible to integrate the same on HA and how to do it
Thanks for your nice work that you shared
This my configuration could you help me to adapt it for HA?
thank you

Module:
VehicleID:Twizy45
Units:K
Notifications:IP
VehicleType:RT
CarType:RT

PARAMS?

Params: 0:+39338xyxyxyxy 1:xyxyxy 2:K 3:IP 4:146.0.237.226 5:internet.it 8:Twizy45 9:xyxyxy 14:RT 15:1 24:2 26:0 27:0 29:83.48 31:1

It’s possible, there is some info here:
https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/624

The procedure seems to be the same, with the dexters address…

Hello All,

You could check out this thread for some info: Build rest command to send data to abetterrouteplanner.com

My car (Bolt / Ampera-e) is not oficialy supported in ovms but i’m using a modified volt/ampera template to get some basic data.

Some screenshots of my integration.

image

I get errors if I use https for the calls to https://api.openvehicles.com:6868
“curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number”
if I use http it works fine but I don’t like sending an unencrypted password to the internet.
Any Ideas what’s the cause?

Hello,
I tried several times to get the token from dexter-web.de but failed.
I managed to get the one from www.openvehicles.com
Has anyone of you managed to get a Token from the dexter-web.de server, if it was possible for you, can you help me? Thank you

Same issue here. The procedure doesn’t seem to work with Dexter-web.de. Did you ( @dolam ) manage to get the european car to work on the US openvehicles.com ?

No, non ho provato perchè il server americano in passato mi dava problemi

I also had the curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number error message trying to get a token from https://api.openvehicles.com:6868. It looks like port 6868 expects http. However if you change that to port 6869 the https request works.

In addition, my password contained special characters which could not be put into the token request URL as-is, so I first used https://www.urlencoder.org/ to url-encode the password itself.