Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating with Open Vehicle Monitoring System (OVMS) #331

Closed
amotl opened this issue Jan 14, 2020 · 4 comments
Closed

Integrating with Open Vehicle Monitoring System (OVMS) #331

amotl opened this issue Jan 14, 2020 · 4 comments

Comments

@amotl
Copy link

amotl commented Jan 14, 2020

Hi there,

after writing down #330, I just found @glynhudson might already be working on a respective integration with the Open Vehicle Monitoring System (OVMS) he outlined within #321.

I am deliberately opening this issue as an anchor to track the integration between both systems.

With kind regards,
Andreas.

cc @dexterbg

@amotl amotl changed the title Integrating with OVMS Integrating with Open Vehicle Monitoring System (OVMS) Jan 14, 2020
@glynhudson
Copy link

Hi @amotl,

I've recently been using OwnTracks with OVMS which works well to record the location of the vehicle. See an example of a recent trip I made this christmas in my EV

Screenshot 2020-01-11 at 15 19 44

The integration was done in quick and hacky way using OVMS V3 server logging to MQTT then using NodeRED so subscribe to the OVMS GPS MQTT topics and then publish these to owntracks recorder MQTT topics in the correct format. I'm happy to share this NodeRED flow but it's probably not the most eligant solution.

@amotl
Copy link
Author

amotl commented Jan 15, 2020

I've recently been using OwnTracks with OVMS which works well to record the location of the vehicle.

Thanks for sharing your example!

I'm happy to share this NodeRED flow [...]

Sure, this would well resonate with what I wrote elsewhere just yesterday where I've asked @dexterbg about appropriate integration with InfluxDB and Grafana through Kotori.

Saying that, OVMS might additionally add support for Node-RED for users aiming to make their custom data and/or notification flows. daq-tools/kotori#21 (comment)

@glynhudson
Copy link

glynhudson commented Jan 19, 2020

Here is my NodeRED flow:

Screenshot_2020-01-19_02-37-43

[{"id":"89e9d395.f358","type":"mqtt in","z":"d605de2e.9f01e","name":"","topic":"ovms/emonpi/<VEHICLE-ID>/metric/v/p/latitude","qos":"0","broker":"42d1a439.248b0c","x":200,"y":60,"wires":[["a434b606.26e328"]]},{"id":"c9be458f.e2e928","type":"mqtt in","z":"d605de2e.9f01e","name":"","topic":"ovms/emonpi/<VEHICLE-ID>/metric/v/p/longitude","qos":"0","broker":"42d1a439.248b0c","x":200,"y":100,"wires":[["b2f98901.84ec48"]]},{"id":"dd774d3a.647f2","type":"function","z":"d605de2e.9f01e","name":"context.global.lat","func":"context.global.lat = msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":80,"wires":[["9656d4f7.b65408"]]},{"id":"3087ba49.6ce996","type":"function","z":"d605de2e.9f01e","name":"context.global.lon","func":"context.global.lon = msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":120,"wires":[[]]},{"id":"9656d4f7.b65408","type":"debug","z":"d605de2e.9f01e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":930,"y":80,"wires":[]},{"id":"a434b606.26e328","type":"function","z":"d605de2e.9f01e","name":"ignore 0","func":"var value=msg.payload;\n// if (value !==\"\" && value !==\"0\" && value !==0 );{\nif (value){\n    return msg;\n}\n","outputs":1,"noerr":0,"x":480,"y":80,"wires":[["dd774d3a.647f2"]]},{"id":"b2f98901.84ec48","type":"function","z":"d605de2e.9f01e","name":"ignore 0","func":"var value=msg.payload;\n// if (value !==\"\" && value !==\"0\" && value !==0 );{\nif (value){\n    return msg;\n}\n","outputs":1,"noerr":0,"x":480,"y":120,"wires":[["3087ba49.6ce996"]]},{"id":"f4ec6fc4.4dcaa","type":"inject","z":"d605de2e.9f01e","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":"60","x":90,"y":260,"wires":[["e9f44233.cddf6"]]},{"id":"a61cddc0.6c138","type":"function","z":"d605de2e.9f01e","name":"create object","func":"var owntracks={_type:\"location\",tst:msg.payload,lat:Number(context.global.lat),lon:Number(context.global.lon)};\nvar newMsg = { payload: JSON.stringify(owntracks) };\nreturn newMsg;","outputs":1,"noerr":0,"x":450,"y":260,"wires":[["4b6d9633.eead28","a5474c90.c79c4","55689f77.2efd3"]]},{"id":"4b6d9633.eead28","type":"debug","z":"d605de2e.9f01e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":930,"y":260,"wires":[]},{"id":"a5474c90.c79c4","type":"mqtt out","z":"d605de2e.9f01e","name":"","topic":"owntracks/my/car","qos":"","retain":"","broker":"834ac211.8eba8","x":730,"y":300,"wires":[]},{"id":"55689f77.2efd3","type":"file","z":"d605de2e.9f01e","name":"","filename":"/data/gps-json.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","x":770,"y":200,"wires":[[]]},{"id":"e9f44233.cddf6","type":"function","z":"d605de2e.9f01e","name":"timestamp in s","func":"// msg.payload = msg.payload/1000;\nmsg.payload = Math.floor(Date.now() / 1000);\nreturn msg;","outputs":1,"noerr":0,"x":260,"y":260,"wires":[["a61cddc0.6c138"]]},{"id":"42d1a439.248b0c","type":"mqtt-broker","z":"","name":"emonpi","broker":"IP-ADDRESS","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"834ac211.8eba8","type":"mqtt-broker","z":"","name":"MQTT-SERVER","broker":"IP-ADDRESS","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

@amotl
Copy link
Author

amotl commented Jan 19, 2020

Thanks @glynhudson! @jpmens, @ckrey, @linusg and the community will like it. On the other hand, I might be able to reuse the essence of that (ovms/emonpi/<VEHICLE-ID>/metric/v/p) to work on daq-tools/kotori#21.

@jpmens: Should we add this file [1] to the repository or put it into the documentation somehow?

[1] https://gist.github.com/amotl/53489f65ea769d5c6118afbd65aa92a3

@jpmens jpmens closed this as completed in 47a82d1 Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants