GreenDIGIT CIM Messenger
This document provides information on using the GreenDIGIT CIM messenger to publish energy consumption metrics in cASO.
Overview
The GreenDIGIT CIM messenger sends EnergyRecord objects to the GreenDIGIT
Common Information Model (CIM) Service. The messenger supports authentication
via bearer token and allows publishing energy consumption data from cASO extractors
to SZTAKI CIM endpoints.
Additionally, the messenger verifies SSL certificates and endpoint availability before publishing to ensure reliability in production environments.
Configuration
To use the GreenDIGIT CIM messenger, add the following configuration to your
caso.conf file:
[DEFAULT]
# Add the messenger to your list of messengers
messengers = greendigit_cim
[greendigit_cim]
# Base URL of SZTAKI GreenDIGIT CIM Service.
# Specific endpoints for authentication (/gd-cim-api/v1/token) and publishing (/gd-cim-api/v1/submit)
# will be constructed internally by the messenger.
base_url = https://greendigit-cim.sztaki.hu
# Credentials used to obtain the bearer token
email = user@example.org
password = secret-password
# SSL verification (recommended for production)
verify_ssl = true
[messenger_greendigit_cim]
# Only energy records will be published to this messenger
record_types = energy
How it Works
The GreenDIGIT CIM messenger performs the following steps:
Verify Endpoints: Checks that the authentication and publishing endpoints are reachable and that SSL certificates are valid.
Authenticate: Uses the configured base URL and the credentials provided in
caso.confto obtain a bearer token from/gd-cim-api/v1/token.Serialize Records: Converts
EnergyRecordobjects to JSON using field mappings consistent with cASO standards.Publish Records: Sends the JSON payload to
/gd-cim-api/v1/submitvia HTTP POST with the bearer token in theAuthorizationheader.Logging: Records the number of published records and HTTP response status.
Testing
To test the messenger:
Verify that the SZTAKI CIM endpoints are reachable from the host running cASO.
Ensure the credentials are correctly set in
caso.conf.Run cASO in
--dry-runmode to previewEnergyRecordobjects without publishing.Check logs for successful publication messages or errors.
Troubleshooting
Authentication errors:
Ensure credentials are correct.
Verify network connectivity to
base_url.Ensure the authentication endpoint is reachable.
Publishing errors:
Check that the publish endpoint is reachable.
Validate that JSON serialization of
EnergyRecordis correct.Review HTTP status codes in logs for hints.
No records published:
Ensure extractors have generated
EnergyRecordobjects.Confirm that the messenger is listed in
messengersin the[DEFAULT]section.
Technical Details
Uses bearer token authentication.
Records are serialized using
model_dump_jsonwith aliases and excludingNonevalues.HTTP POST to
/gd-cim-api/v1/submitincludes a JSON array ofEnergyRecordobjects.Verifies SSL and endpoint availability before publishing.
Logs the number of records sent and HTTP response status.