Comments (8)
Looks like this should work. Have you grabbed the latest version from github? A commit from 10 days ago, which isn't in the pypi release yet, should have fixed this.
Edit: this is the commit in question.
from solaredge_modbus.
You were correct, It did fix the issue. However the meter is now empty. While it worked perfectly before. It detects "Meter1" but return an empty dict. Any chance you would know why ?
from solaredge_modbus.
Would you mind trying it explicitly, through the intepreter for example, to rule out any funny business with your looping and dict assignments?
- Create the first inverter object
- Read meters from first and print their values
- Create second inverter object with first as parent
- Read meters from second and print their values
- Read meters from the first inverter again
from solaredge_modbus.
Yes sorry, it was not clear. But I am always testing with the example given on the git.
When calling unit 2, I can see the meter is "Meter1" but meter_values is an empty dict {} (cf below)
Also I reverted back to the pipy version and the meter is working fine again.
It seems that there is bug introduced in between the pipy version and the latest github
for meter, params in meters.items():
meter_values = params.read_all()
values["meters"][meter] = meter_values
print(meter_values)
from solaredge_modbus.
I understand. But what I'm asking you is to run through all of the steps one by one. This way we can see where and when things go wrong. Perhaps somewhere a unit
is not being passed correctly, but by only looking at the code I'm not seeing it. Debug output, printing results from every function, printing every object (inverter, meter), would be useful.
from solaredge_modbus.
I can confirm after several tests that this is only due do adding these lines:
if unit:
self.unit = unit
else:
self.unit = parent.unit
Problem: Meter is not read correctly. and return empty dict. Thus by looking in places where unit is used for meter, we should find out the problem.
Note : In my case the Meter is on unit=2
Regarding the previous steps:
- Create the first inverter object
- Read meters from first and print their values
==> Reading the meter, return Meter1 but its content is an empty dict
from solaredge_modbus.
I am having a similar issue. the problem is that in the above lines:
if unit:
self.unit = unit
else:
self.unit = parent.unit
If unit is anything other than 1 then it is false. Here is the output form the python console:
>>> import solaredge_modbus
>>> inv1 = solaredge_modbus.Inverter(host = "192.168.1.51", port=1502, unit =1, timeout=3)
>>> print(inv1)
Inverter(192.168.1.51:1502, connectionType.TCP: timeout=3, retries=3, unit=0x1)
>>> inv2 = solaredge_modbus.Inverter(parent=inv1, unit = 2)
>>> print(inv2)
Inverter(192.168.1.51:1502, connectionType.TCP: timeout=3, retries=3, unit=0x1)
>>> inv2.unit == True
True
>>> 2 == True
False
>>> 1 == True
True
This makes the 2nd inverter inaccessible if trying to access two inverters (via a parent) in the same program. It works with example.py if you pass a unit of 2 as there is no parent in that case.
from solaredge_modbus.
If you change the lines:
if unit:
self.unit = unit
else:
self.unit = parent.unit
to
if unit != parent.unit:
self.unit = unit
else:
self.unit = parent.unit
it corrects the problem.
from solaredge_modbus.
Related Issues (20)
- Support for Backup Interface HOT 3
- Isolation Resistance reporting? HOT 1
- Enums in __init__.py
- How to interpret the data returned by example.py HOT 10
- [Solved] - Error "ModuleNotFoundError: No module named 'pymodbus.client.sync'" HOT 1
- Data returned by example.py HOT 4
- Support for 3 x SolarEdge Home Battery HOT 1
- I dont know how to setup
- Which Parameter is which HOT 9
- BIG and LITTLE Endian vs Big and Little Endian HOT 3
- Incorrect address in __init__.py HOT 1
- How is the SolarEdge Wallbox integrated? HOT 3
- Module based information for SolarEdge Home Battery 48V HOT 1
- New storage control mode
- Grid Status, off/on grid - Found
- Third Battery is now available in modbus registers (+0x0200) - Please add support HOT 1
- Beginner question: where can I find a detailed description of modbus fields (e.g. different power values)? HOT 2
- KeyError "Status" HOT 1
- Batteries connected to Followers
- Solar Edge Modbus Meter, Importing or Exporting?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solaredge_modbus.