Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running solismod script #1

Closed
usbrit opened this issue Sep 21, 2022 · 23 comments
Closed

Error when running solismod script #1

usbrit opened this issue Sep 21, 2022 · 23 comments

Comments

@usbrit
Copy link

usbrit commented Sep 21, 2022

Hi,
I have solismod installed on a Rpi zero w.

Python 3.8
solarmanv5 installed

Running the script give the following error:

pizero@pizero:~/solismod $ python main.py
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    import config.config as config
ModuleNotFoundError: No module named 'config.config'; 'config' is not a package

Can anyone point me at a solution?.
Thanks

@usbrit
Copy link
Author

usbrit commented Sep 22, 2022

I have solved this, now struggling to get Solismod to work with Pysolarmanv5

@NosIreland
Copy link
Owner

I have solved this, now struggling to get Solismod to work with Pysolarmanv5

Are you getting any errors?

@usbrit
Copy link
Author

usbrit commented Sep 22, 2022

No, but nothing is changing on the inverter.

Not sure what I should see to confirm Solismod and pysolarmanV5 are communicating?

@usbrit
Copy link
Author

usbrit commented Sep 23, 2022

It looks like solismod is running OK, but don't know how to confirm:
image

  1. it's find pysolarmanv5
  2. it's communicating with the inverter wifi stick

I can send mqtt message from HA (on another RPi) successfully

Any help appreciated.
Thanks

@usbrit
Copy link
Author

usbrit commented Sep 23, 2022

A NodeRed Inject to mqtt gives me this:
image
But the Discharge start time doesn't change on the inverter.

How can I check the message has been received?

@NosIreland
Copy link
Owner

NosIreland commented Sep 23, 2022 via email

@usbrit
Copy link
Author

usbrit commented Sep 23, 2022

Thanks!!
I got this to work!
Just need to get the correct registers identified now! Any idea where I can get a list?
Thank you

@usbrit
Copy link
Author

usbrit commented Sep 26, 2022

I have tried to see what I can get back using a test script (based on the following from main.py):
"nodered/solis/start_discharge_hour": [43147], "nodered/solis/start_discharge_minute": [43148],
"nodered/solis/stop_discharge_hour": [43149], "nodered/solis/stop_discharge_minute": [43150]

`from pysolarmanv5.pysolarmanv5 import PySolarmanV5

def main():
"""Create test file to pull data from Inverter
"""
modbus = PySolarmanV5(
"192.168.X.XXX", 4XXXXXXXX2 , port=8899, mb_slave_id=1, verbose=1
)
print(modbus.read_holding_registers(register_addr=43147, quantity=1))
print(modbus.read_holding_registers(register_addr=43148, quantity=1))
print(modbus.read_holding_registers(register_addr=43149, quantity=1))
print(modbus.read_holding_registers(register_addr=43150, quantity=1))

if name == "main":
main()`

image

This doesn't seem to tally with what my settings currently are:
image

Can anyone help with register numbers for the Solis RHI-5K-48ES?
Thanks

@usbrit
Copy link
Author

usbrit commented Sep 27, 2022

Just for interest, I check the following:

print(modbus.read_holding_registers(register_addr=43003, quantity=1))
print(modbus.read_holding_registers(register_addr=43004, quantity=1))
print(modbus.read_holding_registers(register_addr=43114, quantity=1))
print(modbus.read_holding_registers(register_addr=43141, quantity=1))
print(modbus.read_holding_registers(register_addr=43142, quantity=1))

and all these registers return the correct values

@NosIreland
Copy link
Owner

What firmware is your inverter running?

@usbrit
Copy link
Author

usbrit commented Sep 27, 2022

image

Is this how to identify? Can't seem to find anything on Solis Cloud

@NosIreland
Copy link
Owner

The version is dated but it shoud still work. Your HMI is v28 and DSP ir v16. If you have 5G inverter you can ask Silis support to do OTA upgrade to later version.
You got the script reading values ok so try to modify them:

from pysolarmanv5.pysolarmanv5 import PySolarmanV5

def main():
"""Create test file to pull data from Inverter
"""
modbus = PySolarmanV5("192.168.X.XXX", 4XXXXXXXX2 , port=8899, mb_slave_id=1, verbose=1)

modbus.write_holding_register(register_addr=43141, value=0)
modbus.write_holding_register(register_addr=43142, value=0)

print(modbus.read_holding_registers(register_addr=43141, quantity=2))

if name == "main":
main()

this shoudl change the charge and discharge amps to 0. and then read the values back.

@usbrit
Copy link
Author

usbrit commented Sep 27, 2022

Ran a modified version of that code:
`"""Create test file to pull data from Inverter"""
from pysolarmanv5.pysolarmanv5 import PySolarmanV5

def main():

modbus = PySolarmanV5("192.168.X.XXX", 4XXXXXXXX2 , port=8899, mb_slave_id=1, verbose=1)

modbus.write_holding_register(register_addr=43141, value=0)
modbus.write_holding_register(register_addr=43142, value=0)

print(modbus.read_holding_registers(register_addr=43141, quantity=2))

if name == "main":
main()`

and checked afterwards:
image

43141 and 43142 have been set to 0, but...viewing the settings screen on the inverter, they don't appear to have changed. Am I looking in the right place?
image

@NosIreland
Copy link
Owner

You are in the right place. Can you reboot the inverter and try again? This could be a firmware thing but lets try reboot firsts.

@usbrit
Copy link
Author

usbrit commented Sep 27, 2022

I restarted the HMI and no change. Was this what you meant?

In the past I had tried a change of time and that worked immediately and I watch it change on the inverter #1 (comment)

@NosIreland
Copy link
Owner

HMI restart should be enough but there is no harm doing full restart. Shutdown the battery and then power off inverter.
The code is working since you can change the time. Also looking at the outputs provided the registers also seem to be the correct ones. There is something with the inverter as noted before you can ask Solis support to do firmware update as it is old.

@usbrit
Copy link
Author

usbrit commented Oct 3, 2022

I have successfully changed settings on the inverter now after investigating Register values.

For me register 43110 is the "Charge status" but the payload is different from others (3= time charging/run and 1= time charging/stop)
I am able to change this using a python script on the pi running Solismod and PysolarmanV5 and am now working on getting HA to interface with this via MQTT.

Thanks for your help and patience, also have a ticket with Solis to get the OTA update

@NosIreland
Copy link
Owner

Nice.
Glad to hear you got it sorted. Just a note the registers may change after the upgrade.

@mkpurcell
Copy link

@usbrit It looks like I have the same problem you had i.e. registers for charge/discharge time always return 0. Did you find the correct registers for this? I also have Solis RHI-5K-48ES, with software ver: 230013

@alienatedsec
Copy link

alienatedsec commented Oct 11, 2022

I have solved this, now struggling to get Solismod to work with Pysolarmanv5

@usbrit
How did you solve this config error?

@alienatedsec
Copy link

@NosIreland worth enabling issues section in your other repos

@NosIreland
Copy link
Owner

@NosIreland worth enabling issues section in your other repos

I assume you refering to solismon3. I have enabled it.

@NosIreland
Copy link
Owner

Closing this as OP got it running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants