As a related but side project from my work with OpenEVSE EV charging station (see thread).
I have put together a little script to poll the Nissan Leaf EV connect API to obtain battery charge level and charging status of a Nissan LEAF EV and publish the data to MQTT. Climate control can also be controlled via and MQTT topic.
Once data is in MQTT it can easily be used to inform home automation and smart charging applications. e.g OpenHAB, Home Assistant, OpenEVSE.
Here is an example of displaying the MQTT data via openHAB Android app:
In this example the the ‘Home Charger’ power (openEVSE) is monitored by emonPi, however data could also come from openEVSE with wifi connectivity to post to Emoncms. 14W is the power going to the charging station in standby plus emonPi (Raspberry Pi 3)
Code and install instructions are on my GitHub:
I experiment running the script via a systemd unit script, this is the fist time I have used systemd for my own script. I was impressed with how easy it was to use and how powerful systemd is e.g with an extra couple of lines in the
leaf-python-mqtt.service unit file it’s possible to instruct systemd to reload the script after X number of seconds if the script exists due to an error
Suggestions for improvements welcome.
This is a personal hacked together side-project and not an officially supported OpenEnergyMonitor development.