EV car charge with PV

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
Post Reply
mgerhard74
Posts: 11
Joined: Friday 28 July 2017 18:28
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: Austria, Upperaustria
Contact:

EV car charge with PV

Post by mgerhard74 » Sunday 20 May 2018 8:37

I use Domoticz to improve my PV ownconsumtion and charge our new EV car (Nissan Leaf ZE1) with photovoltaic power.
A raspberry pi3, a Razberry board, some z-wave plugs and a TCP/IP controllable EV wallbox (with a Phoenix Contact EM-CP-PP-ETH charge control) is my hardware setup. I read data from the Fronius inverter with http requests (LUA Script) and control the EV wallbox also with a short LUA script to send TCP modbus commands. Charging power can be set from 6A (1,4kW) to 20A (4,6kW) in 2A steps. Since march we charged 270kWh green energy into the Leaf.
AllPics.jpg
AllPics.jpg (382.28 KiB) Viewed 678 times
2018-05-19.JPG
2018-05-19.JPG (69.98 KiB) Viewed 678 times
Domoticz improves my photovoltaik ownconsumption (Rpi3, Razberry2, z-wave plugs) - PV 5,4kWp (Fronius Symo inverter, Fronius Smart Meter 63A) - Nissan Leaf2 (40kWh)

jake
Posts: 466
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: EV car charge with PV

Post by jake » Sunday 20 May 2018 16:34

Interesting. Can you see how effectively you harvest your pv energy in your car? Can you keep the energy pull from the grid close to zero during charging?

mgerhard74
Posts: 11
Joined: Friday 28 July 2017 18:28
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: Austria, Upperaustria
Contact:

Re: EV car charge with PV

Post by mgerhard74 » Sunday 20 May 2018 17:21

Hello Jake, difficult to answer, because some other devices are taking enery of PV: fridge, pool pump, washing machine, wifi routers, cooking,....
In fact, the LUA script can react on taking enery from the grid. In my case, i decrease charging current on power consumption is greater than 200 watt. Easy to change this value to 0. So no grid power will charge the car.
Our PV ownconsumtion rate decrease from about 33% to 42% in april and 55% in may. Every kilometer of our Nissan Leaf is free. (and of course free of fuel and co2)

Gerhard

Code: Select all

-- ---------------------------------------------------------------------
-- Control of EV Wallbox with Phoenix Contact EM-CP-PP-ETH
-- How to install mbtget: https://github.com/sourceperl/mbtget
-- IP-address of Phoenix Contact EM-CP-PP-ETH: 10.0.0.150
-- Turn charge on or off; change current from 6 to 20 ampere
-- (c) 2018, Ing. Gerhard Mitterbaur
-- ---------------------------------------------------------------------

local nSmartmeter = 0
Debug = "YES"                        -- turn debugging on "YES" or off "NO"

commandArray = {}

nSmartmeter= tonumber(otherdevices_svalues['Smartmeter'])

