Diverting Solar to Charge an Electric Car

Hi Keith, i’m sorry i’m unable to help you with your integration, from what i see from smartevse it has a external box with CT’s that is somehow connected to the EVSE. If you understand what goes into that connection maybe you can simulate the desired operation, i don’t know.

But if your goal is to divert surplus energy from solar prepare to be dissapointed. It sure looks cool, but in practice what will happen is:

  • you will buy energy from the grid at possible higher price to meet the minimum 6A charging of the EV. And part of that energy is wasted in inneficiency because:
  • Charging at 6A has less overall efficiency, for the Nissan Leaf the numbers go down to 78% efficiency @ 6A and for the Renault Zoe, you get a ridiculous 54% efficiency at 10A!!

the really good feature that comes out of this is the ability to automatically control the maximum energy you can use without tripping the utility company circuit breaker. The possibility of charging depending on solar is actually a side effect of this system and is great for marketing purposes lol

I have been working on the EVSE side on my free time to make it available as open source and kind of forgot this node-red part, the charge algorithm function actually needs improvements. Maybe if there is interest i can share the actual code of the function.

BR

Hi BR. Thanks for the reply. I am aware of the communication protocol between the CT sensorbox and the Smart EVSE, and I am not sure if Node RED will be able to emulate this connection. You are correct about the benefit of maximising the charge rate; here in Oz I have a 63A grid supply plus a 20A Solar feed; allowing the Smart EVSE to determine the charge rate has given me over 50A (connection cable limited). Without this program and using connected electrical load rules I had to changeover between air-conditioning or the 32A max EVSE. I often manually adjust the Tesla charge rate to match the available solar power; by starting at 8A, incrementing up to 18A for a number of hours then decrementing back to 8A I can gain over 16kWh on a good winters day without using the grid, 22kWh plus in summer. My requirement is to automate this, and on a bad day (passing clouds) just have a few instances of a minimum 6A, when I might end up paying for a few kWh at 17c AUS per hour (non-peak rate). The Smart EVSE algorithms are really excellent and it is just the connection between this and the emonPi I need to resolve. Have you been able to physically connect between your solution hardware, and if so, how did you arrange the output from emonPi?

K

Maybe you need a “driver” o talk to the EVSE. What kind of communication protocol is implemented? Is it available and documented?

My evse is MQTT native so integrating it with node-red is really easy.

No dia 06/08/2016, às 13:38, Keith [email protected] escreveu:

keithfromoz Keith
August 6
Hi BR. Thanks for the reply. I am aware of the communication protocol between the CT sensorbox and the Smart EVSE, and I am not sure if Node RED will be able to emulate this connection. You are correct about the benefit of maximising the charge rate; here in Oz I have a 63A grid supply plus a 20A Solar feed; allowing the Smart EVSE to determine the charge rate has given me over 50A (connection cable limited). Without this program and using connected electrical load rules I had to changeover between air-conditioning or the 32A max EVSE. I often manually adjust the Tesla charge rate to match the available solar power; by starting at 8A, incrementing up to 18A for a number of hours then decrementing back to 8A I can gain over 16kWh on a good winters day without using the grid, 22kWh plus in summer. My requirement is to automate this, and on a bad day (passing clouds) just have a few instances of a minimum 6A, when I might end up paying for a few kWh at 17c AUS per hour (non-peak rate). The Smart EVSE algorithms are really excellent and it is just the connection between this and the emonPi I need to resolve. Have you been able to physically connect between your solution hardware, and if so, how did you arrange the output from emonPi?

K

Visit Topic or reply to this email to respond.

In Reply To

cab123
August 6
Hi Keith, i’m sorry i’m unable to help you with your integration, from what i see from smartevse it has a external box with CT’s that is somehow connected to the EVSE. If you understand what goes into that connection maybe you can simulate the desired operation, i don’t know. But if your goal is t…
Visit Topic or reply to this email to respond.

Again, many thanks for your interest. Smart EVSE is open source. Their Charge Controller connects to the CTs via their sensorbox which is also open source. Both programs are here:

The sensorbox program (“CurrentTX.c”) is well commented and has the following:
“Send buffer over RS485. Use PPP in HDLC-like Framing for transfers for protocol spec see:
http://tools.ietf.org/html/rfc1662
compatible with existing RS485 line used on SMA solar inverters.
baudrate is 1200 bps”
In my silly naive way I thought that NodeRED (designed to connect things together) would have a node that converted to this protocol, and that being Raspberry Pi based getting data in and out would be configurable. I am still hoping, as the combination of the Smart EVSE and emonPi would satisfy a growing demand to control EV charging at a user (not programming) level. I have always been optimistic…

K

