Hi All,
Very new here but I wanted to share something that I’ve been working on the last few days. Those with a Nissan Leaf 2015 or later know that Nissan removed the old 80% charge option, so on any recent Leaf there is no officially supported way to charge to less than 100% other than manually keeping an eye on the charge level and unplugging it!
While the Nissan API allows a charge to be started remotely (if deferred by the charge timer) you can’t stop a charge via the API either, so extra hardware is needed to implement any sort of automated charge limiter. Very annoying.
Added to the mix I use the built in charge timer to charge my Leaf 30 in the early hours of the morning, which means I have the charge timer enabled in the car. I’ll shortly be switching to a cheaper night rate between 2am and 6am so charging needs to be within this time window.
I also use the timed climate control from 7:10 to 7:40 weekdays and this needs the charge point to be ON otherwise no climate control…
My charge point is an old 2017 Rolec “dumb EVSE” with no smart connectivity however some time ago I modified it using a Shelly One WiFi switch. I won’t go into too much detail about that modification here as it’s very specific to the model of EVSE, but for anyone curious you can read about it on speakev.com.
At the time I was mainly just using the schedule feature in the Shelly One and remote control by app, however I did implement one forward looking feature that has paid off with Home Assistant - the relay that switches the SW input of the Shelly.
This relay is only powered up when the main contactors close when the car actively requests power from the EVSE. The Shelly is configured with this switch input as a “detached switch” which only feeds state back but doesn’t control the relay in any way.
From a Home Assistant point of view the Shelly switch in this mode looks like a “switch” device (Car Charger Enabled, below) that you can turn on or off which enables and disables the EVSE, and a “binary_sensor” (Car Charger Active, below) which feeds back the state of whether the car is actually charging or not.
This ability to know instantly when the car has started or stopped charging without having to poll the Nissan API frequently to find out is key to the way I’ve designed my charge limiter and dashboard.
Here’s what my UI currently looks like - plain but functional:
By adjusting the Charge Limit slider I can choose whatever charge limit I want. I can also press a button to force an immediate refresh through the Nissan API, press a button to override the car’s charge timer, toggle the Climate control toggle to start or stop remote climate control and also manually toggle on/off the EVSE if I want to manually turn power off or on.
As well as providing the charge limit setting it duplicates pretty much all of functionality of the Nissan app apart from the driving statistics stuff… since I’ve had this UI up and running I’ve basically stopped using the Nissan app.
On the right you can see a graph of last nights charge which started at 2am and finished almost bang on the requested 85%. The timeline looks like this:
-
The car’s built in timer starts charging at 2am - the EVSE is also scheduled to come on at 2am, although it’s usually already on from the previous day so this is just in case I turned it off manually for some reason and forgot to turn it back on.
-
As soon as Car Charger Active changes to the on state (which happens instantly - the Shelly integration seems to work directly to the Shelly device across the network and is instantaneous) and other criteria are met the API is polled for the current SoC to get an initial figure and the Leaf integration then starts polling every 10 minutes to monitor the charging process.
-
When the limit is reached an automation turns off the EVSE stopping the charge, or if the car was still charging at 6am the car stops charging by itself.
-
At 6:10 the EVSE is scheduled (using the built in schedule of the Shelly One) to turn back on again, however because this is after the cars own charge window of 2am to 6am the car does not resume charging. (It charges for a few seconds only to “test” the power available from the EVSE)
-
At around 7:10 the cars climate control timer starts plugged in climate control without charging the car to 100%. (Although in practice it can rise by up to 2%)
That’ll do for this post, in the next post I’ll discuss the automations that are working behind the scenes.