if (otherdevices['7 Wallbox'] == 'On') then
    if Debug=="YES" then
        print ("Smartmeter: " ..tostring(nSmartmeter))
    end

    -- Very high photovoltaic power
    if (nSmartmeter < -1300) then
        if (uservariables["WallboxOn"] == 0) then
            -- Start charge EV
            os.execute("mbtget -a 400 -u 180 -w5 1 10.0.0.150")
            -- Current 6A (1400 Watt)
            os.execute("mbtget -a 300 -u 180 -w6 6 10.0.0.150")
            commandArray['Variable:WallboxOn'] = "1"
            commandArray['Variable:WallboxAmpere'] = "6"
            commandArray['Variable:WallboxOffCount'] = "0"
        end
    end
    
    -- high photovoltaic power, Wallbox is still "on", increase charge
    if (nSmartmeter < -400) then
        if (uservariables["WallboxOn"] == 1) then
            -- Start charge EV
            os.execute("mbtget -a 400 -u 180 -w5 1 10.0.0.150")
            commandArray['Variable:WallboxOffCount'] = "0"
            if (uservariables["WallboxAmpere"] == 6) then
                -- Current 8A
                os.execute("mbtget -a 300 -u 180 -w6 8 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "8"
            elseif (uservariables["WallboxAmpere"] == 8) then
                -- Current 10A
                os.execute("mbtget -a 300 -u 180 -w6 10 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "10"
            elseif (uservariables["WallboxAmpere"] == 10) then
                -- Current 12A
                os.execute("mbtget -a 300 -u 180 -w6 12 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "12"
            elseif (uservariables["WallboxAmpere"] == 12) then
                -- Current 14A
                os.execute("mbtget -a 300 -u 180 -w6 14 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "14"
            elseif (uservariables["WallboxAmpere"] == 14) then
                -- Current 16A
                os.execute("mbtget -a 300 -u 180 -w6 16 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "16"
            elseif (uservariables["WallboxAmpere"] == 16) then
                -- Current 18A
                os.execute("mbtget -a 300 -u 180 -w6 18 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "18"
            end
            elseif (uservariables["WallboxAmpere"] == 18) then
                -- Current 20A
                os.execute("mbtget -a 300 -u 180 -w6 20 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "20"
            end
        end
    end

    -- low photovoltaic power, decrease charge
    if (nSmartmeter > 200) then
        if (uservariables["WallboxOn"] == 1) then
            if (uservariables["WallboxAmpere"] == 20) then
                -- Current 18A
                os.execute("mbtget -a 300 -u 180 -w6 18 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "18"
            elseif (uservariables["WallboxAmpere"] == 18) then
                -- Current 16A
                os.execute("mbtget -a 300 -u 180 -w6 16 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "16"
            elseif (uservariables["WallboxAmpere"] == 16) then
                -- Current 14A
                os.execute("mbtget -a 300 -u 180 -w6 14 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "14"
            elseif (uservariables["WallboxAmpere"] == 14) then
                -- Current 12A
                os.execute("mbtget -a 300 -u 180 -w6 12 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "12"
            elseif (uservariables["WallboxAmpere"] == 12) then
                -- Current 10A
                os.execute("mbtget -a 300 -u 180 -w6 10 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "10"
            elseif (uservariables["WallboxAmpere"] == 10) then
                -- Current 8A
                os.execute("mbtget -a 300 -u 180 -w6 8 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "8"
            elseif (uservariables["WallboxAmpere"] == 8) then
                -- Current 6A
                os.execute("mbtget -a 300 -u 180 -w6 6 10.0.0.150")
                commandArray['Variable:WallboxAmpere'] = "6"
            end
        end
    end

    -- very low photovoltaic power, stop charge
    if (nSmartmeter > 500) then
        if (uservariables["WallboxOn"] == 1) then
            if (uservariables["WallboxAmpere"] == 6) then
                -- Count to 5 before turn off charging
                if (uservariables["WallboxOffCount"] == 0) then
                    commandArray['Variable:WallboxOffCount'] = "1"
                elseif (uservariables["WallboxOffCount"] == 1) then
                    commandArray['Variable:WallboxOffCount'] = "2"
                elseif (uservariables["WallboxOffCount"] == 2) then
                    commandArray['Variable:WallboxOffCount'] = "3"
                elseif (uservariables["WallboxOffCount"] == 3) then
                    commandArray['Variable:WallboxOffCount'] = "4"
                elseif (uservariables["WallboxOffCount"] == 4) then
                    commandArray['Variable:WallboxOffCount'] = "5"
                elseif (uservariables["WallboxOffCount"] == 5) then                    
                    -- Stop charge EV
                    os.execute("mbtget -a 400 -u 180 -w5 0 10.0.0.150")
                    commandArray['Variable:WallboxAmpere'] = "0"
                    commandArray['Variable:WallboxOn'] = "0"
                    commandArray['Variable:WallboxOffCount'] = "0"
                end
            end
        end
    end

else
    -- Current 16A
    os.execute("mbtget -a 300 -u 180 -w6 16 10.0.0.150")
    -- Switch Wallbox to OFF: stop charge 
    os.execute("mbtget -a 400 -u 180 -w5 0 10.0.0.150")
    commandArray['Variable:WallboxAmpere'] = "0"
    commandArray['Variable:WallboxOn'] = "0"
    commandArray['Variable:WallboxOffCount'] = "0"
end

if Debug=="YES" then
        print ("Wallbox on/off " .. uservariables["WallboxOn"])
        print ("Wallbox Ampere " .. uservariables["WallboxAmpere"])
        print ("Wallbox Off Count " .. uservariables["WallboxOffCount"])
    end

return commandArray
And a picture of our Nissan Leaf:
Bild 3 Von vorne.JPG
Bild 3 Von vorne.JPG (263.41 KiB) Viewed 653 times
Domoticz improves my photovoltaik ownconsumption (Rpi3, Razberry2, z-wave plugs) - PV 5,4kWp (Fronius Symo inverter, Fronius Smart Meter 63A) - Nissan Leaf2 (40kWh)

lost
Posts: 196
Joined: Thursday 10 November 2016 10:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: EV car charge with PV

Post by lost » Monday 21 May 2018 8:00

Hello,
mgerhard74 wrote:
Sunday 20 May 2018 17:21
Our PV ownconsumtion rate decrease from about 33% to 42% in april and 55% in may. Every kilometer of our Nissan Leaf is free. (and of course free of fuel and co2)
Well, as usual, free until you consider all the energy that was used for battery manufacturing and needed ore extraction... Same for PV panels: several 10's of sq-meters resulting from another heavy energy eater, silicon foundry. Lets' not speak about recycling side.

A few years ago, PV was indeed considered such a waste that it was only considered to electrify areas that could not be wired easily to the public electric network! Now governments give money for equipments that will struggle for decades to just give back the energy that was needed to manufacture them, provided you don't have an heavy wind or hail period that'll break everything. As well as for electric cars that overweight their fuel counterparts by 30% in average.

This is just crazy.

If you consider a french Renault Zoe (maybe the most successful electric car in Fra,ce: A city car weighting 1450kg!) compared to a suzuki swift (another city car, with current generation at 900kg in average after loosing 150kg since last generation), that can be up to 60% overweight for the electric version that will only allow you to drive 200/300km!

=> With current PV and battery tech, it's everything but CO2 free.

The only interest is money: Buying your next 2 decades electricity once now (if you're lucky), at current energy cost that drive PV panels/battery manufacturing costs. As energy will cost more and more, you main save money.

But in the end, if everyone does the same, this will just accelerate our current problems.

An effort on current average car weight and aerodynamics (forget SUV's and such small dick compensators, as marketing guys qualify them in the automotive industry!) with current engine technology could do the job of an electric counterpart for half the weight at 3 to 5l/100km fuel consumption.

The miracle electric battery tech, we still wait for it since the very first electric car, named "Jamais Contente" (="Never Happy"!):
https://fr.wikipedia.org/wiki/La_Jamais_contente

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest