Page 1 of 1

EpEver Solar Controller into Domoticz

Posted: Monday 12 October 2020 18:16
by ILoveIOT
epever.tracert.to.domoticz.sh

Tested on : EpEver Tracer 3210AN 30A MPPT Solar Controller
Date : 12-10-2020
Version : 00,00.00,000.2

Requirements : apt install bc sed

Created by ILoveIOT 2020
Updated by ILoveIOT & Micha123 2022
- Added battery temp
- Added SOC value
- Correcting the actual voltage on the battery side
- Changed some small things in this script
- Added Real Battery Curent (Charging and Discharging) it wile be calculated from PVPOWER - LOADPOWER
- Fixed Batterycharging Power, now its calculating PVARRAYPOWER - LOADPOWER (bevore it shows the same as PVARRAYPOWER)
- Add a check if Values in $OUTPUTFILE are present, if there are no values then ihe script wil stop and dont send ZERO value to domoticz

This script will execute the /root/scripts/epevertracer/epever.tracer.php file put the output to a file,
get the value's from the output file, show them on console if needed, and send them to Domoticz, this is super simple, easy to change.

Many thanks to Toggio https://github.com/toggio/PhpEpsolarTracer

For console use : /root/scripts/epevertracer/epever.tracert.to.domoticz.sh
For crontab use : /root/scripts/epevertracer/epever.tracert.to.domoticz.sh >> /dev/null 2>&1
For all the info : php /root/scripts/epevertracer/example_cli.php

1. Change the serial port /root/scripts/epevertracer/epever.tracer.php line 26 ('/dev/ttyUSB1')
2. Change the Domoticz IP & Port (see below)
3. Add/Change the acording Domoticz IDX's (see below)
4. Optional : Change the working directory, where you wanna place the files
5. Optional : If you need more info from the controller compare epever.tracer.php vs example_cli.php
6. Optional : Maybe make 2 cronjobs, with no sunhours just poll once a hour, with sun every min.

Just make a normal network cable for this controller, I believe blue and green between a ch940 rs485 to usb converter or buy the 10$ org cable, org cable had problems on linux, buy cheap ones, ch940, and maybe with ground, me in testing mode.

epevertracer.v2.zip
(22.22 KiB) Downloaded 167 times
719vmfjZtTL._AC_SX679_.jpg
719vmfjZtTL._AC_SX679_.jpg (26.49 KiB) Viewed 3182 times
Naamloos.png
Naamloos.png (117.58 KiB) Viewed 3185 times

Re: EpEver Solar Controller into Domoticz

Posted: Wednesday 30 December 2020 11:51
by ILoveIOT
Do you have a EpEver Solar Controller ?

Try the the https://www.letscontrolit.com/forum/ forum ?

Re: EpEver Solar Controller into Domoticz

Posted: Wednesday 13 January 2021 9:23
by EDsteve
Hi,

that looks promising. I have an EpEver Solar Controller and i am trying to get data from it. But i am not sure about the connection.
What is ch940? I don't find anything in google.

Should these work?
https://www.aliexpress.com/item/4001293 ... web201603_

https://www.aliexpress.com/item/3297827 ... web201603_

Thanks
ED

Re: EpEver Solar Controller into Domoticz

Posted: Wednesday 13 January 2021 9:46
by ILoveIOT
Hi,

Last one yes, its not a network connection but RS485, this type is included with GND.

https://www.aliexpress.com/item/3305445 ... 4c4d90oYnc

Re: EpEver Solar Controller into Domoticz

Posted: Sunday 20 March 2022 16:56
by Micha123
nice, its working

i have modified the script a little bit.

i have added the Battery SOC (state of charge) and also the battery Temp (i have an external sensor for the battery connected to the epever solar charger

i has also sometimes an problem that the comunication to inverter goes wrong, and the script send then only ZERO values to domoticz (now its fixed)

also add the modified file for every one

- Disabled Year Generated (the same reading as month) it can be enabled by removing the #
- Disabled Year Consumed(the same reading as month) it can be enabled by removing the #
- Added Battery Temp (i have an external BATT sensor connected to the tracer)
- Added battery SOC (State of Charge in %)
- Added Real Battery Curent (Charging and Discharging) it wile be calculated from PVPOWER - LOADPOWER
- Fixed Batterycharging Power, now its calculating PVARRAYPOWER - LOADPOWER (bevore it shows the same as PVARRAYPOWER)
- Add a check if Values in $OUTPUTFILE are present, if there are no values then ihe script wil stop and dont send ZERO value to domoticz



if you wil use my modificated script then you need to install bc, bc is needed for the calculations in the script

sudo apt install bc



HAVE FUN

Re: EpEver Solar Controller into Domoticz

Posted: Monday 21 March 2022 7:34
by ILoveIOT
Hi Micha,

I merged you're script with mine, thank you for the update, I updated the original post

- Disabled Year/Month Generated, yes but it will change after a year/month
- SOC I get it from the BMS, I saw its not the same, (50.5 vs 61%) BMS is more accurate, maybe I can calibrate it, but it would be double
- I got the battery temp as well, but never updated the script on domoticz forum
- Added Real Battery Curent (Charging and Discharging), thank you, always did it with my head, later I had the BMS value's
- Fixed Batterycharging Power, now its calculating PVARRAYPOWER, thank you, I believe with the windows software you get that value
- Add a check if Values in $OUTPUTFILE are present, never had a false reading, but now we are for sure

Thank you, original file was downloaded 86 times. ;-)

Re: EpEver Solar Controller into Domoticz

Posted: Monday 21 March 2022 20:48
by Micha123
Second update


Fix watt reading battery, now it is calculated from baatery Ampere and battery voltage (now it shows same as the windows software


Removed consumed kwh today
Removed generated today

Now all today values (batt charging Watt, PV watt, load watt) are merged to the right watt sensors (not needed "computed" anymore. Be patient the first reading possibly high (it read the total value there ) domoticz wil be zero it at midnight and and then the today readings are correct in the Sensors

Re: EpEver Solar Controller into Domoticz

Posted: Wednesday 24 January 2024 17:37
by tomicco
Hello
I'm trying to test the epever tracer 2210AN MPPT controller on PC Raspberry Pi and Domoticz. I can't get the readings. Could you please ask how and where to paste these scripts. Thank you very much in advance.