CarloGavazzi_EM580

Carlo Gavazzi EM580 powermeter

Handwritten Documentation

Module implementing the Carlo Gavazzi EM580 power meter driver adapter via Modbus RTU (through SerialCommHub).

Description

The module consists of a single main implementation that serves the powermeter interface. Modbus access is done via the required serial_communication_hub interface.

Features

  • Live meter reads and powermeter publishing (interval configurable)

  • OCMF/Eichrecht transaction start/stop logic

  • Public key reading and publishing (hex)

  • Resilient Modbus transport with retries and protocol-compliant write chunking

Module Configuration

The module configuration parameters are defined in manifest.yaml. A complete example configuration can be found at config/bringup/config-bringup-CGEM580.yaml.

Transaction flow (OCMF)

Start transaction

At transaction start the module:

  1. Ensures OCMF state is NOT_READY

  2. Writes OCMF identification data, EVSE ID and tariff text (TT) (0-terminated, used bytes only)

  3. Writes session modality

  4. Sends the start command ('B')

Stop transaction

At transaction stop the module:

  1. Sends the end command ('E') for the tracked transaction

  2. Waits for OCMF state READY

  3. Reads the OCMF file (size + content)

  4. Confirms the file read by setting state back to NOT_READY

Notes / Limitations

  • Modbus Write Multiple Registers requests are chunked to max 123 registers per request.

  • TT is a CHAR[252] field (126 words); overlong strings are warned and truncated.

Auto-Generated Reference

Provides

Implementation of the driver functionality
config:
powermeter_device_id: integer <optional>
default: 1
The powermeter’s address on the serial bus
communication_retry_count: integer <optional>
default: 3
Number of retries for communication operations before giving up.
communication_retry_delay_ms: integer <optional>
default: 500
Delay in milliseconds between retry attempts.
communication_error_pause_delay_s: integer <optional>
default: 10
Delay in seconds before retrying communication in the live measurement thread after a failure. Default 10 seconds. Applies to initial communication too.
initial_connection_retry_count: integer <optional>
default: 10
Number of retries for initial connection/signature config read during module initialization. 0 means infinite retries.
initial_connection_retry_delay_ms: integer <optional>
default: 2000
Delay in milliseconds between retry attempts during initialization.
timezone_offset_minutes: integer <optional>
default: 0
Timezone offset from UTC in minutes (e.g., 60 for UTC+1, -300 for UTC-5). Range -1440 to +1440 minutes. Default is 0 (UTC).
live_measurement_interval_ms: integer <optional>
default: 1000
Interval in milliseconds between live powermeter reads and publishes. Default 1000 ms (once per second). Allowed range 500-60000 ms (twice per second to once per minute).
device_state_read_interval_ms: integer <optional>
default: 10000
Interval in milliseconds between reading the device state bitfield (used for VendorError reporting). Default 10000 ms (once per 10 seconds). Allowed range 500-60000 ms.

Requirements

Metadata

Authors

License