Comments (5)
@sfstar: When I read the registers directly from Python the values are correct. The register definition on the part of Victron is valid!
from pymodbus.constants import Defaults
from pymodbus.constants import Endian
from pymodbus.client.tcp import ModbusTcpClient as ModbusClient
from pymodbus.payload import BinaryPayloadDecoder
Defaults.Timeout = 25
Defaults.Retries = 5
client = ModbusClient('192.168.2.56', port='502')
for reg in [817,818,819]:
result = client.read_input_registers(reg,2)
decoder = BinaryPayloadDecoder.fromRegisters(result.registers, byteorder=Endian.Big)
r1=decoder.decode_16bit_uint()
print(f"Register {reg} : {r1}")
Output:
Register 817 : 172
Register 818 : 38
Register 819 : 69
from hass-victron.
Thank you for opening this issue.
Most likely the integration is doing something wrong when decoding the bytebuffer received from the GX device.
After a quick investigation it seems that a similair issue is locally reproducable with my setup.
Although the interesting thing is that for me it seems to assign the grid L1 values to the grid L2 entity
While your script returns the correct values for my setup as well
Register 817 : 22
Register 818 : 0
Register 819 : 0
I need to further investigate before an solution can be introduced.
I think I will have some time this weekend to further troubleshoot
from hass-victron.
So I had a sudden insight in what it could be.
It turned out that the register names were broken for pvonoutput for the system registers.
"system_pvonoutput_L1": RegisterInfo(808, UINT16, UnitOfPower.WATT),
"system_pvonoutput_l1": RegisterInfo(809, UINT16, UnitOfPower.WATT),
"system_pvonoutput_l1": RegisterInfo(810, UINT16, UnitOfPower.WATT),
This caused the offset by one due to the integration using an ordered dict (with unique key requirement) for parsing the data.
So 808 and 810 would be decoded but 809 wouldn't since it wasn't an unique dictionary key (808 had L1 in the name and 809/810 l1 in lower case)
By changing this to
"system_pvonoutput_L1": RegisterInfo(808, UINT16, UnitOfPower.WATT),
"system_pvonoutput_L2": RegisterInfo(809, UINT16, UnitOfPower.WATT),
"system_pvonoutput_L3": RegisterInfo(810, UINT16, UnitOfPower.WATT),
The system registers were reporting the correct values for my local setup.
@dummy74 could you test it with your setup as well?
Fun fact: during the fixing I also discovered that I was decoding INT32 as UINT32. So that was also resolved.
from hass-victron.
Perfect! The values are now displayed correctly.
from hass-victron.
@dummy74 thank you for confirming.
I will close this issue as resolved now.
Please feel free to re-open if there are complications
from hass-victron.
Related Issues (20)
- EV Charger (evcharger_mode and evcharger_position) show incorrect values
- Unit of measurements w, W, W, W, W, W, W of input sensor.victron_solarcharger_yield_power_239, HOT 5
- Falsche kWh-Werte; Incorrect kWh values HOT 1
- include battery data in home-assistant energy-dashboard HOT 5
- Requires reboot of Cerbo GX after Homeassistant restart HOT 5
- Interference of Victron-Integration with Victron EVCS? HOT 6
- ValueError: 245.0 is not a valid solarcharger_state HOT 6
- missing Victron Solarcharger after change Charger hardware HOT 7
- OpenDTU PV Inverter missing HOT 6
- No more than 1 PV-inverter? HOT 13
- Feature request: set charge mode of EVCS HOT 4
- Loss of connection to GX device, entities not updating or status unknown HOT 15
- Vebus decode errors HOT 3
- Detection of MPPT trackers switches between settings and solarcharger upon reboot HOT 43
- Missing Victron Solarsmart MPPT HOT 3
- Entities show tenths of a watt
- Please include addition ModBUS IDs for inverters HOT 3
- Missing devices on a system with 2 Cerbo GXs HOT 1
- Removal of this integration leaves all 200 entities and statistics in place HOT 1
- Multiphase regulation moved and stopped working.
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 hass-victron.