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

MeterValuesSampledDataMaxLength is not respected for ocppv1.6 #1487

Open
altserg opened this issue Jan 14, 2025 · 0 comments
Open

MeterValuesSampledDataMaxLength is not respected for ocppv1.6 #1487

altserg opened this issue Jan 14, 2025 · 0 comments

Comments

@altserg
Copy link

altserg commented Jan 14, 2025

Describe the bug
Measurands autodetection in ocppv16.py assumes that there are no limitations set by charger MeterValuesSampledDataMaxLength key. However, Growatt Thor does have the limit of 5. When the measurands are configured in MeterValuesSampledData command, the OCPP integration sends too many of them. I would expect that the charger declines this request, but it does not, probably causing corruption of charger's internal data structures. After that results of some calls like NumberOfConnectors are returning random values causing further failures (see issue #1452 for example). Also, not all requested measurands are reported back to the server

To Reproduce
Use the integration with Growatt Thor charger
Model: Growatt Thor 11 A/S
FW version: THOR_11AS-V5.2.4-20230307-NOVO
Charger feedback when manually getting/setting the keys:

  • MeterValuesSampledDataMaxLength = 5
  • MeterValuesSampledData setting to the following seem to work, despite maximum is 5
    Current.Import,Energy.Active.Import.Interval,Energy.Active.Import.Register,Power.Active.Import,SoC,Voltage,Temperature
  • MeterValuesSampledData setting to OCPP component default leads to partially indeterministic charger behavior
    Current.Export,Current.Import,Current.Offered,Energy.Active.Export.Interval,Energy.Active.Export.Register,Energy.Active.Import.Interval,Energy.Active.Import.Register,Energy.Reactive.Export.Interval,Energy.Reactive.Export.Register,Energy.Reactive.Import.Interval,Energy.Reactive.Import.Register,Frequency,Power.Active.Export,Power.Active.Import,Power.Factor,Power.Offered,Power.Reactive.Export,Power.Reactive.Import,RPM,SoC,Temperature,Voltage

Expected behavior
User is warned in the log if MeterValuesSampledDataMaxLength limit is not respected, in case it exists (the key is optional in OCPP v1.6 protocol)

Additional context
Proposal to fix:

  • check if corresponding sensor is enabled in HASS before trying to autodetect the measurand. This will give the user control to discover which configuration is usable
  • I can fix the issue but I need:
    1. Agreement that proposed way is ok
    2. Guidance how to check if a HASS sensors is disabled or not
    3. Guidance how to enable the OCPP test system locally. At this moment I receive exception when I try to run pytest (venv cofigured, hass installed)
      `
      python -m pytest ./tests/
      Traceback (most recent call last):
      File "/home/pi/sw/ocpp/lib/python3.13/site-packages/_pytest/config/init.py", line 858, in import_plugin
      import(importspec)

ModuleNotFoundError: No module named 'pytest_homeassistant_custom_component'
`

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

1 participant