So you need to tap into RS485 communication, i have had a similar chalenge
in the past, when i needed to get my solar inverter statistics to post to
emoncms. For my specific inverter, a Aurora PVI, the communication is
RS485. I used a dongle like this one (
http://www.ebay.com/itm/USB-to-RS485-TTL-Serial-Converter-Adapter-FTDI-interface-FT232RL-75176-Module-Ne-/161264238508?hash=item258c18ffac:g:c5gAAOSwT~9Wj4nl)
and then connect to raspberry pi USB port.

But in my case it was easier, since there is already a program that queries
the inverter an delivers data. I only had to make a small script that
executes the programand sends the results to emoncms and a MQTT topic to be
used by node-red directly.

Maybe you can do a similar hardware connections, and ask the smarevse
developer if there is any chance to make a scipt available to talk to the
EVSE.

From there it would be simple to make it available for processing in
node-red.

If you can make the evse work at the bash on the rpi i can assist you into
making a simpe script to talk to the EVSE through MQTT

Best Regards

Hi Keith,

I hope you don’t mind me answering your email on this thread. Hopefully, it will be of benefit to other users.

Node RED gathers data from the emonPi inputs by selecting the mqtt node and setting up the node using Server: localhost:1883, Topic:emon/emonpi/XXXX (the input name).

Correct :slight_smile:

Q1: What do I do to set up a Node RED input for a feed, or a virtual feed (NOT AN INPUT)?

Sorry, I don’t quite understand. Do you want to send data from NodeRED to Emoncms? This can be done using MQTT or nodeRED Emocnms node. This has been covered in this thread:

I want to use the serial output node.

Q2: What do I do to select a Raspberry Pi serial output (presumably a pin pair, but anything available will do as long as I can get a serial output)?

The RaspberryPi only has a single hardware UART which is used to communicate with the emonPi. To have a second serial output you will need to either use software serial which I don’t recommend or add another hardware serial port. This can be done by adding a USB to UART adapter then using nodeRED serial out to output serial data to /dev/ttyUSB1 or whatever the adapter is mounted.

1 Like

Hi, and thank you.
What I tried to convey was that I understand how to input to Node RED an item of data from the emonPi input, but I want to input an item of data from a virtual feed. This is because a virtual feed can be constructed from multiple inputs and feeds within emonPi, and I would like this value as an input to Node RED. I cannot calculate the required value within Node RED as it is an interaction between several inputs/feeds. Can Node RED access a feed value, and if so how?

K

NodeRED Emoncms node can be used to access latest feed value from Emoncms.

You will need to log virtual feed to a feed in Emoncms than node the feed ID number. Emoncms nodeRED node can then be used to read this feed using Emoncms APi. The emoncms node is pre-installed on nodeRED running on emonPi / emonBase:

Hi, why do you want to build the charging algorithms in emoncms?

You need to bring the smartevse to node-red environment and keep it there for making EV-charge algorithms. With a script or by manipulating a serial interface directly it doesn’t matter.

Also you can export any emoncms feed to MQTT and use it on node-red. Depending on the source of your original feeds you can even publish them directly to emoncms AND MQTT.

In my opinion this is much simpler and powerfull approach.

Hi BR and Glyn; Many thanks for your assistance - I guess I have now settled on a solution. Both of you have recommended a hardware solution to obtain the serial input, which I will now attempt. The issue regarding the need to input a feed into Node RED is so I can use the actual amps from the CTs. I did not want to use a constant to convert the kW as the voltage is too variable. Using the input vrms with the appropriate energy feed could not be better. I intend to keep all the charging algorithms as already developed in the Smart EVSE as they are excellent, they work exceptionally well to dynamically maximise the charging rate. I only need a very simple manipulation of the grid connection current prior to passing to the Smart EVSE for dynamic solar only charging. If the connection to the Smart EVSE works it will be a simple 4 or 5 step Node RED program, switchable between max possible charge for a last minute range charge and normal daily solar charging cycling around 50% battery capacity. At least thats what I hope…
Now the work begins.
K

Cool, just two notes:

My name is not BR. I used it at the end of the text as BR = Best Regards. Not anymore! :slight_smile:

Actually you only need Amperes to make this work. Can’t you just avoid Power? Or the smartevse needs to receive power figures in the communication?

Good luck!

Hi. Please forgive my misunderstanding of how forums operate and are signed; I have never used a forum (or any social media) prior to my purchase of emonPi; I asked for help from the emonPi team and they advised I should use these forums. I am out of my depth and extremely uncomfortable; I just wish I could have talked to someone regarding my issues for 10 minutes. I persevere because I want to do this work.
I am intrigued by your reply; it is Amps I am after. The standard (normal?) inputs are power so I need to divide this input by vrms for amps. I tried to create a new “input” which was easily accessible by Node RED, but I could not make both power and arms dynamic to provide the resultant dynamic Amps. I have only been able to do this creating a virtual feed - hence my problem in trying to pick up this virtual feed value in Node RED. I am obviously missing something?
Again, apologies.
K

Hey no worries.

Since the elementary measurements are volts and amperes, the power feeds you see are a result of a calculation that you want to revert back to amperes. Maybe there is a way to use the amperes directly from the original measurements. On the emonpi i don’t know, but on the emontx it is as simple as exposing these variables in the arduino sketch and send them along the other values. And on the emonhub i just report them to emoncms and MQTT simultaneously and i’m done.

I’m sure someone experienced with emonpi will help you use amperes and route them to node-red for processing.

On the smartevse side, how will it work? What will you feed to the EVSE?

The Atmel processor inside the emonPi runs a sketch that does essentially the same as the emonTx (it’s available on GitHub via Resources), but to make the current available, you’d have to modify and reload the sketch, which is a bit cumbersome. The process is documented, again via Resources.

Hi again;
To feed the EVSE for max charge rate I will supply the EVSE input with the actual amps measured on the supply. This is as the EVSE software is designed; it does a really good job of charging at the rate that is the difference between the set Maximum Current possible and the actual use. When Solar Only charging is required I intend to switch this input to a calculated value of Maximum Current + actual excess solar (which is -ve when solar power is available). This will feed the EVSE with a value that will enable the charging algorithms to utilise the excess solar; as the solar varies so will the input and hence so will the charge rate. This is a very simple Node RED proposition; it works easily with Power1 divided by a fixed value for voltage, but I would like to be more accurate if possible as I do get a voltage variation. I also have to get the Node RED output to a serial connection, so following the advice above I have ordered a few different USB to Serial devices to see if any will work. I still spend hours trying to get Node RED to operate on the Power1 and VRMS inputs but I am only be able to do this successfully as a Virtual Feed, and try as I might I cannot get this into Node RED. I have seen in the Forums that this has proven difficult to others in the past. Roberts advice above is probably beyond my current skills, but hey - gotta try!
Thanks for the support, it is appreciated.

How will the smartevse behave when the value you feed him is above the max and the charging amps are set at 6A? The charging stops? What happens next?

I have some flexibility and will need to decide. There is a MaxCurrent setting which is the maximum house supply size; the combined house load and charging load cannot exceed this; SmartEVSE will stop charging if it runs out of available current, with 6A as its minimum. The Tesla does not have any issue with a charge being interrupted; it will resume charging when the pilot is re-instated. I have been running with a simple timer turning the charger on/off during the expected sunshine productive hours without issue; it will restart immediately if I cancel the timer straight after the off. In my case, using a Tesla single phase 63A charger, the Maximum Charging possible is the same as my MaxCurrent (63A). I could set these figures to either turn off the charger when the solar power available is less than 6A; or allow the SmartEVSE to keep charging at a minimum of 6A from the grid when the solar disappears. I will probably do the latter to stop any instability; at my location here in Australia when the sun shines and the solar is producing, it becomes a very stable charging environment which just requires the EVSE adjustment to follow the morning generation rising, and the afternoon fall off in power reduction. The timer will stay in the circuit.

Thanks for the explanation, i agree with you that the car should keep charging at a minimum instead of constantly restarting the charge process.

As a offtopic, do you know what is the efficiency of the tesla charge at 6A? I am trying to build some datapoints from several cars to calculate a rough approximation of “liquid” kWh that enter the battery on my EVSE. I figured the Leaf/Fluence and Zoe, but for the Tesla i only found tests that start at 20A.

I now have received several different USB to Serial devices and I am attempting to output a serial connection from Node RED. When I use the serial output node as advised to /dev/ttyUSB1 I get Error: Cannot open /dev/ttyusb1. How do I open /dev/ttyusb1? And does it matter which of the 4 USB ports I am using (they are not numbered)?

Regarding the charging efficiency of the Tesla I am happy to help - what measurements / increments would you like? I can charge the Tesla selecting 1A increments on the charge screen.

Hi again. I have now received and connected the emonPi USB2UART to one of the USB ports, and still the Node RED serial output node (set to /dev/ttyusb1 as suggested) gives the result in the debug “Error: Serialport /dev/ttyusb1 not open”. Searching the forums does not provide an answer to “how do I open the serial port”, and Raspberry Pi forums do not assume the serial port is taken by connection to the emonPi. I am still searching; does anyone know how this is done?
Also still happy to make measurement around the Tesla charging at lower currents; what is required?