A great starting point for my home automation and it works really well. I didn't have a MAX232 so just used s couple of NPN transistors to invert and level shift the TX and RX lines. The batteries are happy to have a 5V signal on their RX line as I don't see any communication issues. Now the fun starts as I try and link this to my RPi 4 which will be the main controller. Have lots to learn yet. Thank you Irek for sharing your project.
Hi Irek, Sorry for the late reply, as I was not expecting to get an answer and did not check the blog earlier. Many thanks for the answer and I will follow up what you say with my installer, as I am not competent to do it myself. Eddie Gough
Good News! Installer came today and I pointed out the problem with the charging rate and your comments and they corrected the issue and all is working now. Thanks again for your imput. Eddie Gough
Hi @Irek. Thanks to your great work I can now see the 6 "topic" you entered in the code: but are they referred to an average value compared to the "battery_count"? How can I read the values of each single battery? thanks again
@@tamashorvath5035 all topics have "home/grid_battery/" prefix. Try suscribing to for example: home/grid_battery/soc if you still get nothing - add some more logging with Log() command, or see with some MQTT explorer application if really enything is pushed to MQTT or not.
Can i use your Monitoring for the H48050 two?@Irek There ist no Console-Port, but an RS232 Port. Can i use this ? Thx for answers and help. Thx Andreas
hmm, this til -> rs232, this be the same we'd use to flash a sonoff. sounds/looks like it. I'm primarily trying to put a cable together to use a RJ11 and/or RJ45 to USB (my laptop does not have Serial). but now seeing this... thinking this would a nice side project also, after I've FW upgraded batteries.
Bloody beginner question: for the (safe) assembly of the ESP and MAX323 boards (plus capacitors) you used what? Is that just a breadboard there or what would be recommended?
Short question: is there any voltage on the battery connectors when you turn off from the main battery on/off switch? I need to understand if I still need a manual disconnect switch for maintenance purposes. Trying to avoid sparks whenever connecting and disconnecting the battery bank from the inverter/charger. Thanks
MrSavage77 Not sure. I have not seen any sparks when connecting batteries so off switch likely switches voltage off - but not 100% sure. Manual recommends a DC switch between batteries and inverter (I dont have one in my setup).
Irek yeap, I saw that note. On the other side, on page 5, where the button functions are described, it is mentioned that only after pressing the START button, power will be present at output. I’ll wait to get mine batteries, and I’ll measure the output when turned off.
have you copied the libraries folder to your arduino libraries? if yes - then maybe you have a different version of SimpleTimer clas that clashes with one I use?
Great Work...! What means basestate Dischg? And what is currentDC? Is it watt? Voltage? Same estpowerac, what does that mean? Same PowerDC... Thank you for the awesome work
Hi there, enjoyed your video. You seem to know what you are doing, so I thought I would ash a question on the subject: I have 4 Pylontech batteries like yours. I also have solar panels. I notice when the PV system is working and producing electricity it only allows the batteries to intake up to about 450w (at any one time) and the rest either goes into the house use/or goes back to the grid. This means that it would take a long time to fully charge my batteries, and here in Dublin with our weather patterns this can be a problem. Is it possible to increase the intake of the batteries during charging above the 450w limit? Thanks. Eddie Gough
Eddie Gough Charge rate is controlled by your inverter/charger. Check settings there. One battery can be charged at around 1.2kw. So for 4 batteries you can go as high as 4.8kw (if your charger can supply as much). Other thing to check is if your CT clamps are installed correctly.
I think you can get this information using "stat" command, For example: /req?code=stat It does not appear to work for each individual battery - but only for master one (not 100% sure). See "CYCLE Times" value. I might add this to JSON output as some point.
Another question - if I see this in the event log: 15 - 10:29 | Connected to MQTT server: 192.168.1.16 15 - 10:29 | New baud: 1200 15 - 10:29 | New baud: 115200 Is it because there are different baud rates set up on the 2 batteries? Should I change one of them somehow?
this is normal. initialy we use 1200 to enable UART, and then switch to 115200 to communicate with a device. if you see this ocasionaly in the log - then ignore, only if you have a flood of those messages, that would suggest a comms problem.
Hi, I can't get the Wemos to work. Does the whole thing only work with a certain Wemos D1 Mini or why can I not access the web server after uploading. The Wemos also does not get an IP over DHCP. Does anyone have any idea what I might be doing wrong?
it should work with any wemos board really. Try flashing first some example scripts like "blink" to see if LED blinks, and I think there is a webserver example as well. This will be a good way to verify your board works correctly before you go ahead and connect it to the battery,
Hi Irek, thanks you have done a great job! I have two batteries and would like to see the soc for both of them in the jsonOut. What would I need to put in the code? Thanks again
@@ZielinskiIrek cheers for chiming in. Just read that the latest US2000 were renamed with no B or Plus. They have the same specs but allow for mismatched batteries in different parallel stacks (with hub). Will try hopefully this week with a non Sparkfun Max3232...
@@Mobi2001 You are right. There is a difference. See "Console" section in this manual: www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwil3O67lZXyAhU0hv0HHXk9AaUQFjAAegQIBxAD&url=https%3A%2F%2Fatersa.shop%2Fapp%2Fuploads%2F2021%2F03%2FUS2000C-Product-Manual-V1.0-20CPSV0901-.pdf&usg=AOvVaw2dwsy9hqasMFg5pZk3JQLy Looks like you need to wake the port by applying voltage to wake pin as well.
Thanks, it is working very well , but when I use a "pwr" there is a different image than your video, the data are only a 1 vertical line , is it normal? Thank you very much
When you attach a battery from the front only it will stay in place without any flexing/sag. Some people do it this way. I have 2 shelves myself, and added a small pieces of wood beween batteries (at the back) to support battery on the top. Just to be on the safe side.
Thank you very much for sharing with everyone. I am trying to simplify to see the data in serial monitor by removing wifi web server and all that. If anyone can help me I would appreciate it. 😊
@@ZielinskiIrek Sorry for the trouble, I can't understand why it gives me a blank page with "????" i am using max232 with suitable capacitor, where can i take a look? thank you
@@ziobit5177 check all electrical connections fitst, maybe you swapped tx with tx? if nothing works - connect PC to the console and see if you can establish a communication (you need to send "magic" string first, and change the baud rate as the C++ code does).
@@ZielinskiIrek Thanks for the advice, but unfortunately it does not work, I have tried to reverse tx / rx and I have shortened the cable, but I cannot wake up the battery, I have tried with Arduino one sending the data as you described, 1) active serial to 1200 , 2) I transmit the awakening code, 3) I reactivate serial to 115200, 4) I transmit pwr \ n, 5) I listen to the serial ... I am tired of the attempts I have made, I do not know what to do ... do you have any other advice to give me? thank you
@@ziobit5177 If you have more than one battery - are you connecting to a MASTER one? If you do - maybe try to separate one battery - and connect only to this one?
where do you see those question marks - in the runlog? check if tx is not swapped with rx, also make sure ground wires between battery and esp are connected together (had comms issues before when grounds were not propery connected).
Everything is connected like the drawing on github. should I also connect ground of the Battery to the ground of the Console Port of the Battery and the esp??? In the Event-log only ???? in the runtime log: 16 - 06:00 | New baud: 1200 16 - 06:00 | New baud: 115200
@@tomhein1497 no need to connect ground of the battery. Only ground on the RJ connector to ground of ESP (as per drawing on github). "????" means that ESP is reading some garbage. Are you sure RJ connection is correct? Diagram on github shows RJ connector from the front, double check this is how you wired it. If it still does not work - open a issue on github and post some photos of your setup.
Do I have to activate the console port first? Do I have to make settings on the dip-switches? I have two batteries(4 weeks old). Tested on both(single and together). Always the same. Wiring is like diagramm. Any help?
@@tomhein1497 Console port should be always active as far I know. Dip switches should have no effect on it (those control baud rate of rs485 only). To debug your console port you could get usb-to-rs232 adapter connect it to the PC and issue commands manually (a bit fiddly but I did that first before developing esp project to see if console works at all). More details here: www.photovoltaikforum.com/thread/118958-pylontech-us2000b-daten-%C3%BCber-konsole-rs232-auslesen/?pageNo=2 (used google translate as my German is non existing): translate.google.com/translate?hl=en&sl=auto&tl=en&u=https%3A%2F%2Fwww.photovoltaikforum.com%2Fthread%2F118958-pylontech-us2000b-daten-%25C3%25BCber-konsole-rs232-auslesen%2F%3FpageNo%3D2
hello, i sent you an email with your code changed to implement softwareserial, can you watch. I have the beginning of response from my pylontech battery, but the output stops. The advantage of the software serial port is that it allows debugging from the computer via Rx et Tx code : #include //Ports de réception de la liaison série avec SeriePylontech SoftwareSerial SeriePylontech(D1, D2); //RX t TX ..... const int readNow = SeriePylontech.readBytesUntil('>', szResponse, sizeof(szResponse)-1); //all commands terminate with "$$ pylon>" (no new line at the end) ...... can you help me because the answer is incomplete and I did not manage to make your initial program work (many connected objects and network address difficult to recover knowing that we are blind when rx and tx are already used)
check content of your_ip/log if there is any unrecognised or unexpected response from the battery it will be logged there - see if there is anything interesting if this does not help - try connecting your PC via USB to RS232 connector and see if you get correct response from it using terminal app
@@operadebarie Looks like there is no response at all from the battery. Few options: - Check all electrical connections. - Make sure you are connecting RS232 cable to the master battery (if you have more than one). - Connect PC to the battery if you can and experiment to see if you get any response. Ps. you can use "Log()" function to log any string to /log - this might be helpful with debugging. Good luck!
@@ZielinskiIrek interface me repond when : 192.168.0.122/req?code=bat bat @ Battery Volt Curr Tempr Base State Volt. 192.168.0.122/req?code=pwr pwr @ Power Volt Curr TemprFa捷 Thigh Vlow Vhigh Bas Isn't the battery responding?
Great work! Its works for me without mqtt. But when commenting out line 17 to enable mqtt i get a compiler error... do you have any idea? c:\PylontechMonitoring\libraries\ESP8266_Microgear\MicroGear.cpp: In function 'void msgCallback(char*, uint8_t*, unsigned int)': c:\PylontechMonitoring\libraries\ESP8266_Microgear\MicroGear.cpp:19:28: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 19 | cb_present("present",payload,length); | ^~~~~~~~~ c:\PylontechMonitoring\libraries\ESP8266_Microgear\MicroGear.cpp:24:27: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 24 | cb_absent("absent",payload,length); Thanks
@@ZielinskiIrek yes when sketch will be compiled this comes up. Only when activating mqqt. But no big problem, i am using your jsonOut output getting the data read by node red. Thanks