Тёмный

Pylontech US2000B battery monitoring via Wifi 

Irek
Подписаться 162
Просмотров 53 тыс.
50% 1

Опубликовано:

 

29 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 116   
@jochenpuchalla
@jochenpuchalla 3 года назад
This is the first project that ran at first attempt after following the instructions. THANK YOU! Now my smart home control knows the SOC, wonderful!
@ZielinskiIrek
@ZielinskiIrek 3 года назад
glad it works for you Jochen!
@leakim971
@leakim971 2 года назад
you really did an amazing job and provide lot of very useful information in one project, thank you very much
@DaveWinwood
@DaveWinwood 4 года назад
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.
@ZielinskiIrek
@ZielinskiIrek 4 года назад
pleasure and good luck :-)
@Thebustermann
@Thebustermann 4 года назад
Dave, did you ever manage to do this using your RPi? I dont have access to arduino, so wondering how it went.
@joeybloos9387
@joeybloos9387 4 года назад
How did you get it working with the transistors?
@gerritmueller1977
@gerritmueller1977 2 года назад
Hi Irek, good job, it's working pefectly in my home, well done!
@clikcspeed
@clikcspeed 4 года назад
Thank you so much. Used this with ESP8266 - works like a charm! Much appreciated.
@eddiegough8895
@eddiegough8895 4 года назад
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
@eddiegough8895
@eddiegough8895 4 года назад
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
@matematto2.0
@matematto2.0 3 года назад
a huge, huge, HUGE thank you !
@matematto2.0
@matematto2.0 3 года назад
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
@einfachdermartin
@einfachdermartin 2 года назад
Exellent job!
@tamashorvath5035
@tamashorvath5035 4 года назад
Thanks Irek, just made it and works fine :)
@ZielinskiIrek
@ZielinskiIrek 4 года назад
Great to hear this. Added mqtt support yesterday. Get the latest version if you need it.
@tamashorvath5035
@tamashorvath5035 4 года назад
@@ZielinskiIrek Oh wow, awesome news! That's exactly what I was gonna have a look at later today. I do need it, I'll check it out. Thanks again!
@tamashorvath5035
@tamashorvath5035 4 года назад
For some reason I'm not getting anything through MQTT.... Log says "Connected to MQTT server: " but nothing comes when I subscribe to it
@ZielinskiIrek
@ZielinskiIrek 4 года назад
​@@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.
@tamashorvath5035
@tamashorvath5035 4 года назад
@@ZielinskiIrek I'm trying in node-red, mqtt node reporting "connected" but still nothing.... probably missing something simple and obvious LOL
@anthosta3452
@anthosta3452 5 лет назад
Good job. thank you
@alexs.4970
@alexs.4970 Год назад
Hi I have 6 pylontech 3000 and all green lights flushing on and off at same time what does that mean ?
@andreasschmidbauer4481
@andreasschmidbauer4481 2 года назад
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
@georgelza
@georgelza Год назад
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.
@aleesi2
@aleesi2 Год назад
great job! do you happen to have a port for the ESP32-wroom ? Thanks
@mviertel
@mviertel 9 месяцев назад
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?
@ZielinskiIrek
@ZielinskiIrek 9 месяцев назад
I would start with breadboard and when all works use perfboard and solder everything
@mihaigsm2003
@mihaigsm2003 3 года назад
Sir, pls help, i want to send to grafana via MQTT voltage from all cells. can add on your software pls. Thanks!
@MrSavage77
@MrSavage77 4 года назад
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
@ZielinskiIrek
@ZielinskiIrek 4 года назад
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).
@MrSavage77
@MrSavage77 4 года назад
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.
@mihaigsm2003
@mihaigsm2003 4 года назад
can u do same for read data from PIP inverter (MPP Solar or same)?
@mihaigsm2003
@mihaigsm2003 4 года назад
HI, i try compile sketch to my arduino but received some error with " 'class SimpleTimer' has no member named 'setTimeout' " Any help?
@ZielinskiIrek
@ZielinskiIrek 4 года назад
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?
@mihaigsm2003
@mihaigsm2003 4 года назад
@@ZielinskiIrek Solved, i find multiple location of libraries on my pc, delete all then reinstall arduino , now done, thanks
@silverscooby09
@silverscooby09 5 лет назад
Thanks for sharing this, what voltage capacitors did you use as seeing a range from 16v to 160v
@ZielinskiIrek
@ZielinskiIrek 5 лет назад
Working voltage is only 3.3v so anything above that is ok. 16v would be OK.
@Reudiga
@Reudiga Год назад
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
@eddiegough8895
@eddiegough8895 4 года назад
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
@ZielinskiIrek
@ZielinskiIrek 4 года назад
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.
@kollesandreas9898
@kollesandreas9898 2 года назад
I built the part, great. I miss the "number of cycles" display. Can you change that. Thank You
@ZielinskiIrek
@ZielinskiIrek 2 года назад
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.
@tamashorvath5035
@tamashorvath5035 4 года назад
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?
@ZielinskiIrek
@ZielinskiIrek 4 года назад
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.
@GreenEverAfter
@GreenEverAfter Год назад
@@ZielinskiIrek is that command that you brake up the battery at 1200 and then switch to 11520 still applicable to the new C batteries (us2000c etc)?
@kevgermany
@kevgermany 11 месяцев назад
I'll be trying this with US5000s next year. Has anyone got experience to share?
@mathschut505
@mathschut505 4 года назад
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?
@ZielinskiIrek
@ZielinskiIrek 4 года назад
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,
@mathschut505
@mathschut505 4 года назад
@@ZielinskiIrek Hello, I got it working now. But I only get values ​​if the Wemos is a slave and not a master, is that correct?
@ZielinskiIrek
@ZielinskiIrek 4 года назад
@@mathschut505 what do you mean by master/slave?
@juliankelsalljoel6742
@juliankelsalljoel6742 4 года назад
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
@ZielinskiIrek 4 года назад
if you don't know how to modify C code - maybe use "/req?code=pwr" instead of "/jsonOut" in your application? would that work for you?
@cedrics5370
@cedrics5370 3 года назад
This is great. Looks exactly like what I need. Does this also work with US200, non B/Plus batteries? @Irek : can this manage 8 batteries?
@ZielinskiIrek
@ZielinskiIrek 3 года назад
not sure about "non plus" - give it a try, it might. 8 batteries are supported.
@cedrics5370
@cedrics5370 3 года назад
@@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
@Mobi2001 3 года назад
Thanks for sharing this, what do i have to do connect the us2000C ??
@ZielinskiIrek
@ZielinskiIrek 3 года назад
I belive this is exactly the same connection, protocol, etc
@Mobi2001
@Mobi2001 3 года назад
@@ZielinskiIrek the connection is different, us2000 have an RJ10 connector and us2000C RJ45
@ZielinskiIrek
@ZielinskiIrek 3 года назад
@@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.
@Mobi2001
@Mobi2001 3 года назад
@@ZielinskiIrek it doesn't work, I'm doing something wrong
@ZielinskiIrek
@ZielinskiIrek 3 года назад
@@Mobi2001 Did you send the wakeup signal on pin4 for more than 0.5s and then cleared it?
@ladydbandorchestra
@ladydbandorchestra 5 лет назад
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
@ZielinskiIrek
@ZielinskiIrek 5 лет назад
hi - can you copy and paste what do you get? what about other commands like "help"?
@ladydbandorchestra
@ladydbandorchestra 5 лет назад
@@ZielinskiIrek I tried but I can't put here the photo or file
@ZielinskiIrek
@ZielinskiIrek 5 лет назад
@@ladydbandorchestra send it at irekz@yahoo.com
@ladydbandorchestra
@ladydbandorchestra 5 лет назад
@@ZielinskiIrek now it is working very well thank you very much
@ZielinskiIrek
@ZielinskiIrek 5 лет назад
Dario Enzo Awesome!
@kchiem
@kchiem 4 года назад
Are those US2000+ units sitting on shelves or rails, or are they mounted from the front only?
@ZielinskiIrek
@ZielinskiIrek 4 года назад
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.
@ManuPithiviers
@ManuPithiviers 10 месяцев назад
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. 😊
@ziobit5177
@ziobit5177 3 года назад
Hi, congratulations for the video, I ask you if it also works with esp-01 module, thanks
@ZielinskiIrek
@ZielinskiIrek 3 года назад
should work on any esp8266 board
@ziobit5177
@ziobit5177 3 года назад
@@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
@ZielinskiIrek
@ZielinskiIrek 3 года назад
@@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).
@ziobit5177
@ziobit5177 3 года назад
@@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
@ZielinskiIrek
@ZielinskiIrek 3 года назад
@@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?
@tomhein1497
@tomhein1497 5 лет назад
I did all the same with the same parts in the description. But all response I get back is "????" Can anyone help?
@ZielinskiIrek
@ZielinskiIrek 5 лет назад
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).
@tomhein1497
@tomhein1497 5 лет назад
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
@ZielinskiIrek
@ZielinskiIrek 5 лет назад
@@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.
@tomhein1497
@tomhein1497 5 лет назад
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?
@ZielinskiIrek
@ZielinskiIrek 5 лет назад
@@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
@TheRealAnthony_real
@TheRealAnthony_real 2 года назад
Nice stuff .. anything that can integrate with Home Assistant ?
@ZielinskiIrek
@ZielinskiIrek 2 года назад
Yes - this project will push data to MQTT server, and then in HA you can add MQTT sensors. This is how I do it.
@TheRealAnthony_real
@TheRealAnthony_real 2 года назад
@@ZielinskiIrek great ! So you can automate .notify to let you know in an event of drastic changes and more ;)
@ZielinskiIrek
@ZielinskiIrek 2 года назад
@@TheRealAnthony_real yes absolutely
@operadebarie
@operadebarie 4 года назад
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)
@ZielinskiIrek
@ZielinskiIrek 4 года назад
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
@operadebarie 4 года назад
My log : 09 - 09:02 | Boot event 09 - 09:03 | New baud: 115200 09 - 09:03 | New baud: 1200 09 - 09:03 | New baud: 115200
@ZielinskiIrek
@ZielinskiIrek 4 года назад
@@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!
@operadebarie
@operadebarie 4 года назад
@@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?
@operadebarie
@operadebarie 4 года назад
@@ZielinskiIrek It is ok now ! Thank you
@UsmanHameed
@UsmanHameed 3 года назад
Can you please make 1 for me , i am happy to pay fair price
@ZielinskiIrek
@ZielinskiIrek 3 года назад
Sorry Usman, can't help myself due to lack of time. Maybe someone reading this forum can. Cheers.
@johangroify
@johangroify 3 года назад
Go check out the icc pi at centurionsolar.co.za, that's what I got
@ssuslik4091
@ssuslik4091 Год назад
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
@ZielinskiIrek Год назад
where is the error, those looks like compiler warning to me?
@ssuslik4091
@ssuslik4091 Год назад
@@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
Далее
Smart Meter Disaster!!
16:33
Просмотров 566 тыс.
The Petabyte Pi Project
22:27
Просмотров 2,2 млн
SpaceX finally gives out HUGE Starship Flight 5 news!
23:40
Your USB-C Cable probably SUCKS! Sooo is that Bad?
10:54