Closed reklame33 closed 1 year ago
Does your Inverter Serial Number start SP1?
If you have working coms, but a different Serial Number you should at least get the following error in your log.
"unrecognized {hub.name} inverter type - serial number : {seriesnumber}" seriesnumber = your serial number.
Yes, serial SP1ES120Nxxxxx
Tried to delete integration and added back in. Using TCP, restarted HA, no errors in log.
What version of the Integration are you trying to use?
Downloaded on HACS today, cannot find where to check for actual version?
Found version 0.7.0.4 in manifest file. EDIT: updated from 2c884d4 to 3678104 from HACS now.
Here is a debug logging when HA restarts, serial masked with xxxx by me:
So reading the serial correct I assume the communication is ok, but integration will not pull any more data.
2022-11-14 21:27:21.167 DEBUG (MainThread) [custom_components.solax_modbus] using pymodbus library 2.x
2022-11-14 21:27:21.173 INFO (MainThread) [homeassistant.setup] Setting up solax_modbus
2022-11-14 21:27:21.195 INFO (MainThread) [homeassistant.setup] Setup of domain solax_modbus took 0.0 seconds
2022-11-14 21:27:21.198 INFO (MainThread) [homeassistant.setup] Setup of domain hardware took 0.2 seconds
2022-11-14 21:27:21.202 INFO (MainThread) [custom_components.hacs]
Changed plugin_sofar.py today. from: if seriesnumber.startswith('SP1ES120N6'): invertertype = HYBRID | X3 # New Hybrid 20kW to: if seriesnumber.startswith('SP1ES120N'): invertertype = HYBRID | X3 # New Hybrid 20kW
Now integration created 127 entities. Data on the entities is not consistent. Some times some data is presented, but not correct compared to what I read from ModScan32 in same register.
Attached is log from HA. Maybe someone can notice any hint how to fix. I do experience with ModScan32 that I cannot read large blocks at one time. If I try to read 52 registers from 0x418 ModScan32 does not get any reply from inverter. If I lower to 40 registers, then ModScan32 get reply.
In the first block of data in the log it tries to read 52 registers. 2022-11-15 21:30:04.446 INFO (MainThread) [custom_components.solax_modbus.sensor] sofarHYD returning holding block: 0x418 0x44c [1048, 1049, 1050, 1051, 1056, 1057, 1093]
Maybe need to adjust number of blocks at one time read?
This Inverter doesn't like you reading large blocks of data. There seems to be black holes in the register maps. That's why I have 'newblock = true' every so often.
Are you using a Waveshare? If so did you see the comment in the Installation section of the Wiki? "Modbus Gateway Type might need setting to "Auto query storage type" "
Not using Waveshare. I have testet different generic RS485-to-USB and RS485-to-ethernet adapters. They all are able to read inverter serial number, but only intermittent random blocks of data from inverter to HA.
Maybe I can I add this newblock = true more places in the code to see if this helps. Maybe my inverters firmware are different from the N6 serial inverters regarding available registers and black holes.
When that user had "Simple Modbus to TCP/IP mode" set on the Waveshare they we having issues like you are having, but when they changed to "Auto query storage type" the issues went away. So there might be a similar setting on your adaptor?
I would have assumed they will behave similar regardless of the firmware versions. The Inverter doesn't like you reading over the "reserved" registers.
Try adding newblock between 251 and 252.
@reklame33 Did that newblock make any difference?
Yes, it's better, thanks for the tip. I get more data now, but uses a few minutes after restart of HA before they populate. Not sure I get them all as many of them show 0. Have not tried to write back to inverter yet. Will update when done.
I do miss a entity for real time production power, same that show on inverter lcd.
Do you know if this is available in modbus register? And maybe poll this i.e every 10 second?
EDIT: I found maybe the correct entity, but the unit is possibly wrong here. See image
I have done some extensive editing on the plugin_sofar.py to make units to be correct (as I understand the value). Also changed some typing errors.
Attached is the sofar and const file if it is any interesting for you. Not finished editing yet, but maybe you want to implement the new SensorDeviceClass enum on your future releases. plugin_sofar_new.zip
Thanks, I am just going through the changes now.
Where did you find out that device_class is changing? Also noticed state_class is changing as well. But that's only because I looked at senssor.py on the main Home Assistant GitHub
Hello
found the info in home Assistant const file. https://github.com/home-assistant/core/blob/dev/homeassistant/const.py
Ok thanks, I thought there might have been a proper communication that I had missed. Home Assistant really are poor at communicating / documenting changes.
@reklame33 I have just released 0.7.0b66 could you see if I matched all your Suggested changes? I have also corrected a few typos I have made. I didn't add in any of the extra newblock = True,
as I am not sure if there were needed or not.
@reklame33 Have you had time to check if the newer Beta's match up with your suggested corrections?
Hello. Just upgraded now. So far it seems to work and units seems to be correct. It still throws some errors in log, last 10 minutes: This error originated from a custom integration.
Logger: custom_components.solax_modbus Source: /config/custom_components/solax_modbus/init.py:365 Integration: SolaX Inverter Modbus (documentation, issues) First occurred: 16:47:34 (4 occurrences) Last logged: 16:55:18
sofar error reading holding registers at device 1 position 0x1104 sofar error reading holding registers at device 1 position 0x58f sofar error reading holding registers at device 1 position 0x484 NoneType: None
The reason for all the newblock was to avoid the register holes and be sure that there is no timeout.
I am still unable to get it poll all settings every 15 seconds, did not work in my version either.
Overall I am quite happy with this pluging to get data in real time, Solarman does not give me this option.
I'm not sure how to get around the random not reading of registers. The problem with adding additional '''newblock = True,''' is that you are breaking the reading down into smaller and smaller blocks. So you are increasing the time it takes to read everything.
As the Sofar Inverter's are only running at 9600. Maybe they are not designed to respond so quickly?
If you have tried the really new release 0.7.0b71 do the selects provide the details of them instead of being blank?
They should no longer look like https://github.com/wills106/homeassistant-solax-modbus/issues/228#issue-1474870013
Also "Charger Use Mode" should actually work if you try and change the mode (Other selects / numbers won't be fully working yet.
Oh sorry, I tried the released version om hacs. installed b71 now. Seem to be more responsive and updating entities now is approx 30 second.
Will try to change mode later.
Any entity that will show which mode it is currently in?
~0.7.0b72~ 0.7.0b73 should have them all working now and charge / discharge times?
I am going to close this Issue down now as the basics are working. I'll leave #228 open as that centres around the fact the selects and numbers aren't fully functional.
Feel free to join into that conversation and then the topic is more focused to the one Issue.
Hello. Just installed and powered up my brand new Sofar HYD 20KTL and connected wires to pin 1 and 4 on the com port on the inverter. Installed the Solax Inverter Modbus plugin in Home Assistant through HACS.
Tried to connect both with USB to RS485 and ethernet to RS485 modules, using sofar.py protocol, but does not get any data into home assistant. No errors in log.
Tried to change to sofar_old.py protocol. Then it created a device in home assistant and 2 entities; run mode and serial. No data on either of them, and error in log also.
Now I have tried from a PC using ModScan32, it can connect and get data on input register 1-64 on both USB-to-RS485 and ethernet-to-RS485. The data does not seem to change though, but at least it has successful reading.
What might cause that the integration does not seem to be able to communicate with the inverter on any RS485 device?