Comments (5)
Hey Addie, I can't reproduce with the latest version on a SE3500K.
There are two registers that indicate the presence of batteries. If these are not "255" (the unset value) then the entire battery block is read. So, in your case these registers are something other than "255". Could you add print(batteries)
to line 525 of __init__.py
and run example.py
again?
from solaredge_modbus.
Line 525 is in the middle of the definition of the meters. I assume you mean line 492.
This is what I did:
And this is the outcome:
[15, 14]
(0, 15)
(1, 14)
{
"c_id": "SunS",
"c_did": 1,
"c_length": 65,
"c_manufacturer": "SolarEdge",
"c_model": "SE7K",
"c_version": "0003.2251",
"c_serialnumber": "removed",
"c_deviceaddress": 1,
"c_sunspec_did": 103,
"c_sunspec_length": 50,
"current": 189,
"l1_current": 49,
"l2_current": 69,
"l3_current": 71,
"current_scale": -2,
"l1_voltage": 3980,
"l2_voltage": 3985,
"l3_voltage": 3997,
"l1n_voltage": 2304,
"l2n_voltage": 2291,
"l3n_voltage": 2294,
"voltage_scale": -1,
"power_ac": 4400,
"power_ac_scale": -2,
"frequency": 4998,
"frequency_scale": -2,
"power_apparent": 4312,
"power_apparent_scale": -1,
"power_reactive": -4290,
"power_reactive_scale": -1,
"power_factor": -9356,
"power_factor_scale": -3,
"energy_total": 21870964,
"energy_total_scale": 0,
"current_dc": 5967,
"current_dc_scale": -5,
"voltage_dc": 7485,
"voltage_dc_scale": -1,
"power_dc": 4467,
"power_dc_scale": -2,
"temperature": 3449,
"temperature_scale": -2,
"status": 4,
"vendor_status": 0,
"rrcr_state": 0,
"active_power_limit": 100,
"cosphi": 0,
"meters": {},
"batteries": {
"Battery1": {
"c_manufacturer": "\u0002",
"c_model": "False",
"c_version": "False",
"c_serialnumber": "False",
"c_deviceaddress": 15,
"c_sunspec_did": 0,
"rated_energy": -3.4028234663852886e+38,
"maximum_charge_continuous_power": -3.4028234663852886e+38,
"maximum_discharge_continuous_power": -3.4028234663852886e+38,
"maximum_charge_peak_power": -3.4028234663852886e+38,
"maximum_discharge_peak_power": -3.4028234663852886e+38,
"average_temperature": -3.4028234663852886e+38,
"maximum_temperature": 0.0,
"instantaneous_voltage": -3.4028234663852886e+38,
"instantaneous_current": -3.4028234663852886e+38,
"instantaneous_power": 0.0,
"lifetime_export_energy_counter": 0,
"lifetime_import_energy_counter": 0,
"maximum_energy": -3.4028234663852886e+38,
"available_energy": -3.4028234663852886e+38,
"soh": -3.4028234663852886e+38,
"soe": -3.4028234663852886e+38,
"status": 7,
"status_internal": 0,
"event_log": 0,
"event_log_internal": 0
},
"Battery2": {
"c_manufacturer": "\u0002",
"c_model": "False",
"c_version": "False",
"c_serialnumber": "False",
"c_deviceaddress": 14,
"c_sunspec_did": 0,
"rated_energy": -3.4028234663852886e+38,
"maximum_charge_continuous_power": -3.4028234663852886e+38,
"maximum_discharge_continuous_power": -3.4028234663852886e+38,
"maximum_charge_peak_power": -3.4028234663852886e+38,
"maximum_discharge_peak_power": -3.4028234663852886e+38,
"average_temperature": -3.4028234663852886e+38,
"maximum_temperature": 0.0,
"instantaneous_voltage": -3.4028234663852886e+38,
"instantaneous_current": -3.4028234663852886e+38,
"instantaneous_power": 0.0,
"lifetime_export_energy_counter": 0,
"lifetime_import_energy_counter": 0,
"maximum_energy": -3.4028234663852886e+38,
"available_energy": -3.4028234663852886e+38,
"soh": -3.4028234663852886e+38,
"soe": -3.4028234663852886e+38,
"status": 7,
"status_internal": 0,
"event_log": 0,
"event_log_internal": 0
}
}
}
from solaredge_modbus.
Ok, so not wholly unexpected. I'd be curious to know what is around those registers. I use the following script to dump large ranges of registers, you could try that and see if there's anything interesting there.
#!/usr/bin/env python3
import argparse
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder
from pymodbus.client import ModbusTcpClient
from pymodbus.register_read_message import ReadHoldingRegistersResponse
if __name__ == "__main__":
argparser = argparse.ArgumentParser()
argparser.add_argument("host", type=str, help="Modbus TCP address")
argparser.add_argument("port", type=int, help="Modbus TCP port")
argparser.add_argument("--timeout", type=int, default=1, help="Connection timeout")
argparser.add_argument("--unit", type=int, default=1, help="Modbus device address")
args = argparser.parse_args()
client = ModbusTcpClient(
host=args.host,
port=args.port,
timeout=args.timeout,
)
maps = [
(40000, 40070, "base"),
(57600, 57665, "battery1"),
(57865, 57930, "battery2")
]
for start, stop, name in maps:
print(f"\n{name} block ({start}-{stop})\n")
for i in range(start, stop):
result = client.read_holding_registers(i, 1, slave=args.unit)
if not isinstance(result, ReadHoldingRegistersResponse):
continue
if len(result.registers) != 1:
continue
value = BinaryPayloadDecoder.fromRegisters(result.registers, byteorder=Endian.Big, wordorder=Endian.Big)
decoded = value.decode_16bit_uint()
print(i, decoded)
The output I get is:
battery1 block (57600-57665)
57600 0
57616 0
57632 0
57648 0
57664 255
battery2 block (57865-57930)
57872 0
57888 0
57904 0
57920 255
57921 0
The following is a list of blocks as documented by SolarEdge:
# 40000-40069 base
# 40069-40071 inverter1
# 40120-40190 meter1
# 40295-40364 meter2
# 40469-40539 meter3
# 40171-40241 meter1-synergy2
# 40345-40415 meter2-synergy2
# 40519-40589 meter3-synergy2
# 40191-40261 meter1-synergy3
# 40365-40435 meter2-synergy3
# 40539-40609 meter3-synergy3
# 57600-57665 battery1
# 57865-57921 battery2
from solaredge_modbus.
Here's the output of that script: dump.txt
from solaredge_modbus.
Hey @nmakel, just a friendly nudge from my side. How to progress with this?
from solaredge_modbus.
Related Issues (20)
- Crash when initiating for 2 inverters simultaneous
- 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
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.