OVMS V2 (dexters web) with Node-Red and Home Assistant

Someone has asked on the FB group about using Node red with OVMS. You can do it very easily with OVMS V3 which works with MQTT but this doesn’t (yet) play nice with the mobile app, so I thought I would share my flow which uses the useful HTTP queries available on the Dexters Web server.

Note: Please play nice with the queries on the server. The data does not get uploaded faster than every 60s from the OVMS module by default so there is no point going any faster.

Trigger: Every 60s (or by manual override button)

Http Request: Pulls the “csv” from Dexters Web, this is a text stream with all the latest stats from the last OVMS upload

Split 1: Breaks up the multiple files contained in the text streams
Switch: Routes each file into the next area
Split 2 + switch 2: Strips out the headers from the files
csv (multiple): correctly assigns the headers to the data in the CSV format so you can access it in a message payload
debug (multiple): to show OVMS payloads and how they are loaded into msg.payload
device item: posts location data to a home assistant device for location tracking
function + mqtt: checks if this is new data (new timestamp) and then posts to MQTT

I also attach my JSON export with the personal data removed (please let me know if i have left anything i shouldnt have)OVMSv2_NodeRed_example.json (31.9 KB)

1 Like

Hehe, nicely done! I just have deployed an external mqtt broker which is bridged to the “local” mqtt broker. Not sure which way is more mobile data intensiv.

This is great. I’ve used it to directly update entities in Home Assistant and skipped the Matt bit. Works great…thanks!!

1 Like

New and improved with an entity created with all state information from OVMS v2 (for all your grafana needs). Note that the MG does not support all states so some will remain zero.
image

OVMSV2-Example-2.json (46.7 KB)

Please can somebody tell me how to get my credentials in this last flow?
Is vehicle ID and password enough?

Try it out on a web browser, you can just put it in as a URL. Just vehicle ID and the password set on Dexter’s web is enough (not the password on the OVMS unit)

Do I have to change the url in the http request node?
Now it looks like this:
https://dexters-web.de/api/call?fn.name=ovms/export&fn.vehicleid=CAR-ID&fn.carpass=CAR-PASS&fn.last=1&fn.format=csv

If I open vehicle status on Dexter website I can see the data of my MG
Then I copy this url, it looks like this:
-https://dexters-web.de/?action=Acc.Custom&_mod=1&lang=EN&_status=J516Xx
Then I paste it in the http request node (rule: URL)
Deploy etc. but after it stays connecting and no data of the MG
What am I doing wrong?
Note: I just run the basic Home assistant on a Raspberry Pi 2 B
Node-Red has been installed as addon.
No MQTT installed.
Only OVMS V2 is active.

Maybe here something is wrong? LEAF-GZW

The LEAF-GZW node is just to create a home-assistant entity with all the states populated (GZW is my LEAF’s numberplate :slightly_smiling_face:)

You should be able to get the data straight from the dexters web server once you put your CAR-ID and CAR-PASS into the URL. That URL can be tested on a browser

URL here:

Creates a page:
image

Use Debug nodes to check the text files are coming out right, as if any states are missing the flow might fail

Like this and after paste in a browser?

https://dexters-web.de/api/call?fn.name=ovms/export&fn.vehicleid=???&fn.carpass=???&fn.last=1&fn.format=csv”

The ??? are ID and password from vehicle

Ok I tried allready and get a whole white page with data.
Now I will try again in Nodered and test the debugs
Thank you very much

Dear Mike,
I can see data from the car now, but the purple nodes on the right stay connecting infinite. What is wrong?

Those are for an MQTT server to emulate a OVMSv3 connection. If the other node works you can delete these.

OK, thank you very much!

Thanks a lot this is very big help.

To be a bit optimized with PW etc. I would build up an other standard block


otherwise every massage has your PW included.

Just to explain it is a change block and a delete of different information.
–>Standard: I put 4 deletes in because I use it also on other points in the flow.

Stay save, stay healthy
Nik

There is also the credentials node which can be used for this. I’ve built the same logic but using the normal api call. So not using the .zip version. Will try to upload it later today.