Indeed. I have other issues without out of date software. I am resolving these first.
Thanks
Indeed. I have other issues without out of date software. I am resolving these first.
Thanks
Thank all, Python3 was the issue and I had to reinstall the missing modules, namely:
pip install toml twisted pymodbus
The script now runs but it sits at:
pi@emonpi:~/PowerScraper $ ./power_scraper.py
Setting up EmonCMS
Thanks for any help, Iām a newbie to this.
Iāve just noticed at the top of the file
Iāve created a PR to change the instructions to pip3
!
I presume you have created the config.toml and put in your Emoncms details?
Also I think you need to add in the IP of your inverter(s) to the config.
[edit]
I think it should be
inverters = ['5.8.8.8']
based on the URL that worked for you.
Suddenly noticed, I hope you did (although, TBH, I do not understand the difference between pip & pip3 and the relationship to Python 2 & 3).
pip3 install toml twisted pymodbus
Hi @borpin
inverters = ['5.8.8.8']
based on the URL that worked for you.
Yes, this is the IP I have entered in the config file.
Suddenly noticed, I hope you did (although, TBH, I do not understand the difference between pip & pip3 and the relationship to Python 2 & 3).
pip3 install toml twisted pymodbus
Yes, I did this too. The script didnāt like run until I did this.
I think it is getting past communicating with the inverter and trying to communicate with EmonCMS. I can access EmonCMS without issue and all looks good in there.
Have you used the right API key?
What version of emoncms?
Can you click on the button ācopy as markdownā next to āServer Informationā and paste here (no further formatting required)
Iāve checked the API key is correct.
Model :- Raspberry Pi 2 Model B Rev 1.1 - 1GB (Embest)
Serial num. :- A2FBF6F
Temperature :- 29.86°C - 30.4°C
emonpiRelease :- emonSD-17Oct19
File-system :- read-write
Depends on whether or not oneās system has both Python2 and Python3 installed. Viz:
IF python3 is your only python and python3 and python can both start it, then there is no difference. If python starts legacy python and python3 starts, well, python 3 then pip will install for legacy python and pip3 or your python3 example will install for python 3.
Would anyone be willing to help me get Modbus working with an FTDI adapter?! Iāve tried modifying the Powerscraper script (with my very basic Python skills) to use serial like the SDM630ModbusV2 but I get the following error and for the life of me I cannot work it out:
pi@emonpi:~/PowerScraper_custom $ ./power_scraper.py
Setting up EmonCMS
Traceback (most recent call last):
File "./power_scraper.py", line 106, in <module>
config['Solax-Modbus']['stopbits'], config['Solax-Modbus']['timeout'])
TypeError: __init__() takes 3 positional arguments but 6 were given
This is the section of code I have changed:
if 'Solax-Modbus' in config:
SolaxModbusInverters = []
for inverter in config['Solax-Modbus']['ports']:
modbusInverter = SolaxModbus(inverter, config['Solax-Modbus']['baud'], config['Solax-Modbus']['parity'],
config['Solax-Modbus']['stopbits'], config['Solax-Modbus']['timeout'])
SolaxModbusInverters.append(modbusInverter)
looperSolaxModbus = task.LoopingCall(inputActions, SolaxModbusInverters)
looperSolaxModbus.start(config['Solax-Modbus']['poll_period'])
Any help will be greatly appreciated. Let me know if you need more info.
Thanks
Max
Youāll also need to update Inputs/SolaxModbus.py to do something with the new serial arguments youāre passing
Thatās your main clue.
You supplied six arguments, but the function only wants three.
Ah okay. The error confused me to think the issue was within power_scraper.py but I need to update SolaxModbus.py!
Thanks, Iāll keep playing.
@Wulfee do you have an example code of how you are controlling your battery to prevent it discharging when charging your car.
I am trying to do the same through Home Assistant. I have got it reading all the Solar data, but struggling with writing commands to the inverter.
I just run a script from a cron job at 00:30 (when my cheap rate starts) to disable and then another at 04:30 (when my cheap rate ends) to re-enable. Iāll post the scripts this evening when I get home.
Hi, Iāve been trying to get PowerScraper script to work. Iām having a few issues which I think are to do with trying to use a new version of pymodbus
. However, when downgrading to pymodbus==1.5.1
Iām still having the issue:
pi@emonpi:/opt/PowerScraper $ ./power_scraper.py
Traceback (most recent call last):
File "./power_scraper.py", line 38, in <module>
from Inputs.SolaxModbus import SolaxModbus
File "/opt/PowerScraper/Inputs/SolaxModbus.py", line 1
from pymodbus.client.async import ModbusClientProtocol, ModbusClientFactory
Can anyone confirm what version of pymodbus works with PowerScraper?
Thanks for the response @Wulfee
Are you on the Octopus Go tariff?
Have you had any luck getting grid charging working?
Out of curiosity which version of the Solax Inverter do you have? I have an X1-Hybrid Gen3
Yes, itās the best tariff for EV owners, especially if you have solar too.
I did get it to work but wasnāt exactly sure what I did as it didnāt seem to do what I expected. I stopped fiddling with it for now because I canāt charge from the grid anyway without getting a different generation meter as otherwise the grid charged power will appear as generation when in fact it isnāt.
I have a generation 2 X hybrid.
Iāve placed my scripts in bitbucket here. Your password may be different as you donāt have the same model as me.
Do you have the higher voltage batteries or 48 volt ones?
Thanks.
I was going to use Octopus GO. But I have found I hardly need to charge from home as we have free charging at work. So I am just on the normal Octopus Tariff.
I think the only thing I have been doing wrong is using the installer password and not the user password.
I saw the option to change the user password from the default of 2014 in the webportal on the cloud.
Why I didnāt try 2014 I donāt know?
Will give it another go tonight after work.
I am using a single SolaX Gen2 Triple Power HV 4.5kWh I would like to add a second at a later stage. They are about 100v each.
I have got partial battery control working in Home Assistant now. @Wulfee thanks for pointing the obvious out with the password.
I can prevent the battery from discharging when I charge my car. I can also prevent the battery from charging from Solar.
Still canāt get grid charging to work yet.
If anyone is interested https://github.com/wills106/homeassistant-config/blob/master/packages/solax.yaml
in the SolaxModbus.py change the topline to
from pymodbus.factory import ClientDecoder
from pymodbus.client.asynchronous.twisted import ModbusClientProtocol
from pymodbus.framer.rtu_framer import ModbusRtuFramer
from twisted.internet import defer, reactor, protocol
from twisted.web.client import Agent, readBody