I’m currently working on a component to integrate with the Nissan Leaf CarWings/Nissan Connect API, providing battery charge, turning on charging (but not off, they don’t support that…), turning climate control on/off, etc.
Github Repo is here, for anyone who wants to follow/contribute: https://github.com/BenWoodford/home-assistant/tree/nissanleaf
WARNING: I don’t know how often this will poll your Leaf right now, so you’ve been warned. If you kill your 12V, I accept no responsibility.
UPDATE
The following components are available:
- Leaf Charge % (Numeric Sensor)
- Plugged In State (Binary Sensor)
- Range with AC Off (Numeric Sensor)
- Range with AC On (Numeric Sensor)
- Charging Status (Switch)
- Climate Control (Switch)
You can’t turn charging off, as per the API. Best to integrate your home charger for that.
Range abides by the unit system in your HASS config, so metric or imperial. You can force it to miles using force_miles: true
though
The config block is as follows:
nissan_leaf:
username: <username/email>
password: <password>
region: <region> (see below)
nissan_connect: <true/false> (optional, defaults to true)
update_interval: <minutes> (see below, default is 30)
update_interval_charging: <minutes> (default is 15)
update_interval_climate: <minutes> (default is 5)
force_miles: true
Notes
Region: This must be one of: “NNA” (USA), “NE” (Europe), “NCI” (Canada), “NMA” (Australia) “NML” (Japan). I have only tested this component in Europe.
Nissan Connect: If your car has the updated head unit (Nissan Connect rather than Car Wings) then you can pull the location, which will be added as a device tracker in the future. If you have a pre-2016 24kwh Leaf then you will have CarWings and should set this to false or it will crash the component.
Interval: This is the interval in minutes to poll the car. The lower this is, the higher the risk to your 12V battery - if it dies, that’s on you. A 30 minute poll should be fine and not cause any battery distress, unless you’re leaving it unplugged and sat idle for weeks on end which is a pretty silly thing to do anyway. You’ve also got intervals for when charging and when climate control is on - don’t be silly with these, 1 or 2 minutes will likely queue them up before they finish.
Reporting Bugs
Please use the following logger config when reporting issues, there is a lot of info under the debug level that can be useful.
logger:
default: critical
logs:
homeassistant.components.nissan_leaf: debug
homeassistant.components.sensor.nissan_leaf: debug
homeassistant.components.switch.nissan_leaf: debug