Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Describes the actions as defined in SmartMeteringConfiguration.wsdl
GetGetFirmwareVersionResponse returns the device firmware versions requested with the GetFirmwareVersion method. The response contains the DeviceIdentification and CorrelationUid which is received from the GetFirmwareVersion request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
GetAdministrativeStatus is a request to retrieve the current AdministrativeStatus setting from a device. The request needs the DeviceIdentification.
All requests have similar response behaviour which is described in ResponseMessages.
GetGetAdministrativeStatusResponse returns if the setting GetAdministrativeStatus is enabled. The response contains the DeviceIdentification and CorrelationUid which is received from the GetAdministrativeStatus request.
XSD: sm-configuration.xsd
Grid eXchange Fabric was formerly known as the Open Smart Grid Platform (OSGP). GXF is an open, generic, scalable and independent 'Internet of Things' platform, which enables various connected smart objects in the public space to be easily controlled and monitored. Our platform allows the use of any (web)application and with any IP communication infrastructure.
Our goal is to stimulate the development of smart and sustainable solutions. Smart devices and smart apps play a central role in the development of smart grids and smart societies. The open smart grid platform software enables you to connect to thousands of devices, control them, and monitor their performance. This is done in an open and secure way, so you can use it for your own applications and devices, thereby reducing the time to market and decreasing development costs.
The names Open Smart Grid Platform and Grid eXchange Fabric will both be found in this document and in the code. In the future we will replace all references to the Open Smart Grid Platform and OSGP by Grid eXchange Fabric and GXF. During this transition period please read Grid eXchange Fabric if you see Open Smart Grid Platform.
Using the platform
The Grid eXchange Fabric is used in the following way:
A user or operator uses one or more (web) applications to monitor and/or control devices
The applications connect to the open smart grid platform via several web services which are divided into functional domains, i.e. Public Lighting, Smart Metering, Power Quality, etc. Third party developers can use the web services for the development or integration of new applications
The platform handles all these application requests in a secure way and uses various functions and services to do so (e.g. authorization, authentication, device management, logging)
For the 'translation' and communication of user/operator commands to the various smart devices, the platform uses multiple (open) protocols
The platform supports various IP based data telecommunication technologies and protocols to communicate with the devices
Use cases of Grid eXchange Fabric are only limited by your imagination. Here are some examples:
Ad-hoc and scheduled Switching of Public Lighting
Electrical Transportation
Smart Metering
Traffic Control (LED/matrix signs, traffic lights)
Flexible load management ( solar energy and wind energy)
Power Quality monitoring
More technical and user information about Grid eXchange Fabric can be found in this document. More generic/product information about Grid eXchange Fabric can be found on the .
GetFirmwareVersion is a request to retrieve the firmware version(s) of a device. The request needs the DeviceIdentification.
All requests have similar response behaviour which is described in ResponseMessages.
GetGetFirmwareVersionResponse returns the version(s). The response contains the DeviceIdentification and CorrelationUid which is received from the GetFirmwareVersion request.
XSD: sm-configuration.xsd
GetGetAdministrativeStatusResponse returns if the setting GetAdministrativeStatus is enabled. The response contains the DeviceIdentification and CorrelationUid which is received from the GetAdministrativeStatus request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
ReplaceKeys is a request to change the keys on an E-meter. The request needs the DeviceIdentification, an AuthenticationKey and an EncryptionKey.
All requests have similar response behaviour which is described in ResponseMessages.
GetReplaceKeysResponse returns if the result is successful from the ReplaceKeys request. The response contains the DeviceIdentification and CorrelationUid which is received from the ReplaceKeys request.
XSD: sm-configuration.xsd
UpdateFirmware is a request to install another firmware version(s) on a device. The request needs the DeviceIdentification and the firmware versions, that together with the device model (as stored with the identified device) uniquely determine the firmware file to be used.
All requests have similar response behaviour which is described in ResponseMessages.
GetUpdateFirmwareResponse returns the version(s). The response contains the DeviceIdentification and CorrelationUid which is received from the UpdateFirmware request.
XSD: sm-configuration.xsd
GetUpdateFirmwareResponse returns the device firmware versions that are on the device after calling the UpdateFirmware method. The response contains the DeviceIdentification and CorrelationUid which is received from the UpdateFirmware request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
SetActivityCalendar is a request to set tariffs on an E-meter according a SeasonProfile and WeekProfile. In a WeekProfile, seven dayprofiles can be filled in with a start time and dayId which contains the tariff.
The request needs the DeviceIdentification, CalendarName, ActivatePassiveCalendarTime, SeasonProfileName, SeasonStart, WeekProfileName, DayId and StartTime.
All requests have similar response behaviour which is described in .
returns the result from setting a SetActivityCalendar. The response contains the DeviceIdentification and CorrelationUid which is received from the SetActivityCalendar request.
XSD:
WSDL:
SetAdministrativeStatusis a request to set the AdministrativeStatus on a device. The request needs the DeviceIdentification and Enabled parameter.
All requests have similar response behaviour which is described in .
returns if the setting SetAdministrativeStatus is enabled. The response contains the DeviceIdentification and CorrelationUid which is received from the SetAdministrativeStatus request.
XSD:
WSDL:
SetAlarmNotifications is a request to set the types of alarm notifications that must be notified from the device when they occur. The following notifications can be enabled or disabled:
CLOCK_INVALID, REPLACE_BATTERY, POWER_UP, PROGRAM_MEMORY_ERROR, RAM_ERROR, NV_MEMORY_ERROR, MEASUREMENT_SYSTEM_ERROR, WATCHDOG_ERROR, FRAUD_ATTEMPT, COMMUNICATION_ERROR_M_BUS_CHANNEL_1, COMMUNICATION_ERROR_M_BUS_CHANNEL_2, COMMUNICATION_ERROR_M_BUS_CHANNEL_3, COMMUNICATION_ERROR_M_BUS_CHANNEL_4, FRAUD_ATTEMPT_M_BUS_CHANNEL_1, FRAUD_ATTEMPT_M_BUS_CHANNEL_2, FRAUD_ATTEMPT_M_BUS_CHANNEL_3, FRAUD_ATTEMPT_M_BUS_CHANNEL_4, NEW_M_BUS_DEVICE_DISCOVERED_CHANNEL_1, NEW_M_BUS_DEVICE_DISCOVERED_CHANNEL_2, NEW_M_BUS_DEVICE_DISCOVERED_CHANNEL_3, NEW_M_BUS_DEVICE_DISCOVERED_CHANNEL_4
The request needs the DeviceIdentification, AlarmType and Enabled parameters.
All requests have similar response behaviour which is described in .
returns the result from setting a SetAlarmNotifications. The response contains the DeviceIdentification and CorrelationUid which is received from the SetAlarmNotifications request.
XSD:
WSDL:
The Open Smart Grid Platform is designed for message based communication.
Acts as a connecting link between (web)applications and smart devices
The open Source approach prevents vendor lock-in
State of the art security
Fully scalable, dynamically scaling up and down as more devices and applications are added.
Freedom of choice in the desired IP communication infrastructure , e.g. CDMA and GPRS.
Stimulates open innovation by using open standards and open source technology
Multiple devices and communication protocols are supported
Independent of (cloud) hosting infrastructure
By de-linking the chain and the use of open standards and the open source license, anyone can build his or her applications on top of the open smart grid platform.
The open smart grid platform is optimized to provide reliable and efficient delivery of command and control information for e.g. , direct modules, , gateways and other applications.
The open smart grid platform simplifies the implementation of smart devices resulting in a shorter time-to-market by having built-in device management features
The platform supports various IP data communication infrastructures to communicate with the devices (internet, lan, GPRS, CDMA, UMTS, etc.).
The open smart grid platform also supports authentication and encryption for all data exchanges to protect the integrity and privacy of data as required in e.g. the smart grid.
The open smart grid platform supports multiple protocols
Easy application integration
Supports active-active setup over multiple data centers
Adding servers can be done in runtime
Please note: the Open Smart Grid Platform is not built for streaming data such as video, audio or a stream of high frequency measurement data.
The Open Smart Grid Platform is unique due to its multi-dimensional, generic and open design. Because of a true separation of layers and the use of open standards, other suppliers and/or third parties are able to develop and market innovative solutions.
The platform is multi-dimensional. This means that several customer use cases (with separate business models) are able to use the various device functions. One single application could use the same function of different devices.
The generic design ensures that the platform can be used in a flexible way for several functions and applications (e.g. public lighting services and smart meter services).
The platform is aimed at the 'common parts' of the technology chain; suppliers or vendors (of both applications and devices) have no competitive advantage in delivering these kind of services.
The platform layers are truly separated by open standards and the platform is made available as open source software.
The platform does not store any application data (the platform is thus stateless ). No messages/commands will ever get lost.
This enables third party vendors and developers to deliver innovative applications which are competitive in both rich functionalities and the generated data.
Image, functional layers overview
The Functional view shows an overview of the most important functions of the system. The two images below show the starting architecture and functional reference architecture respectively.
Image, functional starting architecture
Web applications
Open Smart Grid Platform
Web services
Basic functions
Database
Communication infrastructure (CDMA/GPRS/Ethernet)
IP infrastructure
Open Street Light Protocol (OSLP)
Public Street Lighting Device (PSLD) or Sub Station Lighting Device (SSLD)
This model partitions the system in seven functional clusters (vertically) which are shown on the system layers (horizontally). The circled numbers refer to image 1.
Vertical clusters:
Device installation
Device management
Firmware management
Configuration management
Schedule management
Ad-hoc control and status
Monitoring
Horizontal System layers:
Web applications
HTTPS/SOAP communication
Platform
Open protocols
Smart devices
Image, functional reference architecture
GetSetAdministrativeStatusResponse returns if the setting SetAdministrativeStatus is enabled. The response contains the DeviceIdentification and CorrelationUid which is received from the SetAdministrativeStatus request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
This chapter contains the general architecture and properties of the Open Smart Grid Platform. Domain and protocol specific information can be found in the domain and protocol chapters. This chapter is written for (potential) users, architects and developers.
GetSetActivityCalendarResponse returns the result from setting a SetActivityCalendar. The response contains the DeviceIdentification and CorrelationUid which is received from the SetActivityCalendar request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
GetSetConfigurationObjectResponse returns the result from setting a ConfigurationObject. The response contains the DeviceIdentification and CorrelationUid which is received from the SetConfigurationObject request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
SetConfigurationObject is a request to set ConfigurationObject settings on a device. The attributes with OBIS code 0-1:94.31.3.255 give access to set GPRS_operation_mode setting and following flags:
discover_on_open_cover
discover_on_power_on
dynamic_mbus_address
P0_enable
HLS_3_on_P3_enable
HLS_4_on_P3_enable
HLS_5_on_P3_enable
HLS_3_on_P0_enable
HLS_4_on_P0_enable
HLS_5_on_P0_enable
See DSMR document chapter 8.3 for detailed description. The request needs the DeviceIdentification, GprsOperationMode, ConfigurationFlagType and Enabled parameters.
All requests have similar response behaviour which is described in ResponseMessages.
GetSetConfigurationObjectResponse returns the result from setting a SetConfigurationObject. The response contains the DeviceIdentification and CorrelationUid which is received from the SetConfigurationObject request.
XSD: sm-configuration.xsd
GetSetAlarmNotificationsResponse returns the result from setting a SetAlarmNotifications. The response contains the DeviceIdentification and CorrelationUid which is received from the SetAlarmNotifications request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
GetKeys is a request to retrieve keys of a device. Multiple keys can be requested in one request. The keys in the response will be encrypted with the configured public key of the calling application.
The following key types are allowed:
E_METER_MASTER_KEY,
E_METER_AUTHENTICATION_KEY,
E_METER_ENCRYPTION_KEY_UNICAST,
E_METER_ENCRYPTION_KEY_BROADCAST,
G_METER_MASTER_KEY,
G_METER_ENCRYPTION_KEY,
G_METER_FIRMWARE_UPDATE_AUTHENTICATION_KEY,
G_METER_OPTICAL_PORT_KEY
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd
SetKeyOnGMeter is a request to transfer and set an encryption key, firmware update authentication key or an optical port key on a G-meter via the E-meter. The request needs the DeviceIdentification from the G-meter and the key type (secrettype). If the device identification of the G-meter is not known, but the gateway device identification and M-Bus channel are known, use the SetMbusUserKeyByChannel request instead. If the key type is the optical port key, the parameter to close the optical port can be set as well.
All requests have similar response behaviour which is described in ResponseMessages.
GetSetKeyOnGMeterResponse returns the result from setting a SetKeyOnGMeter. The response contains the DeviceIdentification and CorrelationUid which is received from the SetKeyOnGMeter request.
XSD: sm-configuration.xsd
The basic architecture
Basic Overview
The Open Smart Grid Platform environment consists of five layers:
Web services layer
Domain logic layer
Open Smart Grid Platform Core layer
Protocol layer
Device layer
In this layer the web services are exposed to the outside world. Applications can connect to the web services to implement the required functionality of the open smart grid platform. The web services are divided into functional domains, i.e. Public Lighting, Smart Metering, Power Quality, etc. Additional functional domains can be created.
Every functional domain has a separate set of web services and a corresponding domain logic block. In the domain logic block the business logic of that functional domain can be found. This is where a functional command will be translated into a generic intermediate format. For example, in the case of public lighting the command "Turn light on" will be translated into a command like "set switch(1) in closed position". In this layer it could also be decided that one functional command results in multiple commands to a device. The domain logic is closely related to the web services layers and can be added as well.
In the core of the Open Smart Grid Platform the following generic functions are found:
Device management
Time synchronization
Firmware management
Workflow engine
Device installation services
Scheduler
Device status monitoring
Routing of device commands to appropriate device protocol
The different protocol adapters are found in this layer. Here the generic intermediate format of a command for a specific device will be translated into the protocol message the device understands. This message will be sent to the device. A retry mechanism has been implemented to prevent communication failure in the case that the receiving end is temporarily unavailable. The listeners for messages initiated by a device are implemented here. Examples are the DLMS/COSEM protocol adapter for smart meters.
Any device in the public space with an Internet connection may be connected to the platform. The platform is independent of the device used, therefore this part of the set-up is not part of the platform.
SetPushSetupAlarm is a request to define the TCP message that is optionally sent by the device. The request consists of the DeviceIdentification and at least one of the following optional items:
The destination: Host URL and port.
The push object list, defining which information should be sent in the alarm.
If an item is not included in the message, the value in the meter will remain unchanged.
All requests have similar response behaviour which is described in .
returns the result from setting a SetPushSetupAlarm. The response contains the DeviceIdentification and CorrelationUid which is received from the SetPushSetupAlarm request.
XSD:
WSDL:
SetSpecialDays is a request to set a dayId profile for a specific date on a device, other than the standard applicable dayId's. This can be useful to change tariffs and tariff scheduling for specific days such as public holidays. The request is send with the DeviceIdentification number from the desired device, date and dayId.
All requests have similar response behaviour which is described in .
returns the result from setting a Special Day. The response contains the DeviceIdentification and CorrelationUid which is received from the SetSpecialDays request.
XSD:
WSDL:
SetPushSetupSms is a request to set an endpoint in a device which tells the device where to connect to when it is woken. The request needs the DeviceIdentification, host URL and port.
All requests have similar response behaviour which is described in .
returns the result from setting a SetPushSetupSms. The response contains the DeviceIdentification and CorrelationUid which is received from the SetPushSetupSms request.
XSD:
WSDL:
This chapter gives an overview of the principles used defining and implementing the architecture. The following principles were applied:
Layering
Domain driven design
Dependency inversion principle
Behavior driven development
The use of layers improves the separation of responsibilities. Each application contains the following layers:
Presentation layer: responsible for providing information to users (persons and/or systems) and the handling of user requests
Application layer: responsible for executing system tasks including authorisation control
Domain layer: responsible for the representation of the problem domain.
Infrastructure layer: responsible for technical matters supporting other layers. For instance persistence, messaging, etc
Image, Layers:
Audit logger
Web Services
Functions
Queue
Workflow engine
Protocol framework
Protocol implementations
Workflow engine
Queue
Communication
Domain-driven design focuses on the problem domain. DDD's starting point is creating an optimal model for a specific problem domain by having a common language and constructive collaboration between technical and domain experts.
DDD uses the following building blocks:
Entity: An object not identified by its attributes but by its own identity.
Value Object: an object with attributes but has no own identity.
A collection of objects surrounding a specific root entity (or aggregate root). To ensure consistency objects in the aggregate can only be addressed through the aggregate root.
Service: Contains instructions not related to a specific object.
Repository: Serves as a collection for fetching and saving objects. Creates an abstraction for actual persistent implementations.
Factory: Contains methods to create domain objects.
The dependency inversion principle promotes an independent connection by inverting dependency relations. This ensures that the domain model can be very 'clean' without knowledge of the underlying infrastructure (POJO classes). The Spring framework is used to implement the Dependency Inversion principle.
Behavior driven development is a way of programming that first describes behavior in user stories and then implements this in code. The user stories contain scenarios with acceptation criteria that can be automated. This creates a complete test suite for the whole system.
For the application of BDD the following frameworks are used:
Cucumber and Gherkin, automated acceptance testing, based on scenarios from stories.
Time behavior is mainly important in the Flexovl application when a lot of devices have to be addressed in a short period of time over a wireless network. Both latency and limited bandwidth have to be taken into consideration while demanding the coordinated on and off switching of the lighting, since we want to avoid the Christmas tree effect.
Time synchronization: devices periodically register with the platform and receive a time.
Protocol: because of the limited bandwidth an efficient protocol "protobuf" was selected.
Points of interest:
Light metering messages
When the SSLD's are disabled the PSLDs cannot be addressed
Because of these points of interest we use message queueing combined with a retry mechanism of delayed delivery.
The platform and devices use UTC time. The OSLP protocol between platform and devices uses UTC time as well.
The non-functional view is an overview of the most significant non-functional demands.
The identified non-functional demands are:
Time Behavior
Extensibility
Internationalisation and localisation
Security
Scalability
This are some examples how a message flows in the Open Smart Grid Platform.
*In case the response is not timely retrieved by the client app, OSGP will resend the notification with correlation id to the client app. The amount of retries is configurable.
The use of layers improves the separation of responsibilities. Each application contains the following layers:
Presentation layer: responsible for providing information to users (persons and/or systems) and the handling of user requests
Application layer: responsible for executing system tasks including authorization control
Domain layer: responsible for the representation of the problem domain.
Infrastructure layer: responsible for technical matters supporting other layers. For instance persistence, messaging, etc
Layers:
The web server is configured with a SSL certificate to encrypt the incoming and outgoing communication. The SOAP Web service (Spring Framework web service) uses a Java Keystore and a certificate for each organization. Only organizations that are known within the platform are authorized to use the web service.
For the several functional domains separate SOAP Web services are offered. This separation offers authorization per functional domain. Each of the web service components send a queue message to the corresponding domain component.
WSDL A separate WSDL is implemented for each functional cluster. All SOAP operations have a request object parameter and return a response object. For Synchronized Web Services the result is immediately included in the response. For asynchronous web services the response contains a correlation ID. This Correlation ID is to be used by the requester to receive the actual result from the platform. The following diagram is an example of such an asynchronous request.
Furthermore each SOAP message has a header which contains the user's organisation ID. This table displays an overview of the WSDL's including operations and fields in the request and response objects.
SOAP vs. REST
SOAP is chosen in the open smart grid platform web services over REST for the following reasons:
REST is resources/data oriented (put, get, delete) while the open smart grid platform is function/method oriented
SOAP has the advantage of having a contract (WSDL)
SOAP has extensive security features that are being used in the open smart grid platform to meet the high security demands/requirements requested by e.g. the energy utilities
Energy companies are generally not progressive in terms of technology. SOAP is acceptable for energy companies and REST is sometimes seen as new and insecure.
The benefits of REST (e.g. speed / less overhead) does not outweigh the benefits of SOAP. More general information on this topic can be found online.
For each functional domain business logic is implemented using a separate domain component. Common functionality like authorization should be abstracted to a shared component. Domain components receive queue messages from web service components and send queue messages to the open smart grid platform core component.
More information on the specific domains can be found in the domain chapter
The open smart grid platform core component receives queue messages from domain components. These messages from domain components are forwarded to a protocol adapter project. The open smart grid platform core component also offers logic for a protocol adapter project to send the response of a smart device back to a domain project. The Core component routes messages from domain adapter components to protocol adapter components and vice versa. The core layer also contains a workflow engine.
ERD's made with Valetina Studio
Overview of platform data model:
Data model explanation:
The platform will store as little data as possible. Generic (and domain specific) devices attributes are stored in core DB.
The open smart grid platform supports multiple protocols.
OSLP (Open Street Light Protocol)
DLMS/COSEM
IEC61850
The protocols can use one of the security layers:
TLS (Transport Layer Security encryption)
SSL (Secure Sockets Layer encryption)
Other protocols can be easily added to the platform. If possible, we prefer protocols based on open standards. A comprehensive list of protocols that are currently supported can be found in the protocols chapter.
Protocol specific device attributes are stored in the protocol adapter DB
Open smart grid platform components connect to each other through message queues.
Transactions on messages to and from the queues
Messages are persisted on the queues
Queues are clustered for reliability and speed
By using queues, the open smart grid platform can be stateless
The open smart grid platform can connect to any device that supports one of the supported protocols. Smart devices can receive messages from or send messages to protocol adapter components. In case of SSLD's this is done using TCP/IP over mobile internet connections (e.g. GPRS, CDMA, etc.). The communication is encrypted using public key cryptography.
The internal database model in the core layer:
Step
Description
1
WS adapter receives client soap request with organization certificate and organization id in soap header
2
WS adapter authenticates organization, checks authorizations and sends request message to domain adapter (via queue)
3
WS adapter returns soap acknowledgement with correlation id
4
Domain adapter sends request message to core (via queue)
5
Core determines protocol for device and sends request message to protocol adapter (via queue)
6
Protocol adapter translates domain request message, sends request to device and receives response from device
7
Protocol adapter sends response message to core (via queue)
8
Core forwards response message to domain adapter (via queue)
9
Domain adapter forwards response message to response queue
10
Client app polls for response using correlation id (with organization certificate and organization id in soap header)
11
WS adapter retrieves response message from response queue
12
WS adapter sends soap response to client app
Step
Description
1-8
Same as request/acknowledge/poll message flow
9
Domain adapter forwards response message to WS adapter
10
WS adapter stores response in DB
11
WS adapter sends soap notification with correlation id to the client app*
12
Client app sends soap request with correlation id to retrieve the response
13
WS adapter retrieves (and deletes) response from DB
14
WS adapter sends soap response to the client app
Table
Description
devices
Devices table
device_authorisation
Authorisation table, function group column concerns the device functions (AD_HOC, INSTALLATION, etc)
organization
Organization table, function group column concerns the platform functions (ADMIN of USER)
event
Events table
oslp_log_item
Table for logging of OSLP messages.
webservice monitor log item
Audit record for tracking webservice activity.
The platform and devices use UTC time. The OSLP protocol between platform and devices uses UTC time as well.
The following security measures can be used in a hosted environment:
DDOS protection
IPSEC VPN connections
IP whitelisting
Most cloud environments support these features.
Hardened operating systems (according to Center of Internet Security)
Communication over TLS
Firewalls between all servers and layers
Certificates from a recognized Certificate Authority (CA)
Audit trail on all actions throughout the platform
Role based authorizations on specific functions of devices
Access control
Unique device identification
For every major release there will be a mandated security test initiated by Alliander.
In cooperation with the European Network of Cyber Security (ENCS) state of the art security measures were implemented.
Security per device
Security per application
Security Certificates per Organisation and per device
All communication is encrypted
Security measures: 1. Firewall in defined zone 2. Operating System Hardening 3. DDOS protection 4. Replay attack prevention 5. Private encryption key per device 6. Certificates from a Certificate Authority 7. Encryption via Elliptic Curve DSA 8. IPSEC VPN for CDMA and GPRS 9. Unique device identification 10. Unique CDMA modem number 11. Role based authorizations on functions and devices
An analysis of safety aspects has led to the decision that the safety of the whole system will be realized by proven technology based on asymmetrical coding (also known as public-key encryption).
Two-way SSL will be used between web applications and the Open Smart Grid Platform to verify the identities for both client and server. User organisations are responsible for the administration of the identity of and access to their web applications. The web applications feature a login page. After successful login the user is linked to an organisation. Passwords will be stored with encryption. The organisation ID will be sent in each message to the Open Smart Grid Platform and will be verified by the SSL certificate.
Only public encryption Algorithms will be used. Due to performance limitations (of the devices) and recommendations from The European Network for Cyber Security (ENCS) Elliptic Curve DSA with 256-bit-keys was selected. This improves the security and efficiency over the 1024 bit RSA algorithm. Messages can be smaller and less processor capacity is needed. The key length of Elliptic Curve DSA is similar to the 3072 bit key length of RSA.
Note: Even though the open smart grid platform uses ECDSA to secure the OSLP, other encryptions may be used as well. The RSA Algorithm is still supported if preferred. This is a flexible configuration option.
A private APN is used for linking to mobile data communication infrastructures.
Every action to and from devices is logged in the audit trail
Messages from unknown devices will be denied (and logged)
The Open Smart Grid Platform contains an extensive authorization model, which enables a device owner to give certain rights on certain devices to other organizations. Every organization will only see devices they have rights to.
This model displays the most important entities of the open smart grid platform system and their mutual relationships.
Image of Logical Authorisation Data Model
The logic of the model above:
At the top of the image is the entity "authorisation". This represents the permissions of an organization on a certain device. In general an organisation will have a lot of permissions, at least one for each device it needs to manage.
The functions an organisation can execute on a device are determined by the function group the authorisation refers to. Function groups are collections of functions and are predefined in the software. The following function groups have been predefined.
Owner-group (this contains all functions)
Ad hoc-group (Functions for ad hoc switching of lighting)
Management-group (Platform functions)
Installation-group (Functions to install devices)
Firmware-group (Functions for updating firmware)
Schedule-group (Functions to create lighting schedules)
Tariff scheme-group (Functions to create tariff groups)
Configuration-group (Functions to configure devices)
Monitoring-group (Functions to monitor devices)
This structure provides maximum flexibility when assigning rights to devices. Devices always belong to an Owner. An owner is an organisation, but not every organisation is an owner. A device can have more than one owner. The entity "Event", at the bottom of the image, is the execution of a function by an organisation on a device.
Details like device-type, device-status, etc. have been omitted from this model.
One security requirement is that each event must be traced back to a 'natural' person, also known as an audit trail. Although the open smart grid platform does not register individual users we can meet this requirement by registering a data-item with each event. This enables the user organisation to investigate which events belongs to which 'natural' person. This data-item can for example be an user-ID provided by the user organisation which doesn't have to be unique in the open smart grid platform.
Table describing the entities in the logical data-model
An organization can get rights to one or more function groups, and thus all functions in that function group will be available to this organization.
To ensure that devices can only receive instructions from a 'genuine' open smart grid platform it must be possible to authenticate the open smart grid platform. This is implemented through a standard technology based on asymmetric encryption (if supported by the Device). The open smart grid platform will receive a unique key to enable the devices to tell if the messages come from a 'genuine' open smart grid platform. Both OSLP and DLMS device types use this kind of encryption. To prevent replay-attacks each message will get an index number (this is standard practice as well).
To ensure that the open smart grid platform can distinguish between 'genuine' devices and 'illegal' devices, all devices are supplied with a manufacturer key. Each device has a unique key. Because of the asymmetrical encryption the platform contains the public part of each key. In this way devices can be identified by their unique key and their unique hardware ID. The device-ID will be encrypted in each message sent from the device to the platform.
All communication between the open smart grid platform and the devices will be signed with these keys to ensure (1) the source is legitimate and (2) to ensure the integrity of the message. It is not necessary to encrypt the whole message because confidentiality is not important. This results in a less computationally intensive process.
When a key is stolen (by hacking a device) this will not affect the integrity of the other devices. Each device has an unique key after all and only the hacked device has to be excluded from communication in the platform.
The security is independent from the carrier (GPRS, CDMA, Ethernet, etc.). The open smart grid platform supports symmetric and asymmetric encryption (depends on device and protocol).
For OSLP devices, the firmware will be used to distribute keys to devices. In this way we can use the existing secure firmware update mechanism for updating keys and certificates. DLMS devices use a mechanism to switch keys that is not dependent on firmware updates.
Additional security may be provided by using TLS communication.
Authorisation for use of the platform functionalities is handled by function groups. Function groups are defined for both platform functionality and device functionality. Each function group has one or more functions. Access to device functions can be set per device. The tables below show an overview of all function-groups and device-functions and platform-groups and platform-functions respectively.
The Open Smart Grid Platform is designed and built for scalability and reliability
Messages will never get lost, In the worst case scenario, a message will be sent to the dead letter queue.
Any layer of the platform can be independently scaled up- and down
Adding servers can be done runtime
It can run in an active-active setup over multiple servers and data centers. In our cloud hosted setup even over sets of data centers in different countries.
Entity
Description
authorization
Authorization – Permissions of an organisation to execute a certain function (member of a role) on a certain device
device
Electronics present in a "container" (for example a lamp post), connecting to the open smart grid platform and (in case of a lamp post) controls the lights. One device has one owner.
audit trail
The actions of an organization on a device. A combination of [time, organization, function and device].
function
An end-to-end operation. For example "set schedule". A function belongs to multiple function groups.
function group
Usually this will be larger groups than the "function clusters" in this document. All functions available to end users could be in a single group for example.
organization
A party playing a role in the management and control of the devices, for example municipalities.
owner
An organization role. Each device has an owner.
event
An event reported by the device (which is not the action of a natural person) for example an error or security problem.
Groups
Functions
OWNER
INSTALLATION
AD_HOC
MANAGEMENT
FIRMWARE
SCHEDULING
TARIFF_SCHEDULING
CONFIGURATION
MONITORING
GET_DEVICE_AUTHORISATION
X
X
X
X
X
X
X
X
X
SET_DEVICE_AUTHORISATION
X
START_SELF_TEST
X
X
STOP_SELF_TEST
X
X
SET_LIGHT
X
X
GET_STATUS
X
X
RESUME_SCHEDULE
X
X
SET_REBOOT
X
X
SET_TRANSITION
X
X
SET_EVENT_NOTIFICATIONS
X
X
GET_EVENT_NOTIFICATIONS
X
X
REMOVE_DEVICE
X
X
UPDATE_FIRMWARE
X
X
GET_FIRMWARE_VERSION
X
X
SET_SCHEDULE
X
X
SET_TARIFF_SCHEDULE
X
X
SET_CONFIGURATION
X
x
GET_CONFIGURATION
X
X
GET_ACTUAL_POWER_USAGE
X
X
GET_POWER_USAGE_HISTORY
X
X
Groups
Functions
ADMIN
USER
CREATE_ORGANISATION
X
GET_ORGANISATIONS
X
X
GET_DEVICE_NO_OWNER
X
GET_MESSAGES
X
FIND_DEVICES
X
SET_OWNER
X
This chapter describes the results of a performance test, to give potential users an indication of the system requirements for the platform.
The Platform was tested with the following AWS setup:
Systems:
Specifications Component Server: 2 CPU's, 8 GB RAM
Specifications Database Server: 1 CPU, 2 GB RAM
Setup:
Front-end: 2x Component Server
Middle-end: 2x Component Server
Back-end: 2x Component Server
ActiveMQ Front-Middle: 1x Component Server
ActiveMQ Middle-Back: 1x Component Server
Databases: 1x DB Server
For the test to succeed, two requirements were to be met:
Switch 10.000 simulated OSLP devices under 5 minutes.
Switch 40.000 simulated OSLP devices under 5 minutes.
The results showed that both tests succeeded.
This chapter describes the possibilities of a redundant set up of the Open Smart Grid Platform. The Platform is designed to run in a High Available (or HA) environment, and to prevent data loss due to unexpected failures. Each component of the Platform is designed to be stateless. Components communicate with each other using message queues, which are processed in an asynchronous way.
In an active-active setup, multiple instances of each component (eg. Web Services, Core, Protocol Adapter) process the data at the same time. Traffic is equally distributed across the instances. In case of a defect in one instance the traffic is automatically processed by the remaining instance(s). The Open Smart Grid Platform is designed to run in such a set up, and thus preventing down time in case of a failing server. Each component of the Platform can run in an independent, redundant and scalable way.
The Open Smart Grid Platform uses a PostgreSQL database. PostgreSQL supports multiple database servers. For example, a slave and master node, where the slave node continuously replicates the master node. In case the master node fails, the slave mode is triggered and will stop replicating from the master node, execute a recovery and will become the master node.
The components of the Platform communicate with each other through a Message Queue. The Open Smart Grid Platform uses Apache Active Message Queue, which makes asynchronous communication possible between components. The components can register to the queues as consumers. In case a consumer (e.g. a server running a component of the platform) is down, the message will still be consumed by the remaining consumer(s). The Message Brokers can be used as a MasterSlave. In case the Master message broker is down, you get immediate fail-over to the slave without loss of messages.
The Domain Adapters are responsible for receiving requests from the Web Services layer, and delivering them to the Core layer. The Domain Layer mainly contains MessageProcessors and Services for request handling.
The Core/Admin components contains the shared functionality, while the Domain components contain additional domain specific functionality.
At the moment the Platform uses the following Domain Adapters:
Generic
Core - osgp-adapter-domain-core: Contains Core (common) functionality; AdHocManagement, FirmwareManagement, etc.
Admin - osgp-adapter-domain-admin: Contains Admin functionality, e.g. DeviceManagement.
Domain
Public Lighting - osgp-adapter-domain-publiclighting: Contains functionality for the Public Lighting Domain.
Smart Metering - osgp-adapter-domain-smartmetering: Contains functionality for the Smart Metering Domain.
Tariff Switching - osgp-adapter-domain-tariffswitching: Contains functionality for the Tariff Switching Domain.
Microgrids - osgp-adapter-domain-microgrids: Contains functionality for the Micro Grids domain.
Distribution Automation - osgp-adapter-domain-distributionautomation: Contains functionality for the Distribution Automation domain.
config: Contains the configuration files for the Component. Uses the property files in /etc/osp/.
-- ApplicationContext
-- DomainAdapterInitializer
-- MessagingConfig
-- PersistenceConfig
mapping: Custom Orika converters for mapping to/from DomainObjects/DTO Objects.
services: Contains most of the domain logic, related to the specific services of the adapter. The service classes converts DTO objects to Domain objects (or vice versa), and put the request on the Core queue through the JMS classes.
jms.core: Inbound/outbound messages from/to the Core layer.
This package contains Messages, MessageListeners, MessageSenders and MessageProcessors for sending requests to the Core Queue, or receiving and processing responses from Core.
jms.ws: Inbound/outbound messages from/to the web services layer.
This package contains Messages, MessageListeners, MessageSenders and MessageProcessors for sending requests to the Web Services Queue, or receiving and processing responses from the web services layer.
The Web Services layer contains the web services that are used to communicate with the Platform. The Open Source Smart Grid Platform uses the Simple Object Access Protocol or SOAP to expose its interfaces. The Web Services Adapter receives requests and sends those to the Domain Adapter. An incoming request is converted to a Domain Object, and put on the MessageQueue of the Domain layer. The Web Services layer also has a queue for incoming responses from the Domain adapter.
Each domain of the Platform has its own web services:
Core - osgp-adapter-ws-core: Contains the Core (common) web services.
Admin - osgp-adapter-ws-admin: Contains the Admin web services.
Shared - osgp-adapter-ws-shared: Contains shared endpoints, such as header authorization
Database - osgp-adapter-ws-db: Contains repositories for persistence.
Public Lighting - osgp-adapter-ws-publiclighting: Contains the Public Lighting web services.
Smart Metering - osgp-adapter-ws-smartmetering: Contains the Smart Metering web services.
Tariff Swithcing - osgp-adapter-ws-tariffswitching: Contains the Tariff Switching web services.
Microgrids - osgp-adapter-ws-microgrids: Contains the Micro Grids web services.
Distribution Automation - osgp-adapter-ws-distributionautomation: Contains the Distribution Automation web services.
For a description of the WSDL's see the Domain Chapter.
A description of the general package structure of a web service component.
config: Contains the configuration files for the Component. Uses the property files in /etc/osp/.
-- ApplicationContext
-- AdapterInitializer
-- MessagingConfig
-- PersistenceConfig
-- WebServiceConfig
exceptionhandling: Exceptions are defined here.
mapping: Custom Orika converters.
services: Contains services used by the domain, such as AdHocManagement. These are called by the end points and convert the request to a Domain Object and put the request on the domain message queue using the JMS classes.
EndPoints for the web services: contain a reference to a service that proceeds with handling the request.
jms: contains the JMS classes such as:
-- MessageSender(s)
-- MessageType
-- ResponseMessageFinder
The WSDL and schema definitions can be found under main/webapp/WEB_INF/wsdl.
The Core layer of the Open Source Grid Platform is responsible for Validation, Translation, Authorisation and Routing of request messages. It also contains all the Domain Objects.
The core layer consists of two components:
osgp-domain-core: Shared Domain objects, services, repositories, etc. These classes are used through the entire platform.
osgp-core: Logic for routing domain requests, scheduling, retrying, etc.
entities: Defines the entities used for persistence.
exceptions: Domain specific exceptions reside here.
repositories: Repositories that contain logic for persisting entities.
services: Domain services that reference a repository.
specifications: Interfaces that define specifications for Devices and Events.
validations: Validators and constraints.
valueobjects: Definitions of the Domain Objects.
config: Contains the configuration files for the Component. Uses the property files in /etc/osp/.
-- ApplicationContext
-- OsgpCoreInitializer
-- DomainMessagingConfig
-- PersistenceConfig
-- ProtocolMessagingConfig
-- SchedulingConfig
services: Services that process device requests/ responses. Checks for authorization, and if the request is supported by the platform, it will be routed to the appropriate protocol adapter.
tasks: Contains task scheduler logic.
These packages contain interfaces for the Services.
domain: Interfaces for the Domain services.
protocol: Interfaces for the Protocol services.
domain: Contains Messages, MessageListeners and MessageProcessors for Domain related messaging.
protocol: Contains Messages, MessageListeners and MessageProcessors for Protocol related messaging.
The Protocol Adapters are responsible for the actual communication to and from a device. They usually operate in a certain domain, and might use common/ generic functions from the platform.
The Open Smart Grid Platform currently has the following protocol adapters:
Protocol-Adapter-DLMS: Smart Metering
Protocol-Adapter-IEC61850: Public Lighting, Micro Grids and Distribution Automation
Protocol-Adapter-OSLP: Public Lighting and Micro Grids
config: Contains the configuration files for the Component. Uses the property files in /etc/osp/.
-- ApplicationContext
-- MessagingConfig
-- OsgpProtocolAdapterOslpInitializer
-- OslpConfig
-- OslpPersistenceConfig
mapping: Custom Orika converters.
services: Contains the (functional) services that control communication from (and to) the device. Also persists requests and responses, and deals with security. Actual communication is done through the classes in the infra package.
Contains the Protocol Adapter Objects used for the Protocol Adapter.
requests: Objects representing the requests that are supported by this adapter.
responses: Objects representing the responses that are supported by this adapter.
entities: Entities used for persistence.
repositories: Repositories used for persistence.
Contains the exceptions that might be thrown while communication with a device, e.g. ValidationException, MessageRejectedException, etc.
This package contains all the code for communication through JMS (Platform) and Networking (Device).
messaging: Contains the JMS Messages, MessageListeners, MessageSenders and MessageProcessors.
networking: Contains the classes that are responsible for connecting to a device using a certain protocol.
Services used to check the request status.
Apache ActiveMQ: Open source messaging server, used to relay messages between components of the open smart grid platform. ActiveMQ is an open source message broker written in Java and a full Java Message Service (JMS) client. It provides "Enterprise Features" which in this case means fostering the communication from more than one client or server.
Apache HTTP server: Web server, used as front for Apache Tomcat.
Apache Tomcat: Provides a "pure Java" servlet container for Java code to run in.
pgAdmin-III: PostgreSQL administration and management tools.
Protobuf (Google Protocol Buffers): A language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more.
Flyway: Agile database migration framework for Java
HikariCP: JDBC connection pool
Hibernate: Object/Relational mapping
Netty: Network application framework for protocol servers & clients
OpenMUC: Library implementing the IEC61850 and DLMS/COSEM communication standard
Orika: Java bean mapping
Spring: Application development framework. Several Spring libraries are used, including Spring Data, Spring Security and Spring WS.
Puppet: Application for Automatically delivering, operating and securing your infrastructure
Bower: Package manager for Javascript packages. Web applications consist of various components; frameworks, libraries, assets, utilities, and rainbows. Bower manages all these things for you.
Eclipse: IDE for developing software.
FileZilla: FTP application.
Git: Version control system.
NodeJS: Tooling suite with various Javascript tools.
NPM: Package manager for the NodeJS Javascript applications.
Putty: A free and open-source terminal emulator, serial console and network file transfer application.
Vim: Source code editor.
Apache Maven: Software project management tool.
GIT & GitHub: Source code management.
Apache JMeter: Application designed to load test functional behaviour and measure performance.
Cucumber: automated acceptance testing framework.
Gherkin: DSL for acceptence testing framework.
Sonarqube: Quality management platform.
SoapUI: Functional testing tool for testing web services.
JUnit: Unit testing.
Mockito: A Mock framework for Unit testing.
The following table presents an overview of the components and the most important technical choices per component.
This chapter gives a more technical overview. It describes each layer of the platform by giving an overview of its packages and the code it contains. Furthermore it describes how a message proceeds through the platform. If you are planning on adding your own Domain Adapter or Protocol Adapter, it will be useful to read this chapter to get a feeling of how the Platform has been built.
The picture below depicts an example of a request (OSLP SetLight request) proceeding through the platform to a device.
A web request enters the platform at its EndPoint, which in turns calls the RequestService. The RequestService checks if the organisation in the request is authorized, creates the request message and sends it to the MessageSender which in turn puts it on the queue of the Domain Adapter.
In the Domain Adapter, the incoming message is processed in the MessageProcessor, which in turn calls the Request Service. Here the message is converted to a DTO object. The CoreRequestMessageSender puts the message on the Core Queue.
The MessageListener in Core receives the message. The DeviceRequestMessageService contains generic functionality such as Authorization, Validation, etc. Once these procedures are completed, the message is routed to the appropriate protocol adapter.
In the Protocol Adapter the message is received by the MessageListener. It is processed through the MessageProcessor and OslpDeviceService. The request eventually ends up in the OslpChannelHandler, where the actual Protocol Request to the device is made.
For a detailed description of each layer, please take a look at a more detailed description of each layer in this chapter.
The Platform uses property files for certain settings (such as JMS settings, Persistence settings, etc.). These files are stored in property files which can be found in the Config repository on Github. These files are sym linked to /etc/osp/, where the Platform (through reference in context.xml) looks for the property files.
Component
Technology
Open Smart Grid Platform
Java, Spring Framework, Hibernate, Netty
Demo application
Java, Spring Framework, Spring MVC
Web services
SOAP, WSDL
OSLP Protocol
Google Protocol Buffers
Component (not open source)
Technology
OSGP Management application
Java, Spring Framework, Spring MVC
Net-Management application
Java, Spring Framework, JAX-RS, AngularJS
Liander Installatie application
Java, Spring Framework, JAX-RS, AngularJS
The open smart grid platform use-cases are strongly related to the open smart grid platform domains. Up-to-date information on use-cases can be found on the Grid eXchange Fabric website.
To install the platform you can use one of the following procedures.
The Vagrant Installation. This procedure creates and installs a complete image with the Open Smart Grid Platform pre-installed, including all the tools such as Maven, Eclipse, SoapUI, etc.
The Manual Installation. Follow this guide if you want to install the Open Smart Grid Platform yourself.
To get started quickly, a Vagrant Installation Guide has been created and a guide for Manual Installation.
The goal of the installation manual is to control a simulated OSLP device through the Platform. Below, is a summary of all steps involved. See the next chapters for a detailed guide with screenshots. Please follow the steps carefully.
A summary of the steps involved:
Creating a virtual machine using Vagrant and Virtual Box
Run the puppet script (part of the Vagrant installation), or complete the steps manually (Manual installation)
Importing Maven Projects into Eclipse
Creating an Apache Tomcat9 Server
Setting Up Apache Tomcat9 Server Context
Deploying all open smart grid platform components to an Apache Tomcat9 Server
Starting Apache ActiveMQ
Starting Apache Tomcat9 Server
Creating the 'test-org' organization in the Database
Setting up SoapUI
First SOAP Requests to add a device to the open smart grid platform
Opening Device Simulator to add a device
Registering a device
Using 'SetLight' SOAP Request to switch the light on
Sys Admins who are tasked with keeping the Open Source Grid Platform running on a environment, can find some information in this chapter.
To get started with Open Source Grid Platform, please read our . The Introduction offers an excellent overview of the Platform and its features.
A next step could be to have a look at the WSDL's to understand which functions are present per functional domain. Depending on the functional domain one is interested in, one could also have a look at the Protocol Adapter and device simulator for the domain.
If a full installation is desired, have a look at our . This can be used to setup a development environment which can be used to start the Platform and run it. Installation on one or several servers can be derived from the steps within the Installation Script.
This document describes the automatic installation procedure for your Open Smart Grid Platform development environment.
If you would like to follow the manual installation procedure, please proceed to the .
Creating a Virtual Machine using Virtual Box and Vagrant
To improve the usability of the Installation process, a Vagrant file and some puppet scripts are used to automatically set-up an virtual Open Smart Grid Platform development environment. The following steps will describe how to install VirtualBox, Vagrant and kick off the procedure by running the vagrant up
command.
The following system requirements are recommended:
Core i5/i7 ~2.5GHz Dual Core, Quad Core recommended
At least 16 GB RAM, 32 GB RAM recommended
At least 20 GB free space, 50 GB free space recommended
The installation procedure has been tested on Windows 10.
note: If you already have VirtualBox, make sure it is at least version 6.1.38
note: Check whether Virtualbox stores the images on a drive with enough free space. (Open Oracle VM VirtualBox Manager -> Preferences -> General -> Default Machine Folder).
note: If you already have Vagrant, make sure it is at least version 2.3.0 Complete the installation and restart your PC.
note: If you did a fresh install of Vagrant and already had a command prompt open, make sure you close this command prompt and open it again.
Remember to enable Virtualization in your system BIOS.
Also disable Hyper-V in Windows (can be found in Windows Features)
First create a new directory (for example: D:\My Vagrant Images\OSGP Development\
)
Make sure that the file is named like this: Vagrantfile
without an extension!
If the file has an extension (for example .txt) you can rename the file using the following console command.
MacOS/Linux:
Windows:
Now open a Command Prompt and navigate to the newly created directory where you just put the files. Make sure that you run the Command Prompt using administrator rights.
note: When you open the Vagrantfile you see that default the image is configured to run in virtualbox with 2 cpu cores and 8192 MB of RAM. If you need to you can change this to more or less cpu cores and RAM, but it is recommended to use the provided settings.
Run the following command: vagrant up
note: In case of error bad uri Images/OSGP Development/hashicorp/itc/itc-ubuntu-mate-20.04-amd64 then use the following command;
vagrant destroy
vagrant box add itc/itc-ubuntu-mate-20.04-amd64
vagrant up
note: In case of an error complaining about not being able to resolve a URL (for instance to github.com) then try using a different internet connection not behind a proxy.
Vagrant will now automatically download an Ubuntu image (+- 2.6 Gb), create a virtualbox image from it and run the installation puppet script when finished. This might take a while, depending on your internet speed. After some time (while the script is still running) you will notice that a window with an Ubuntu Virtual Machine pops-up. Don't log in yet, wait until the script in the Console is finished.
If the script fails for some reason (eg. Errors in the console such as time outs during downloading), you can retry the procedure by running the following command vagrant destroy && vagrant up
Now that the script has ran its course, it will automatically log in on the Ubuntu virtual machine as user dev.
note: For some actions, like
sudo
, you will have to enter the password of user dev. The password for user dev is dev.
At this point you also can adjust the virtualbox settings like cpus and memory size. If you don't want to adjust this proceed to Chapter 2.1.2. Platform Setup.
If you do want to update the virtualbox settings for this image, shut down the image first:
Once the machine has been Shut Down, open VirtualBox and right click on the new virtual machine (called "OSGP Development") and select Settings. Go to System and increase the Base Memory of the system to at least 6144 MB (6 GB) (or the maximum recommended (in green) amount for your system).
Now go to the Processor Tab and increase the amount of Processors to the maximum recommended (in green) amount.
Close the Settings window and Start the Virtual Machine again. Once it is booted, you should be automatically logged in as the 'dev' user.
In order to use git correctly you need to execute the following commands in a terminal:
Start by downloading VirtualBox by going to And follow the installation steps.
Now download and install Vagrant. Vagrant is available at the following URL:
Browse to and save the png image and Vagrantfile files in your newly created directory.
You just created a virtual machine running Ubuntu with pre-installed tooling. Proceed with of the guide describing how to set-up the open smart grid platform.
Throttling is used to limit the flow into communication channels that need it. The GXF platform has throttling support for CDMA and SMS/texting.
The CDMA network uses base transceiver stations (BTS) with cells for each BTS.
Throttling occurrs on the number of concurrent connections per BTS/cell. GXF offers a throttling service that hands out permits per BTS/cell while maintaining the configurable limit.
An application will typically use this service like this:
SMS can be used to wake up certain types of devices. Throttling in this context means limiting the number of messages per second to a configurable rate.
In order to use git correctly you need to execute the following commands in a terminal if you haven't done so already:
GXF is covered by LFE's CLA. You have to sign/agree to it in order to commit changes. Most likely you will have to sign the individual agreement, unless you work for a licensed company.
Your pull request will detect if you haven't signed it yet and instructions are given on how to continue.
GXF uses GitHub's DCO application, so you need to sign-off your commits.
Your pull request will detect if you haven't signed-off your commits and instructions are given on how to continue.
Just add -s
to git commit ...
.
Note this is the lower case -s
(short for --signoff
).
With git merge ...
you can add --signoff
as the shorter -s
is used to set the merge strategy.
In some versions of Eclipse you can click the button to "Add Signed-off-by" in the Git Staging view:
In the commit toolwindow, click the settings icon and check the 'Sign-off commit' checkbox:
There are two procedures for testing the Open Smart Grid Platform.
SoapUI. Create and send Soap requests to the Platform to manage a (simulated) light.
PublicLighting Demo App. Use the Demo App to send requests to the Platform to manage a (simulated) device.
This chapter describes all the steps needed to finalize the open smart grid platform development environment.
The platform uses Lombok annotations to generate extra Java methods. Without Lombok the project is not imported correctly by Maven and will not run. If you used the Vagrant installation method it should already be installed. To check if Lombok is properly installed to go Help > About Eclipse IDE
and scroll down. Here you will see: Lombok <version> "<version name>" is installed. https://projectlombok.org/
. If not follow this to install Lombok.
Open Eclipse by clicking the shortcut on the Desktop and import the projects.
Go to File -> Import -> Existing Maven Projects, browse to folder /home/dev/Sources/OSGP
Import the projects from location /home/dev/Sources/OSGP/open-smart-grid-platform
.
In Eclipse go to Window -> Open Perspective -> Debug
In the 'Debug' perspective, go to the 'Servers' view and add a new Apache Tomcat server, Tomcat is available in the folder /home/dev/Tools/tomcat
(or in another location if you didn't set up a VM using Vagrant, the latest version usually works fine).
Click on Next
Click on Finish
Make sure that Tomcat is using the correct Java Runtime Environment:
Click on 'Runtime Environment', 'Installed JREs' and click 'Add'. Choose 'next' with 'Standard VM' highlighted. Click 'Directory' and in the folder browser that is shown, use the key combination 'Ctrl + h' to show hidden files. Choose '.sdkman/candidates/java/current' and select 'Open' and 'Finish'. In the 'Installed JREs' screen, unselect the default JVM (which will be an Eclipse hotspot JVM) and select '/home/dev/.sdkman/candidates/java/current' then close the screen by clicking 'Apply and Close'. The last step is to choose the new JRE which was just added in the dropdown of the 'Runtime Environment' screen by selecting '17.0.5'. Click 'Finish' to apply.
All modules contain their own context.xml. In the module specific context.xml are the environment variables defined where the global and module specific configuration files are located. Default they will point to a location in /etc/osp/.
Continue with starting Apache ActiveMQ. If you installed an environment as described with Vagrant, you can double click the ActiveMQ shortcut on the desktop.
Alternatively you can open a terminal and run the executable manually by using the following command: (the executable can be found in the folder /home/dev/Tools/activemq/bin
)
With ActiveMQ running, the Tomcat server can be started. Go to Eclipse, go to the Servers tab in the Debug view, and right click on the Tomcat server and select 'Start'.
note: In case of an error starting up for the very first time, try and start up only the module: 'osgp.core' first. This makes sure the database scripts are executed.
Open pgAdminIII and configure a connection: choose the 'Add a connection to a server.' and fill out the fields using
Host: localhost
Port: 5432
Username: osp_admin
Password: 1234
Run the script in /home/dev/Sources/OSGP/Config/sql/create-test-org.sql
to insert 'test-org' organization into the organisation table of the osgp_core database.
If asked for a password, enter 1234
Go back to PgAdmin III, expand servers, select localhost -> databases -> osgp_core -> Schemas -> public -> Tables. Right click the organisation table and select to view data for the top 100 rows. Confirm that the test-org organisation has been added to the Database.
Now that everything has been set up, continue to the next chapter to start testing the Platform by sending it some requests.
After adding the server, double click on the Tomcat server in the 'Servers' view and set the following configuration: under 'Timeouts' set 'Start' to 600 and 'Stop' to 30.
Click on 'Open launch configuration', click on the 'Arguments' tab and add the following at the end of the 'VM arguments': -Xms512m -Xmx2048m -Xss512k -XX:MaxMetaspaceSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -Dcom.sun.management.jmxremote=true
If you want to deviate from this, you might set up the context.xml in Tomcat to be able to redirect in one file to different locations. This is optional and not required. In order to use a custom context.xml, copy the entries in /home/dev/Sources/OSGP/Config/tomcat/context.xml.sample
to the Tomcat context.xml in the eclipse Servers folder, to map configuration file names to file paths.
Continue by adding the Maven Projects to the Tomcat server by right clicking on the Tomcat server and choosing 'Add and Remove'. Select all available resources, except for osgp-protocol-simulator-61850 (which is for advanced use and requires additional configuration), then click the 'Add' button. At this point, eclipse's auto-build should have built the projects, and the Tomcat server has been setup.
This starts ActiveMQ as a terminal process (this way, ActiveMQ doesn't detach from the terminal and starts running as a daemon).
This is an optional program that shows the status of the Tomcat resources in real time. To install Probe you can follow this . Note that you need to add the Tomcat users in the guide's Security part in the tomcat-users.xml in your Eclipse environment. To download the war file go to: . You need to copy the war file to: /home/dev/<your Eclipse workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps
.
This chapter describes the steps for a manual installation (eg. not using the vagrant script and puppet scripts). This chapter is for developers who would like to have more control over the installation procedure.
With the increased control come increased risks of things not working with the versions or configuration of the software involved with the OSGP environment. If you run into issues, you may find clues in the puppet scripts about versions and modifications to the configuration of installed software.
Skip this chapter if you followed the Vagrant installation! You can continue with next chapter: Setup the Open Smart grid Platform
The Open Smart Grid Platform runs on a Linux environment. It is recommended to set up a machine running Ubuntu.
The Open Smart Grid platform needs the following software and tools installed/downloaded:
Java 8 openjdk-8
PostgreSQL and pgAdmin 3
Git
Maven
ActiveMQ
Tomcat
Apache HTTPD
SoapUi
Eclipse IDE for Java EE Developers
Google Protocol Buffers: protobuf-compiler, libprotoc7 and libprotobuf7
It is recommended to create a 'dev' user, because some scripts contain hard coded references to this 'dev' user. It is possible to skip this step, but then some of the scripts will have to be adjusted manually.
Place the PostgreSQL JDBC driver jar in the Tomcat lib directory.
Change permissions of Tomcat Config files to 644 in the Tomcat conf directory.
Enable mod_ssl by running the following command:
Enable proxy_ajp by running the following command:
Make sure the JAVA_HOME var is set, and points to openjdk-8.
Clone the following repo's, it is recommended to create a Sources/OSGP
directory in /home/dev/
since some scripts contain hard coded references to those folders.
Make sure you are on the development branch (default).
Create the following directories:
/var/log/osp/logs
/etc/osp/
Make the dev user (or equivalent) the owner of the log directory with rwx permission. Give the other users read and execute permission.
Execute the script /home/dev/Sources/OSGP/Config/scripts/create-symlinks.sh
Note This script uses hard coded references to /home/dev/Sources/OSGP/*
, if you used a different user, please edit the script before executing it.
The script will make symlinks to certificates, to Apache HTTP server configuration and copy configuration settings as samples to locations where these properties may be overridden.
To create the database run the following command (Change /home/dev/ in case of no dev user)
And create a backup of the pg_hba.conf file (modify if your version of PostgreSQL is different)
Finally, reload the postgresql service:
Continue with setting up the Open Smart Grid Platform by following the Set up the Open Smart Grid Platform Guide
This chapter will describe the steps needed to test the Open Smart Grid Platform.
Start SoapUI by double clicking the shortcut on the Desktop or run it manually by typing the following command in a terminal:
Go to File -> Preferences -> SSL Settings, and browse for the KeyStore to /home/dev/Sources/OSGP/Config/certificates/osgp-ca/certs/test-org.pfx
and fill out the password (the password is 1234)
Go to WSDL Settings and check 'Generate Example Values in New Requests' and 'Generate Comments with Type Information in New Requests'
There are several SoapUI project prepared, see /home/dev/Sources/OSGP/Config/soapui/
. Import all SoapUI projects present in the folder mentioned above. Below, 2 projects are shown as examples.
Import the 'admin' project by clicking File -> Import project. Browse to /home/dev/Sources/OSGP/Config/soapui/
, select 'admin-soapui-project.xml' and click open.
Alternatively you can create the 'admin' project yourself by following the steps below:
Create a new SOAP Project and call it 'admin'
Open the Project View by double-clicking on the 'admin' project. Go to 'WS-Security Configurations' and select the 'Keystores' Tab. Click on the '+' to add the test-org.pfx
in /home/dev/Sources/OSGP/Config/certificates/osgp-ca/certs/
Fill out the password (1234) and click Ok and close the Project View window.
Right click the 'admin' project and choose 'Add WSDL'. Enter the following URL in the WSDL Location field:
Make sure the box 'Create sample requests for all operations' is checked, and click OK.
Import the 'public-lighting' project by clicking File -> Import project. Browse to /home/dev/Sources/OSGP/Config/soapui/
, select 'public-lighting-soapui-project.xml' and click open.
Alternatively you can create the 'public-lighting' project yourself by following the steps below:
Open the Project View by double-clicking on the 'public-lighting' project. Go to 'WS-Security Configurations' and select the 'Keystores' Tab. Click on the '+' to add the test-org.pfx
in /home/dev/Sources/OSGP/Config/certificates/osgp-ca/certs/
Right click the 'public-lighting' project and choose 'Add WSDL'. Enter the following URL in the WSDL Location field:
Before sending the request, the test-org.pfx should be added as SSL Keystore: Go to the properties interface for the request (bottom left of the screen, after selecting 'Request 1' under UpdateKey in the 'admin' project'), and choose test-org.pfx
from the drop-down box.
This has to be done for each request!
An SSLD needs to be added to the platform, as well as a manufacturer and a public key for the SSLD. A couple of steps need to be performed to realize this.
1 Add manufacturer 2 Add device model 3 Add SSLD 4 Setup a protocol for the SSLD to use 5 Set the public key for the SSLD (in case of OSLP)
The AddManufacturer function adds a new manufacturer to OSGP. All devices are coupled to a manufacturer.
The AddDeviceModel function adds a new device model to OSGP. All devices are coupled to a device model.
The AddDevice function adds a new SSLD to OSGP. The device is coupled to a device model and a manufacturer.
The function UpdateDeviceProtocol sets a protocol for a device.
The UpdateKey function of the admin webservice sets a public key for a device. Double click 'Request 1' under UpdateKey in the 'admin' project. Add the following request:
In order to be able to use the SSLD-000-00-01 Device, the device needs to be simulated in the Device Simulator. To do this we have to create it. In the Firefox Browser, open the Device Simulator by going to the following URL:
Fill out the fields like this:
Device Identification: SSLD_000-00-01
IP Address: 127.0.0.1
Device Type: SSLD
Protocol: OSLP ELSTER
Now that the Device is known in the platform, and simulated in the Device-Simulator, the device can be used. Let's switch on the Light. Using SoapUI, click on Request 1 under SetLight at the public-lighting project. Set the following parameters in the request (And do not forget to set the Keystore in the request properties):
The last request concerns the response from the previous SetLight request. In SoapUi open Request 1 under 'GetSetLightResponse' in the 'public-lighting' project. Set the following parameters in the request (And the keystore in the request properties). Make sure to replace the CorrelationUid with the value from the respons from the SetLight request.
Do not forget to set the CorrelationUid to value in the response you received from the setLight request.
The server replied Ok, indicicating that the SetLight request has been processed succesfully.
This step also concludes the installation manual.
This chapter will describe the steps needed to test the Open Smart Grid Platform using the Web Demo Application.
If you followed the steps from the 'Platform Setup' then you can skip the following installation steps, because the Web Demo will already be available.
Open Eclipse and import the following folder as Maven project /home/dev/Sources/OSGP/open-smart-grid-platform/public-lighting-demo-app/
Add the PublicLightingDemoApp components to the Tomcat Server.
(Re)Start the Tomcat Server.
To access the Demo App go to the following URL: https://localhost/web-demo-app/
If you encounter an Untrusted Connection page, go to 'I Understand the Risks' -> Add Exception.. -> Confirm Security Exception
Click the Add a Device button in the Menu bar, and enter SSLD_000-00-01
at the Device Identification field and press Submit.
The following screen will appear, it shows that the device has been successfully added to the Platform.
In order to be able to use the SSLD-000-00-01 Device, the device needs to be simulated in the Device Simulator. To do this we have to create it. In the Firefox Browser, open the Device Simulator by going to the following URL:
Fill out the fields like this:
Device Identification: SSLD_000-00-01
IP Address: 127.0.0.1
Device Type: SSLD
Protocol: OSLP_ELSTER
You should return to the Devices screen and see the message "Device with identification SSLD_000-00-01 was created."
Then click the 'Confirm Registration' button. The message should read: "Device with identification SSLD_000-00-01 was confirmed to be registered."
Now that the Device is known in the platform, and simulated in the Device-Simulator, the device can be used. Let's switch on the Light. Go to the Demo App and press the List button in the Menu. A list should appear, showing the device that has just been added using the Add Device button.
Click on the Manage button to access the Device Details.
Switch on the Light by setting the Light Value to 100 and by checking the 'LightOn' checkbox (as shown in the screenshot below)
Hit submit to submit the request to the Platform. The following screen should appear:
In the home screen of the OSLP device simulator, the lightbulb should light up for SSLD_000-00-01. This means that the request succeeded.
This step also concludes the installation manual.
Create another new SOAP Project and call it 'public-lighting'
Fill out the password (1234) and click Ok and close the Project View window.
Make sure the box 'Create sample requests for all operations' is checked, and click OK.
Click the 'play' button to submit the request to the endpoint. You should receive similar response as shown in the screenshot below:
After the SSLD has been added, let's see if the function FindAllDevices shows the SSLD. Continue with the FindAllDevices request from the public-lighting project. Since this is not the same project, we have to change the endpoint; in this case in . Do not forget to set the SSL keystore in the Request Properties. Use the following parameters in the request:
After the request has been submitted, the response should include the SSLD device with ID SSLD_000_00_01
If you encounter an Untrusted Connection page, go to 'I Understand the Risks' -> Add Exception.. -> Confirm Security Exception
Click Add Device
Click Create Device
You should return to the Devices screen and see the message "Device with identification SSLD_000-00-01 was created."
Now click on the newly created device and click the 'Register Device' button. After a while the message "Device identification with identification SSLD_000-00-01 was registered at XXXXXXXX" appears.
Then click the 'Confirm Registration' button. The message should read: "Device with identification SSLD_000-00-01 was confirmed to be registered."
Submit the request. Take note of the CorrelationUid in the response. You can use this Id in another request to ask the server for the status of this request.
In the home screen of the OSLP device simulator, the lightbulb should light up for SSLD_000-00-01. This means that the request succeeded.
Click Add Device
Click Create Device
Now click on the newly created device and click the 'Register Device' button. After a while the message "Device identification with identification SSLD_000-00-01 was registered at XXXXXXXX" appears.
We have prepared a full set of configuration (properties files, certificates, key store, ...) which is available in our Config repository. This configuration can be used to setup a trial environment.
Soap Requests in GXF have fields for an User name and an Application name in the Header. These are only used for logging and auditing. There are no restrictions (e.g. Authorizations) with regard to these fields. However, it is recommended to use names for Logging and Auditing purposes.
In order to add a device to the platform, call the add device method in the device installation web service (for a specific domain) for each device.
Each device type may require its own set of attributes, security settings, etc. Each device type may have its own registration mechanism.
To add a DLMS Device to the Platform, take a look at the documentation of the Soap call AddDevice as defined in the SmartMeteringInstallation.wsdl.
To add an OSLP Device to the Platform, the Soap call defined in CoreDeviceInstallation can be used, or the UpdateKey Request.
Please take a look at the chapter Testing the open smart grid platform in the installation manual for a detailed guide of how to add a OSLP device to the platform.
In the Domain Chapter of the documentation more information of the Web Service calls can be found for Adding devices, setting configuration, authorizations, schedules, firmware updates, etc.
This chapter describes how to add a new Organisation to the platform. This includes creating a certificate for the new organisation.
In SoapUi go to DeviceManagement under the Admin project. Click on request 1 under CreateOrganisation. Fill in the parameters like the example request below. Make sure to sign the request with the test-org.pfx and to use the test-org organisation in the request header.
This request creates a new organisation called "my-org":
To use this new organisation to control the SSLD_000-00-01 device, the authorisations need to be updated. To do that the UpdateDeviceAuthorisations request will be used, it can be found under DeviceManagement in the admin project.
Fill in the parameters like shown below. The functionGroup will be set to AdHoc to authorise the 'my-org' organisation for the AdHoc functions.
Make sure to use the test-org as OrganisationIdentification in the request header, and to sign the request with the test-org.pfx.
Now that the 'my-org' organisation is authorised to use the SSLD_000-00-01 device, it is time to create a certificate for the my-org organisation. This certificate will be used to sign the requests.
Open a terminal and navigate to /home/dev/Sources/OSGP/Config/certificates/
A script has been created to create the certificates, execute it by running the following command in the terminal:
You should receive similar output as shown in the screenshot below.
Now that the certificate has been created, restart the tomcat server.
When the tomcat server is up and running again, go to SoapUi and add the new certificate to the public-lighting project: double-click on the project, go to the WS-Security Configurations tab and select the keystores tab. Click the '+' button and browse to the my-org.pfx certificate which can be found in /home/dev/Sources/OSGP/Config/certificates/osgp-ca/certs/
Now double-click on 'Request 1' in SetLight in PublicLightingAdHocManagement in the public-lighting project. Set the SSL Keystore to 'my-org.pfx' in the request properties so the request gets signed with the new certificate. Change the request parameters as shown in the example below:
Note the OrganisationIdentification is now set to 'my-org'. Send the new request, you should receive the following response:
Check the device-simulator to see if the dimValue of the SSLD_000-00-01 changed to 50.
You now have successfully created a new organisation, along with a certificate to sign the requests, and changed the device authorisations of the device to accept commands from the new organisation.
The main config is enabling the throttling client in your application
The throttling client needs to know where to find the throttling service and tell the service what threshold to use. This is configured using the following settings:
Multiple clients can use the same configuration by using the same throttling.configuration.name
. Throttling will be globally handled across those clients. Make sure all clients that use the same name also use the same throttling.configuration.max.concurrency
. The last client to register a configuration will determine the max concurrency (overwriting previous registrations).
The throttling service itself should be deployed only once, it is not suited for load balanced deployment.
All the features of the open smart grid platform are accessible by it's webservices, as defined in the WSDL files. To use these services to communicate with devices through the platform, please keep in mind the following things.
A Soap request will have to be generated from your Application.
In the WSDL and xsd files of the Platform the Requests and it's objects are defined.
Fill in the parameters once you have an empty soap request for a certain function. The restrictions/requirements are defined in the WSDL files.
The request should have a header where an ApplicationName, UserName and OrganisationId are defined. At the moment User and App name are not used in the Platform (Except for audability and logging). The OrganisationId, however, must match a known organisation within the Platform. This organisation must have the right authortities to make a certain request.
Furthermore, the Request must be signed with a certificate from the Organization with the OrganisationId in the header.
The requests use the Secure HTTP protocol (https).
For Asynchronious requests, the Platform will respond with a correlationId after succesfully making the request. Use this correlationId in the matching Response-Request to obtain the response from the device.
To learn more about the open smart grid platform's webservices, please take a look at the or for hands-on experience with the Platform's webservices follow the .
It is not possible to communicate with the Platform directly using REST webservices. As mentioned above, the open smart grid platform uses SOAP (For reasons defined ). If you want to use REST for your front end, you can write an Integration Layer that serves as a Soap Client and exposes the Soap calls through Rest web services that you can access from your front end.
When using the SOAP Web service, there are 2 flows that can occur:
some calls are synchronous: a response is returned immediately;
other calls are a-synchronous: an initial response contains a correlation id, which can be used to obtain the actual response.
We invite everyone to participate in the development of the open smart grid platform. There are multiple ways to support the project.
submit issues about bugs or requested features
solve issues
develop new features
write or improve the documentation
This chapter contains all the non-technical and general technical knowledge for developers to start contributing.
How to start everything up? Make sure that PostgreSQL is running. Make sure that Apache HTTPD web server and Apache ActiveMQ are running. Then start Apache Tomcat application server as described in the installation manual.
Where are the log files? The Apache Tomcat application server logs can be found in /var/log/tomcat
. The Apache HTTPD web server logs can be found in /var/log/httpd. The PostgreSQL log files can be found in /var/lib/pgsql/9.3/data/pg_log
. The platform log files can be found in /var/log/osp/logs/
.
Help: SELinux is preventing < something >? Make sure to set SELinux to 'permissive' mode. Then try again and it should work as SELinux will no longer enforce the current policy. Later, one can use the SELinux tools to create a proper policy that allows everything that was prevented before.
How to add or update a component? Make sure to place the properties file(s) for the component in /etc/osp
. Add the locations of the properties file(s) to Apache Tomcat context.xml file. Add the war file to /usr/share/tomcat/webapps
. Restart Apache Tomcat.
How to configure a component? Most (if not all) components of the open smart grid platform are de-coupled using queues. Configure the broker URL in the properties file and take notice of the queues that a component uses/needs. Make sure to double check the connectionstring for PostgreSQL.
How to configure URL's for a component? In this case the Apache HTTPD vhost needs to be updated. The vhost config file can be found in /etc/httpd/conf.d. We use redirects from HTTP to HTTPS and AJP proxy to send the requests to Apache Tomcat.
How to check up on Apache ActiveMQ? Apache ActiveMQ offers a web interface (the default port is 8161, default credentials: admin/admin). Using the web interface one can check the queues and especially the dead letter queue (DLQ).
How do I obtain a public key for a device? Public Keys are usually manufacterer supplied for Smart Metering. For the Open Source part you can use the OSLP device simulator. In Sources/OSGP/Config/certificates/oslp/
you can find instructions for generating a OSLP device public key, and a folder with 5 pre-generated keys for test devices.
My code gives a lot of errors in Eclipse after importing Try the following things: run mvn clean install
in the open-smart-grid-platform directory. Right-click on a project in Eclipse and select 'Maven -> Update project..', select all projects and update.
The Vagrant script fails If you are receiving errors while downloading the ubuntu iso, sources, etc. or if the puppet script does not start; try running the Vagrant script again by typing vagrant destroy && vagrant up
in the directory with the vagrant file.
I want to update my code from Github If you want to update your code, just run git pull
in the repository you want to update. You can also create a fresh Virtual Machine using the vagrant installation, this procedure makes sure you have the most recent code.
Is a user required to consume platform services? No, an organization is required.
_If your question is not in this list, please create an [issue on Github in the documentation repository ]documentation repository
Hosting the open smart grid platform in the cloud is possible, as well as on premises.
If you like to setup an active-active installation over multiple datacenters. Make sure that the open smart grid platform database runs redundant over both datacenters (master-slave configuration).
There's not much maintenance that needs to be performed. Archiving some old log files, checking up on available disk space and creating a backup of the databases. Looking into the queues to see if there are no messages in the dead letter queue.
This is a guide to start contributing to the open smart grid platform project:
Make yourself comfortable with the open smart grid platform by e.g. installing it.
Read the documentation to get an idea of how the software works (architecture chapter), how the community works (this chapter).
Find an open issue to work on or fire an new issue.
Assign yourself to the issue and start contributing.
Start contributing by using the procedures mentioned in this chapter.
Thank you for contributing to the Open Smart Grid Platform. Please keep the following in mind before submitting code.
Before code is merged it needs to comply with a number of guidelines: 1. Code should be as complete as possible (preferably no placeholders, TODO's or FIXME's) 2. Right formatting; code should follow the Coding Conventions (see 3.1.2) 3. Fixed/added unit tests where applicable 4. Javadocs added where applicable 5. Accepting pull-requests with SonarQube reports "Blocker" and "Critical" are not allowed 6. Comply with International open standards where possible (e.g. IEC standards)
We ask each of our contributors to sign our contributor license agreement (CLA). This has advantages for both parties, it gives you the assurance that your contribution will remain available under the Apache 2.0 license. Meanwhile, you give your code in license to us, so we can add your code to the open smart grid platform. And we know your contribution is entirely your work, so we don't get in trouble with legal issues. Please read the CLA text carefully.
To submit changes to the open smart grid platform branches: 1. Create a fork of the open smart grid platform repo you will be working in 2. Make and commit your changes to your fork 3. Create a pull request to merge the changes into the right branch (see 4.1.4 for the branching strategy) If the changes fix a bug, mention the issue number in the commit message or pull request message (example: fixes 101, solved 87). If no ticket exists, create one beforehand. Afterwards, please update the relevant documentation in this GitBook.
The open smart grid platform's main branch is master. All major releases are tagged in this branch. Development is done in the development and feature branches. We use the GitFlow branching strategy. Find more information on this strategy here: GitFlow
The GitFlow workflow is someone complicated, but it has the advantage that it gives a clear overview of all previous releases and current development and thus helps to collaborate more efficiently. Please follow this strategy in your commits.
Anyone can send in a pull request. Assign a maintainer or other developer with knowledge on this topic to accept/evaluate your pull request. You can view the SonarCube test results at (http://ci.opensmartgridplatform.org/sonarqube/) and the Jenkins continuous integration results at (http://ci.opensmartgridplatform.org)
If your code is a useful contribution and meets our quality standards (see section 3.1), it will be added to the open smart grid platform! Developers are in charge of judging this. Don't forget to update the documentation as well.
The technology and tools used can be found in the Technology stack section.
To prevent formatting issues caused by using different IDEs, the formatting style for the code is based on Google Java Format with some extra additions based on the Eclipse based conventions that were already in use.
Check the explanation of the general ideas as well as the instructions how to configure your idea to be able to format according to the conventions (available for Eclipse and IntelliJ).
Follow GitFlow approach for branching
Write behaviour driven tests using Cucumber and Gherkin, see the Integration-Tests
In case you are not familiar with behaviour driven tests, include unit tests
Fix SonarQube issues
Issue pull request (preferable to development branch)
All changes pushed to GitHub are built by our build server. Pull requests to master branch or development branch are also built. SonarQube performs static code analysis to help improve the quality level of the code base.
Jenkins buildserver: An open source continuous integration tool written in Java.
SonarQube: SonarQube is an open platform to manage code quality.
This project is engineered, built and tested using Domain Driven Design and Behaviour Driven Tests.
Use the Frameworks, don't roll your own
Single class, single responsibility
Value objects are immutable
Map generated objects to value objects or entities
Transferring an object means using a DTO
Use base classes for common logic
Interfaces are good, but 'impl' is bad
Extend classes, don't expand classes
Migrate databases using Flyway
JMS for messaging
Extend the authorization logic if needed, don't bypass it
Log errors/exceptions
Add meaningful comments to the code
Follow the code guidelines
The web service adapters use Spring Web Service, contract first. JAXB is used to generate Java classes from the XSD's. All SOAP operations are bound to an endpoint. The incoming SOAP requests are authenticated by organization identification (plus certificates). Organization authorizations are checked for the desired operation. If the request is OK, a JMS message is sent to a domain adapter component.
Domain adapters contain business logic and persistence. Domain adapters process and forward the JMS message to the Core component.
Domain components contain entities and value objects.
The Core component routes messages from domain adapter components to protocol adapter components and vice versa. Furthermore, it offers read-only database access for protocol adapter components.
Protocol Adapter components translate a message from domain adapter components into a protocol message for a smart device. Protocol Adapter components send the protocol message to a smart device using a network connection. The response from the smart device is translated into a domain response message which will be sent to the Core components (which will route it to the domain adapter which issued the request).
For the OSLP implementation, two components are used. The first component is the protocol adapter for the protocol. It can translate message into the protocol message for SSLD's. Second there's the signing-server component. It is responsible for signing the protocol message using the private key of the platform. The components communicate using a key-pair. The signing-server can handle multiple protocol adapter instances by utilizing a reply-to queue per protocol adapter instance. Since the protocol adapter component needs to be reachable from a network, it is a requirement that the private key may not be used by the protocol adapter directly. The signing server component can be deployed in such a way that no network access is available to this component, as the only coupling needed are the queues / the message broker.
If a full installation is desired, have a look at our Installation Guide.
In order to add a new domain to OSGP, you can benefit from the information in the Create New Domain Guide.
This documentation is available in multiple formats.
Web
Click on Export as PDF on right side of gitbook Development branch publication
The documentation is build using GitBook software from Markdown files in the documentation repository.
We encourage you to participate in improving the documentation. From corrected typos to new sections, every commit is appreciated. You can access the source files by clicking the "Fix this page"-button in the GitBook or by selecting the relevant Markdown-file in the documentation. You can commit your changes by sending a pull request.
Fork the repo, do work in a feature branch.
Issue a pull request.
Make sure the automated test suite succeeds. They will show-up in the pull request.
Sign the CLA using EasyCLA.
Assign a maintainer or other developer on this topic to accept/evaluate your pull request. The current maintainer can be found in the governance paragraph.
Some information on GitBook and using Markdown can be found here, more elaborate information on GitHub-flavored Markdown is found here. If you like to upload illustration, you can use git or Github
If you are completely new to this and you need help to get started, file an issue in the documentation repository.
It may be obvious to you already from the index, however, here is an overview on what documentation goes in which chapter.
Chapter 1 consist of an open smart grid platform introduction and architecture for potential users, architects and developers. The open smart grid platform website is used for basic product information.
Chapter 2 contains the general userguide for open smart grid platform users
Chapter 3 contains community related topics
Chapter 4 contains information related to the open smart grid platform domains
Chapter 5 contains information related to the protocols and simulators
Chapter 6 shows the support options
Chapter 7 code and documentation license
We have chosen to work with GitBook since it allows us to make different versions of documentation for each release. This is done by branching the files in the documentation repository. The master branch is used for releases only. The development branch is our main and current branch. If you like to improve the documentation, start a feature branch with your changes and send a pull request to the development branch.
The master branch is only used by major open smart grid platform releases
Don't commit directly to the development branch, please do a pull request.
We use the American spelling
Please follow the used chapter and section numbering and apply it in your commits as well
Currently we do not use image numbering, since it is too much of a hassle to keep it up-to-date. If you have a smart idea to do this, let us know!
Give your (sub) document a relevant name or section with number
Update SUMMARY.md if needed
Inspiration on how to write good documentation can be found here: http://docs.writethedocs.org/.
If you want to get in touch to discuss non-technical subjects, send us an email to the LF energy GXF mailing list gxf@lists.lfenergy.org or open an .
If there is a need (or wish!) for a new feature, add it as issue to . Please provide a full description about the background of the problem.
A developer can take on the issue and start working on it on voluntary base. If you need this feature and you have the money to pay for it, you can hire a developer and have the developer work on it. If open smart grid platform core components are involved, please discuss your change first with one of the developers/maintainers.
The developer makes a description on how he wants to fix the problem. Other developers can discuss the solution as well. If everybody agrees on the solution direction, the developer codes the solution and submits it (by sending in a pull request). The developer should also document the feature in the
The maintainer can check the code (or assign this to someone else) and merge it with upstream releases.
Find out as much as possible about the bug before reporting it. Please check on GitHub/Jira whether the bug has already been reported. Also, look for logs, error messages etc. Please include as much information as possible background on the bug and submit the bug on Github or Jira.
The maintainer makes sure that somebody will look at the bug, check for duplicates and thank the contributor for sending in the bug. If the bug turns out to be a duplicate, the issue will be closed.
A developer will try to reproduce the bug and will look for the root cause. The developer adds his findings to the issue. If the developer cannot reproduce the bug, the developer will contact the user for more information or/and login into the user's system (when possible for the user/developer). If it's impossible to re-produce the bug, the issue will be closed.
Otherwise, the developer will write a patch and tests the fix.
Once the patch is accepted (see Code review/test process), it will be shipped with the next release.
The maintainer than closes the issue.
If you have a question, please create an Github issue in the .
Due to the sensible nature of security issues e.g. zero days, we prefer a responsible disclosure. Security issues can be reported to .
With the open smart grid platform we intend to have the right balance between a benevolent Dictator and a Formal Meritocracy in order to have a balanced decision-making process and to prevent unwanted dictators and everlasting discussions. The basic principle is that decisions are based on consensus. If this decision making process takes too long or a decision is required, the community council has the authority to make a decision. Grid eXchange Fabric complies with the LF Energy governance
The governance and rules should be respected.
The community council consists of 5 members and has the authority to make decisions on all community related subjects.
The community council is responsible for:
General ambitions, objectives and goals
Principles and understandings
Governance and consultation bodies
Guidelines and procedures and tool selection
Contribution (process) of individual members
Architectural and (development) infrastructure choices
Raise subjects/issues that are important for the direction/development of the community
When the community grows, members of the community council can be elected. If the situation demands or requires it, the community council has the ability to establish sub councils for a specific subject, area of domain.
The community council consist of the following members:
Robert Tusveld - Lead Architect - Chairman
Maarten Mulder - Product owner GXF & LF Energy TAC member for GXF
Paul Houtman - Lead Architect
Kevin Smeets - Maintainer
Jonas van den Bogaard - OSPO team member & LF Energy TAC member for Alliander
If you would like to join the community council, please contact us! Mention @OSGP/communitycouncil in an github issue. The (online) community council meetings will happen when needed.
Maintainers are responsible for maintaining parts of the code-base. Maintainers have the following responsibilities
Coordinate development activity
Make sure code/documentation reviews are being done
Coordinate pull-requests
Coordinate bug follow-ups
Coordinate questions
In case of long discussions or arguments, maintainers or other can request a community council decision.
Current maintainers:
GXF Platform and smart lighting domain: Kevin Smeets
GXF Platform and Smart metering domain: Stefan Ermens
GXF Architecture & documentation: Robert Tusveld
Contributors include anyone in the technical community that contributes code, documentation, or other technical artifacts to the project.
Anyone can become a contributor. There is no expectation of commitment to the project, no specific skill requirements and no selection process. To become a contributor, a community member simply has to perform one or more actions that are beneficial to the project.
Like the technical community as a whole, the open smart grid platform community is made up of a mixture of professionals and volunteers from all over the world, working on every aspect of the mission - including mentor-ship, teaching, and connecting people.
Diversity is one of our huge strengths, but it can also lead to communication issues and unhappiness. To that end, we have a few ground rules that we ask people to adhere to. This code applies equally to founders, mentors and those seeking help and guidance.
This isn’t an exhaustive list of things that you can’t do. Rather, take it in the spirit in which it’s intended - a guide to make it easier to enrich all of us and the technical communities in which we participate.
This code of conduct applies to all spaces managed by the GXF project (a LF energy project). This includes IRC, the mailing lists, the issue tracker, DSF events, and any other forums created by the project team which the community uses for communication. In addition, violations of this code outside these spaces may affect a person's ability to participate within them.
If you believe someone is violating the code of conduct, we ask that you report it by emailing the mailing list gxf@lists.lfenergy.org.
We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.
Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the open smart grid platform community should be respectful when dealing with other members as well as with people outside the open smart grid platform community.
We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. This includes, but is not limited to:
Violent threats or language directed against another person.
Discriminatory jokes and language.
Posting sexually explicit or violent material.
Posting (or threatening to post) other people's personally identifying information ("doxing").
Personal insults, especially those using racist or sexist terms.
Unwelcome sexual attention.
Advocating for, or encouraging, any of the above behavior.
Repeated harassment of others. In general, if someone asks you to stop, then stop.
Disagreements, both social and technical, happen when people get passionate about what they are doing. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of open smart grid platform comes from its varied community, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.
This Code of Conduct is based on the Django Code of Conduct
Grid eXchange Fabric (GXF) is a project of LF Energy. LF Energy is part of the Linux foundation.
Chapter 4 Domain This chapter describes the separate domain in the open smart grid platform.
The web service adapters use Spring Web Service, contract first. JAXB is used to generate Java classes from the XSD's. All SOAP operations are bound to an endpoint. The incoming SOAP requests are authenticated by organization identification (plus certificates). Organization authorizations are checked for the desired operation. If the request is OK, a JMS message is sent to a domain adapter component.
Domain adapters contain business logic and persistence. Domain adapters process and forward the JMS message to the Core component.
Domain components contain entities and value objects.
This core and admin domain contains all generic web services that can be used in other domains. Most generic services relate to device management including powerful device authorization management
Operation
Request
Response
CoreDeviceInstallation.wsdl
AddDevice
DeviceIdentification
-
FindDevicesWhichHaveNoOwner
-
Devices
FindRecentDevices
-
Devices
StartDeviceTest
DeviceIdentification
-
StopDeviceTest
DeviceIdentification
-
UpdateDevice
DeviceIdentification
-
GetStatus
DeviceIdentification
Status
AdminDeviceManagement.wsdl / CoreDeviceManagement.wsdl
ChangeOrganisation
Organisation
-
CreateOrganisation
Organisation
-
FindAllOrganisations
-
Organisations
FindDeviceAuthorisations
DeviceIdentification
DeviceAuthorisations
FindDevices
PageSize, Page
Devices, Page
FindEvents
DeviceIdentification, From, Until, PageSize, Page
Events, Page
FindMessageLogs
DeviceIdentification, Page
MessageLogPage
RemoveDevice
DeviceIdentification
-
RemoveOrganisation
Organisation
SetEventNotifications
DeviceIdentification, EventNotifications
-
SetOwner
DeviceIdentification, OrganisationIdentification
-
UpdateDeviceAuthorisations
DeviceAuthorisations
-
ActivateOrganisation
Organisation
-
SetDeviceLifecycleStatus
DeviceIdentification, DeviceLifecycleStatus
-
CoreFirmwareManagement.wsdl
GetFirmwareVersion
DeviceIdentification
FirmwareVersion
UpdateFirmware
DeviceIdentification, FirmwareIdentification
-
CoreConfigurationManagement.wsdl
GetConfiguration
DeviceIdentification
Configuration
SetConfiguration
DeviceIdentification, Configuration
-
CoreAdHocManagement.wsdl
SetReboot
DeviceIdentification
-
Up-to-date information on use-cases can be found on the Grid eXchange Fabric website.
FlexOVL, a new and flexible switching system of public lighting delivers more control for municipalities and is the first solution which is powered by the Open Smart Grid Platform.
Technical drivers for Alliander
Replacing Ripple Control
Decrease future investments
Decrease outages
Customer drivers (Municipalities)
Be more in control, by controlling switching times themselves
Resolve power failures faster, through up-to-date information
Reduction in costs, through energy saving and more efficient maintenance and management
No vendor lock-in, not dependent on one supplier
Implementation/roll-out
Small scale roll-out started January 2015
200 Sub Stations will be fitted with an SSLD to control public lighting and tariff switching
15 municipalities in the Liander grid operator area will be participating
Goal is to allow municipalities to use the application, give feedback and to see if the services offered to municipalities are adequate
Large scale roll-out will start around 2016
The entire Liander grid operator area will use SSLD's to control all public lighting and tariff switching
About 25.000 Sub Stations (middenspanningsruimtes)
About 800.000 street lights will be switched by the SSLD's mounted in the 25.000 Sub Stations
FlexOVL web application (not open source available)
Municipalities are free to choose their own (web)application (using the web services of the Open Smart Grid Platform), or they could use the default web application developed by Alliander.
Functionality of the default web application as used by grid operator Liander (example)
Create switching schedules and assign those schedules to one or more SSLD's
Create groups of SSLD's in order to be able to assign schedules to many SSLD's at once
On demand switching of public lighting
Review current status of an SSLD in order to review public lighting and tariff switching states
Abilities to monitor power consumption of public lighting (available if the SSLD is fitted with an Electricity Meter)
Monthly report offering insight into switch moments and power consumption
The Open Smart Grid Platform act as an central component to monitor and control microgrids.
The goal of this domain is to control and monitor microgrids.
Currently, the following features are available within the Open Smart Grid Platform:
Get data is used to retrieve measurement and profile data from the device
Set data is used to set setpoints and profiles on the device
When either report data or the result for a request is available, a notification is sent to a client, after which the client will be able to obtain the data or result by sending an 'async' message.
When a device is connected it will periodically push measurement reports (and send trigger-based status reports) to OSGP. OSGP will inform the client via a notification, after which the data can be retrieved in a way similar to GetData (using the GetDataAsync message). In order to determine whether all report data are received, the response of a GetDataAsync message will (in case of a report) contain report metadata consisting of a report id, sequence number and time of entry.(XSD is already updated with report metadata, returning the report metadata from OSGP is not yet implemented)
GetData is a request to retrieve measurement and profile data from a device.
GetDataAsync is a request to retrieve the result of the GetData request or to retrieve report data pushed by the device.
SetData is a request to set setpoints and profiles on a device.
SetDataAsync is a request to retrieve the result of the SetData request.
Functionality like GetData can now be tested, with the Cucumber framework, using the protocol-simulator-iec61850. This simulator can be started from the Cucumber tests, and is configured with its own properties file.
By default the RTU device is configured with the servername: WAGO61850Server. This name also appears in the icd file, that is used by the RTU device. The name of this icd file, is configured in a properties file. Multiple server names are now supported, with the introduction of the new column: server_name in the iec61850_device table. If this value is null, the default servername (WAGO61850Server) is used, otherwise the servername from the database is used (eg 'WAGO123'). In that case another corresponding icd file, in which this servername is used, must be configured!
The goal of this domain is to control, monitor and manage (street) lights at scale. It allows streetlight owners to control/manage the (street) lights in an more intelligent way compared to ripple control technology.
This domain consist of Switching schedules, groups, light sensors, manual switching and monitoring of a typical public lighting use-case.
This covers the services for tariff switching domain using the open smart grid platform.
This domain allows tariff switching. It allows a relay to switch when a tariff changes. This domain could be used to replace ripple control tariff signals.
When configuring a device via the platform to switch relays according to a tariff schedule, the device can be instructed to switch the tariff relay normally ("TARIFF") or reversed ("TARIFF_REVERSED").
The devices themselves are unaware of the difference between TARIFF and TARIFF_REVERSED. When sending a setScheduleRequest message for a tariff schedule to the platform, the tariff switching domain adapter checks if the device relay(s) are configured with TARIFF_REVERSED. If so, the tariff switching domain adapter will invert the relay value for all tariff schedule entries before the tariff schedule is sent to the device.
When two devices have the same schedule, while one device is using TARIFF and the other TARIFF_REVERSED, the state of their tariff relays will always be the opposite of each other.
The values as shown in the table below will be returned, when getting the status from a device or from the platform.
Schedules for light switching can be set using from the .
For brevity the XML element and type names in the descriptions below will not include the namespace (which will typically be "http://www.opensmartgridplatform.org/schemas/publiclighting/schedulemanagement/2014/10"
).
A switching schedule is defined by a number of declarations of switching moments (also known as schedule entries).
The SetScheduleRequest
defines the schedule, where Schedules
of type Schedule
define the entries.
A complete schedule for a device as set with the Set Schedule request can have 1 up to 50 entries.
Each schedule entry defines a moment on a day when certain relays on a device are switched on or off.
Whether or not a switch action defined in a schedule entry is executed may not only depend on the entry itself. Other switch moments from the schedule that are compared to an entry may cause switching to be skipped.
A more detailed description of the components defining a schedule entry is in the sections below:
explicitly configured
time of
time of
The value of WeekDay
is used to indicate on which days the schedule entry may trigger switch actions.
Each schedule entry can cause switching at a single time during the day. There are a number of ways in which this time can be specified, starting with ActionTime
.
For ActionTime
values SUNRISE
or SUNSET
the value of TriggerType
specifies what the actual switching time should be.
hh:mm
;
hh:mm:ss
;
hh:mm:ss.SSS
With hh
from 00
to 23
, mm
from 00
to 59
, ss
from 00
to 59
and SSS
from 000
to 999
.
Some protocols may accept more precise time formats than they support. The IEC61850 implementation for instance, will silently apply only the hours and minutes from any of the formats listed above.
For ActionTime
SUNRISE
or SUNSET
with TriggerType
ASTRONOMICAL
the astronomical sunrise or sunset time (as calculated by the switching device, based on its longitude and latitude) will be used to determine the switching moment.
If an astronomical offset is configured, it has to be added to the calculated astronomical time to determine the time to be used as the switching moment. For positive offset values, the astronomical time for the switching moment will be the configured amount of minutes after the calculated astronomical sunrise or sunset time, while for negative values the astronomical time used will be the number of minutes before the calculated astronomical sunrise or sunset time.
####Astronomical Sunrise Offset
The astronomical sunrise offset is applied with entries with ActionTime
SUNRISE
and TriggerType
ASTRONOMICAL
.
The following picture is an example of switching off at 07:30; the calculated astronomical sunrise (say at 07:15 for the day shown) plus 15 minutes (configured as AstronomicalSunriseOffset
15
).
####Astronomical Sunset Offset
The TriggerWindow
with its minutesBefore
and minutesAfter
defines a window of time around an astronomical sunrise or sunset time with sensor.
Switching will occur at the start of the window when light sensor input is received before the window.
Switching will occur at the end of the window when light sensor input is not received before the end of the window.
Switching will occur at the time light sensor input is received, when this input is received within the window.
Light sensor input in the conditions above means the sensor trigger for light
when the schedule entry is switching off, and the sensor trigger for dark
when switching on.
The following picture is an example where the light sensor reports dark
within the trigger window for a schedule entry for astronomical time with sensor signal. Switching on occurs at the time the sensor input is received. Note that for this example this could have been at any time between 19:45 and 20:30 (15 minutes before to 30 minutes after the astronomical sunset, calculated to occur at 20:00 on the day shown).
The following picture is an example where the device has received a light sensor report before the trigger window opens for a schedule entry for astronomical time with sensor signal. Switching off occurs at the start of the trigger window.
The following picture is an example where the device has not received a light sensor report before the trigger window closes for a schedule entry for astronomical time with sensor signal. Switching on occurs at the end of the trigger window.
For certain types of lighting it may be undesirable to switch the lights on only for a short period of time, after which they are switched off again. In such a case the action of switching the lights on will be suppressed if minimumLightsOn
is set with a positive number of seconds, and the action switching the lights off again is expected within this time period.
The minimal burning time is always regarded with respect to an actual time for a switching moment that switches a relay on in comparison with the expected time of the next switching moment where the same relay will be switched off again.
Switching on will be skipped if switching off is expected to occur within a number of minutes set as minimumLightsOn
with the schedule entry that switches the relay on.
Each schedule entry may include 1 to 6 LightValue
elements. These light values determine the relay to switch, whether the relay should be switched on or off, and whether the lights with a relay should be dimmed (and by how much).
Index
: 0
for all light switching relays in the device, or 1
to 6
for numbered relays (the
index should indicate an existing relay that is used for light switching).
On
: true
if this entry is for switching on the relay(s) identified by Index
; false
for
switching off.
DimValue
: optional percentage set as number 1
to 100
indicating a dim value; will be ignored
when the protocol or switching device does not support dimming.
Here are some examples of patterns that are common with light schedules. The patterns are formed by combinations of schedule entries that switch on or off lights controlled by a certain relay on the switching device.
All night lights is a name for lights that are turned on around sunset and keep burning all night until they are switched off again around sunrise. The all night lights are switched by a pair of schedule entries:
Morning lights is a name used for lights that are switched on a short period in the morning hours of a day to illuminate a period before or around the morning twilight. The morning lights are switched by a pair of schedule entries:
During the summer in the Netherlands for example sunrise can be as early as approximately 05:15, while during the winter the sun may rise even a little later than 08:45. For this example we will assume configuration for the morning lights to switch on at fixed time of say 06:00. This is a time after the earliest sunrise in the year, but well before the latest sunrise in the year. To complete the morning lights configuration, a second switching moment is configured to switch the lights off at sunrise. With this set up the lights will be switched off after having been on for almost three hours at some time in the winter (for instance from 06:00 to 08:45). During summer at some days the lights will not be switched off in the morning at all because they were turned on (at 06:00) after sunrise (switching off at any time before 06:00, for instance at 05:30).
Whether the lights stay on all day in the summer or not is something to be looked into. A switching device may have logic to deal with this situation figuring out the switch off belongs with the later switching moment to turn the lights on, and decide not to switch on. If not, some validation may be needed to enforce such schedules not to be configured.
The evening lights are switched by a pair of schedule entries:
The GXF Public Lighting Schedule Management web service does not do much validation, other than checking authorizations for the device identified by the DeviceIdentification
from the SetScheduleRequest
and whether the request conforms to its XML schema definitions.
If for certain applications more constraints are desirable, it is left up to those applications to make sure the requests made to the platform conform to those additional constraints. Examples of such constraints, that are not enforced by GXF, could be:
no duplicated schedule entries;
no schedule entries canceling the switch actions of other entries within some time window;
schedule entries may be required for all days of the week;
switching on and off might be required to happen each day in equal number of times and alternately;
checking expected actions around daylight saving change;
checking expected switching actions for days with the longest or shortest number of hours of daylight;
light value indexes map to existing light relays on the device the schedule is set on;
constraints from applying the provided input with specific devices or protocols.
For ActionTime
ABSOLUTETIME
a fixed time can be set for the switching moment as Time
.
The Time
value needs to be formatted in a way the can handle. For the currently listed implementations, you should be fine when you use a format from:
The astronomical sunset offset is similar to the , except that it is applied with entries with ActionTime
SUNSET
and TriggerType
ASTRONOMICAL
.
For ActionTime
SUNRISE
or SUNSET
with TriggerType
LIGHT_TRIGGER
the calculated astronomical sunrise or sunset time will be used as a reference time with a trigger window to determine the switching moment.
The astronomical time itself is calculated in the same way as with (without light sensor input).
Switching happens within a configured around the astronomical time, at a moment that is influenced by a signal from a light sensor.
This example shows the minimal burning time preventing the to be switched on at a fixed time because switching off at the calculated time of astronomical sunrise (with offset) would happen before passing of the minimum number of minutes the lights should be kept on.
This example shows the minimal burning time preventing the to be switched on at a fixed time because switching off at the start of the trigger window around the calculated time of astronomical sunrise would happen before passing of the minimum number of minutes the lights should be kept on.
one entry switching on at with
or .
another entry switching off again based on with
or .
one entry switching on at a ;
another entry switching off again based on with
or .
Depending on the location of the device the time of sunrise may vary quite a bit throughout the year. Because of this it is possible that what for some period would be a very reasonable schedule, is a questionable schedule (possibly to be considered ) in another season.
Evening lights is a name used for lights that are switched on a short period in the evening hours of a day to illuminate a period after or around dusk. This is similar to the , but in the evening instead of the morning, and the fixed time moment comes (normally) after the switch action around sunset.
one entry switching on at with
or .
another entry switching off again based on ;
Depending on the location of the device the time of sunset may vary quite a bit throughout the year. Because of this it is possible that what for some period would be a very reasonable schedule, is a questionable schedule (possibly to be considered ) in another season. See the for a graphical example.
A combination of and can be configured for a relay if the lights may be turned off for a period in the late night and early morning, as opposed to the that keep on burning all through the night.
Operation
Request
Response
PublicLightingAdHocManagement.wsdl
SetTransition
DeviceIdentification, TransitionType, Time
-
FindAllDevices
Page
DevicePage
GetStatus
DeviceIdentification
LightValues, PreferredLinkType, ActualLinkType, LightType, EventNotifications
ResumeSchedule
DeviceIdentification, Index, IsImmediate
-
SetLight
DeviceIdentification, LightValue
-
PublicLightingScheduleManagement.wsdl
SetSchedule
DeviceIdentification, Schedules, Page
-
Type | State | Relay powered | Returned by Device | Returned by Platform |
TARIFF | LOW | yes | on = true | High = false |
HIGH | no | on = false | High = true |
TARIFF_REVERSED | LOW | no | on = false | High = false |
HIGH | yes | on = true | High = true |
Operation | Request | Response |
TariffSwitchingAdHocManagement.wsdl |
GetDevices |
GetStatus | DeviceIdentification | Status |
TariffSwitchingScheduleManagement.wsdl |
SetSchedule | DeviceIdentification, Schedules, Page | - |
| May trigger a switch action on |
| Mondays |
| Tuesdays |
| Wednesdays |
| Thursdays |
| Fridays |
| Saturdays |
| Sundays |
| weekdays (Monday to Friday) |
| weekend days (Saturday or Sunday) |
| the day specified in |
| any day |
The Open Smart Grid Platform can also be used in the monitoring of a variety of components in substations; RTUs, switches, transformers, etc. Often, an RTU or Remote Terminal Unit is used as a central information hub in a substation. The RTU is connected to one or more sensors or devices that can measure any kind of information. Usually, the focus is on measuring power quality values, temperature and other 'health' variables, but any kind of measurable data can be read through OSGP.
The goal of this domain is to control and monitor substations; the current focus is on health status information and power quality data, but this may be extended in the future.
Currently, the following features are available within the Open Smart Grid Platform using the IEC 61850 protocol;
Get PQ Values retrieves the actual, current PQ values from a device. Examples of PQ values are Current, Voltage, Reactive Power, Active Power, etc. These examples merely serve as an indication of what is possible; OSGP does not impose any restriction on the number or content of variables that can be read. The outline of what should be measured is configured on the device and in the application that reads the data.
Retrieves the current health status of a device. This is useful in a monitoring application.
Retrieves the device model or metadata of a device. This includes the variables that can be measured, the information structure of the device, etc.
When either report data or the result for a request is available, a notification is sent to a client, after which the client will be able to obtain the data or result by sending an 'async' message. A notification message always contains the correlation ID of the original request; the client can retrieve the result using this correlation ID.
GetPQValues is a request to retrieve PQ values from a device.
GetPQValuesAsync is a request to retrieve the result of the GetPQValues request or to retrieve report data pushed by the device.
GetHealthStatus is a request to retrieve the health status of a device.
GetHealthStatusAsync is a request to retrieve the result of a GetHealthStatus request.
GetDeviceModel is a request to retrieve the device model from a device
GetDeviceModelAsync is a request to retrieve the result of a GetDeviceModel request.
| Description |
|
| switching at sunrise at the location of the device |
| switching at sunset at the location of the device |
| Description |
|
|
By adding an element BypassRetry in namespace with a value true or false, you can bypass retry when request to the device fail.
a is set for the switching moment in Time
determines the actual switching time
the for sunrise or sunset is the switching time
By adding an element ScheduleTime in namespace http://www.opensmartgridplatform.org/schemas/common/2014/10 with a xsd:dateTime value can schedule a message.
By adding an element MessagePriority in namespace http://www.opensmartgridplatform.org/schemas/common/2014/10 with a value from 0 - 9 you can give a message a lower or higher priority.
This chapter describes the SmartMetering domain including the web services. Currently the web services of the beta version are described, since the web services have not yet officially been released. Information on the DLMS device simulator can be found in the DLMS protocol section
The goal of this domain is to read and manage millions of smart meters. This includes smart meter installation, firmware updates, smart meter removal, read smart meter values, time synchronisation, etc. Everything that is needed to professionally manage millions of smart meters is or can be included in this domain.
Currently, the following Smart Metering features are available within the open smart grid platform:
Add smart meter to the platform, so the device is known and additional actions can be performed for the device
Process shipment file, which adds several smart meters to the platform along with all needed information
Synchronize time between smart meters and head-end system, in case the smart meter adjusts its time, some events will be logged
Retrieve events from the smart meter, several event logs are available
Retrieve periodic meter reads from the smart meter
bypass retry operations can be given the flag 'bypass retry'. Which means that an operation will not be retried in case of an error.
priority operations can be given a priority from 0 to 9, default is 4. Higher values causes messages to be processed faster.
scheduling operations can be scheduled for a certain time.
SynchronizeTime is an operation to synchronize the date and time on a device. The date and time are retrieved from the server and sent to the device.
GetSynchronizeTimeResponse is an operation which returns the response from the SynchronizeTime operation.
RetrieveAllAttributeValues is an operation to obtain all the attributes of the whole tree of objects from an E-meter.
GetRetrieveAllAttributeValuesResponse is an operation which returns the response from the RetrieveAllAttributeValues operation.
GetSpecificAttributeValue is an operation to obtain a specific attribute value from an ObisCode from an E-meter.
GetSpecificAttributeValueResponse is an operation which returns the response from the GetSpecificAttributeValue operation.
GetAssociationLnObjects is an operation to get the associated ln objects.
GetGetAssociationLnObjectsResponse is an operation which gets the response from the GetAssociationLnObjects operation.
ScanMbusChannels is an operation to get the M-Bus Short ID attribute values for all four channels from an E-meter.
ScanMbusChannelsResponse is an operation which returns the response from the ScanMbusChannels operation.
SetSpecialDays is an operation to set a dayId profile and its tariffs for a specific date on a device.
GetSetSpecialDaysResponse is an operation which returns the response from the SetSpecialDays operation.
SetConfigurationObject is an operation to set ConfigurationObject settings on a device to specify behaviour and connection options.
GetSetConfigurationObjectResponse is an operation which returns the response from the SetConfigurationObject operation.
GetConfigurationObject is an operation to retrieve a ConfigurationObject from a device.
GetConfigurationObjectResponse is an operation which returns the response, a ConfigurationObject, from the GetConfigurationObject operation.
SetPushSetupAlarm is an operation that pushes received alarm messages to OSGP.
GetSetPushSetupAlarmResponse is an operation which returns the response from the SetPushSetupAlarm operation.
SetPushSetupSms is an operation to set an endpoint in a device which tells the device where to connect to when it is waked up.
GetSetPushSetupSmsResponse is an operation which returns the response from the SetPushSetupSms operation.
SetAlarmNotifications is an operation to set the types of alarm notifications that must be notified from the device when they occur.
GetSetAlarmNotificationsResponse is an operation which returns the response from the SetAlarmNotifications operation.
SetKeyOnGMeter is an operation to transfer and set a G-meter key on a device.
GetSetKeyOnGMeterResponse is an operation which returns the response from the SetKeyOnGMeterRequest operation.
SetMbusUserKeyByChannel is an operation to set the M-Bus encryption key on an M-Bus device by using the E-meter device identification and channel from the G-meter.
SetMbusUserKeyByChannelResponse is an operation which returns the response from the SetMbusUserKeyByChannel operation.
GetMbusEncryptionKeyStatus is an operation to retrieve the encryption key status for a M-Bus device.
GetGetMbusEncryptionKeyStatusResponse is an operation which returns the response from the GetMbusEncryptionKeyStatus operation.
GetMbusEncryptionKeyStatusByChannel is an operation to get the M-Bus encryption key status from an M-Bus device by using the E-meter device identification and channel from the G-meter.
GetMbusEncryptionKeyStatusByChannelResponse is an operation which returns the response from the GetMbusEncryptionKeyStatusByChannel operation.
SetActivityCalendar is an operation to set several parameters on an E-meter such as tariffs per day in a week profile.
GetSetActivityCalendarResponse is an operation which returns the response from the SetActivityCalendar operation.
GetAdministrativeStatus is an operation to retrieve the current AdministrativeStatus setting.
GetGetAdministrativeStatusResponse is an operation which returns the response from the GetAdministrativeStatus operation.
SetAdministrativeStatus is an operation to set the AdministrativeStatus.
GetSetAdministrativeStatusResponse is an operation which returns the response from the SetAdministrativeStatus operation.
GetFirmwareVersion is an operation to retrieve the firmware version(s).
GetGetFirmwareVersionResponse is an operation which returns the response from the GetFirmwareVersionoperation.
ReplaceKeys is an operation to change the keys on a E-meter.
GetReplaceKeysResponse is an operation which returns the response from the ReplaceKeys operation.
UpdateFirmware is an operation to update the firmware module(s) on a device.
GetUpdateFirmwareResponse is an operation which returns the response from the UpdateFirmware operation.
GenerateAndReplaceKeys is an operation to generate and set the encryption and authentication key on a device.
GenerateAndReplaceKeysResponse is an operation which returns the response from the GenerateAndReplaceKeys operation.
SetClockConfiguration is an operation to set the clock configuration on a device.
GetSetClockConfigurationResponse is an operation which returns the response from the SetClockConfiguration operation.
ConfigureDefinableLoadProfile is an operation to configure the load profile on a device.
GetConfigureDefinableLoadProfileResponse is an operation which returns the response from the ConfigureDefinableLoadProfile operation.
AddDevice is an operation to add a device to the OSGP database.
GetAddDeviceResponse is an operation which returns the response from the AddDevice operation.
CoupleMbusDevice is an operation to couple a M-Bus device to a gateway.
GetCoupleMbusDeviceResponse is an operation which returns the response from the CoupleMbusDevice operation.
CoupleMbusDeviceByChannel is an operation to couple a M-Bus device to a gateway.
GetCoupleMbusDeviceByChannelResponse is an operation which returns the response from the CoupleMbusDeviceByChannel operation.
DeCoupleMbusDevice is an operation to decouple an M-Bus device from a gateway.
GetDeCoupleMbusDeviceResponse is an operation which returns the response from the DeCoupleMbusDevice operation.
ClearMBusStatusOnAllChannels is an operation to clear the M-Bus status on all channels, so G-meters are ready to raise new alarms.
FindEvents is an operation to retrieve events logging from a device.
GetFindEventsResponse is an operation which returns the response from the FindEvents operation.
GetDevices is an operation to retrieve the last known relay statuses for a group of devices.
EnableDebugging is an operation to enable debug logging for a device.
GetEnableDebuggingResponse is an operation which returns the response from the EnableDebugging operation.
DisableDebugging is an operation to disable debug logging for a device.
GetDisableDebuggingResponse is an operation which returns the response from the DisableDebugging operation.
FindMessageLogs is an operation to read the debug logging from a device.
GetFindMessageLogsResponse is an operation which returns the response from the FindMessageLogs operation.
SetDeviceCommunicationSettings is an operation to set the OSGP device communication settings for a specific device.
SetDeviceCommunicationSettingsResponse is an operation which returns the response from the SetDeviceCommunicationSettings operation.
SetDeviceLifecycleStatus is an operation to set the lifecycle status from a device.
SetDeviceLifecycleStatusResponse is an operation which returns the response from the SetDeviceLifecycleStatus operation.
SetDeviceLifecycleStatusByChannel is an operation to set the lifecycle status from a device.
SetDeviceLifecycleStatusByChannelResponse is an operation which returns the response from the SetDeviceLifecycleStatusByChannel operation.
GetActualMeterReads is an operation to retrieve the actual meter reads from an E-meter.
GetActualMeterReadsResponse is an operation which returns the response from the ActualMeterReads operation.
GetActualMeterReadsGas is an operation to retrieve the actual meter reads from a G-meter.
GetActualMeterReadsGasResponse is an operation which returns the response from the ActualMeterReadsGas operation.
GetPeriodicMeterReads is an operation to retrieve the periodic meter reads from an E-meter.
GetPeriodicMeterReadsResponse is an operation which returns the response from the PeriodicMeterReads operation.
GetPeriodicMeterReadsGas is an operation to retrieve the periodic meter reads from a G-meter.
GetPeriodicMeterReadsGasResponse is an operation which returns the response from the PeriodicMeterReadsGas operation.
GetProfileGenericData is an operation to retrieve any Profile Generic data from an E-meter.
GetProfileGenericDataResponse is an operation which returns the response from the ProfileGenericData operation.
ReadAlarmRegister is an operation to read the alarm register from a device.
GetReadAlarmRegisterResponse is an operation which returns the response from the ReadAlarmRegister operation.
RetrievePushNotificationAlarm is an operation to push retrieved alarm notifications to OSGP.
ClearAlarmRegister is an operation to clear the Alarm register flags for pushed event notifications.
ClearAlarmRegisterResponse is an operation which returns the response from the ClearAlarmRegister operation.
SetDeviceLifecycleStatus is an operation to set the device lifecycle status of a device.
SetDeviceLifecycleStatusResponse is an operation which returns the response from the SetDeviceLifecycleStatus operation.
SendNotification is an operation to let Webapps know there is a result ready to retrieve from the platform.
Bundle is a special operation in which one or more single operation(s) to a specific device can be bundled.
GetBundleResponse is an operation which gets the response from the Bundle operation.
All operations sent to this device make use of one communication channel, which may improve performance considerably.
This chapter describes all the web services in the smart metering domain.
Describes the actions as defined in
GetAssociationLnObjects is a request to get the Association LN object tree from an E-meter. The request is sent with the DeviceIdentification number from the desired device.
All requests have similar response behaviour which is described in .
returns the result values from getting the Association LN object. The response contains the DeviceIdentification and CorrelationUid which is received from the GetAssociationLnObjects request.
XSD:
WSDL:
SpecificConfigurationObject is a request to retrieve the data for a specific configuration object indicated with:
ClassId
Attribute
ObisCode
XSD: sm-configuration.xsd
WSDL: SmartMeteringBundle.wsdl
SynchronizeTime request synchronizes the date and time on a device. The date and time are retrieved from the server and sent to the device with CLASS_ID 8, OBIS_CODE 0.0.1.0.0.255 and ATTRIBUTE_ID 2. The request is sent with the DeviceIdentification number from the desired device. The request should contain a Deviation of local time to UTC in minutes (from the range of -720 to 720 inclusive) and a value Dst indicating whether daylight savings is active. For example in Central European Summer Time, DST is active and times are UTC/GMT +2 hours. For devices in a region where CEST applies, during the summer time the value for deviation should be "-120" (120 minutes deducted from local time gives GMT/UTC time) and dst should be "true".
All requests have similar response behaviour which is described in ResponseMessages.
GetSynchronizeTimeResponse returns the result from synchronizing date and time. The response contains the DeviceIdentification and CorrelationUid which is received from the SynchronizeTime request.
XSD: sm-adhoc.xsd
WSDL: SmartMeteringAdhoc.wsdl
You can combine multiple requests to a meter in a bundle by creating a BundleRequest with one or more Actions in the namespace http://www.opensmartgridplatform.org/schemas/smartmetering/sm-bundle/2014/10. Each Action contains one of the existing requests to a meter.
A bundle is executed using one connection to the meter. A bundle response contains all individual responses of executed commands both successful and unsuccessful. When an individual request fails it is retried when this is useful, more precisely the bundle is retried, executing only requests that are fit for re-submission.
Bundle is a special request in which one or more single request(s) to a specific device can be bundled. All requests sent to this device make use of one communication channel, which may improve performance considerably.
GetBundleResponse returns the result of the actions of the bundle. The response contains the DeviceIdentification and CorrelationUid which is received from the Bundle request.
The Bundle request has an Actions tag. This contains a list of one or more single request(s). The response behavior is described in ResponseMessages.
Currently, the following actions are supported:
FindEventsRequest see FindEvents
SetSpecialDaysRequest see SetSpecialDays
ReadAlarmRegisterRequest see ReadAlarmRegister
GetActualMeterReadsRequest see ReadAlarmRegister
GetActualMeterReadsGasRequest see GetActualMeterReadsGas
GetAdministrativeStatusRequest see GetAdministrativeStatus
GetPeriodicMeterReadsRequest see GetPeriodicMeterReads
GetPeriodicMeterReadsGasRequest see GetPeriodicMeterReadsGas
SetAdministrativeStatusRequest see SetAdministrativeStatus
SetActivityCalendarRequest see SetActivityCalendar
SetKeyOnGMeterRequest see SetKeyOnGMeter
SetAlarmNotificationsRequest see SetAlarmNotifications
SetConfigurationObjectRequest see SetConfigurationObject
SetPushSetupAlarmRequest see SetPushSetupAlarm
SetPushSetupSmsRequest see SetPushSetupSms
SynchronizeTimeRequest see SynchronizeTime
GetConfigurationRequest
GetFirmwareVersionRequest
UpdateFirmwareRequest see UpdateFirmware
GetSpecificConfigurationObjectRequest see SpecificConfigurationObject
SetKeysRequest
GetAssociationLnObjectsRequest
SetClockConfigurationRequest SetClockConfiguration
GetProfileGenericDataRequest see GetProfileGenericData
ConfigureDefinableLoadProfileRequest see ConfigureDefinableLoadProfile
SetMbusUserKeyByChannelRequest see SetMbusUserKeyByChannel
GetMBusEncryptionKeyStatusRequest see GetMbusEncryptionKeyStatus
XSD: sm-bundle.xsd
WSDL: SmartMeteringBundle.wsdl
GetSynchronizeTimeResponse returns the result from synchronizing date and time. The response contains the DeviceIdentification and CorrelationUid which is received from the SynchronizeTime request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-adhoc.xsd
WSDL: SmartMeteringAdhoc.wsdl
GetBundleResponse returns the result of the bundle requested with the Bundle method. The response contains the DeviceIdentification and CorrelationUid which is received from the Bundle request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD:
WSDL: SmartMeteringBundle.wsdl
GetGetAssociationLnObjectsResponse returns the result values from getting the Association LN object. The response contains the DeviceIdentification and CorrelationUid which is received from the GetAssociationLnObjects request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-adhoc.xsd
WSDL: SmartMeteringAdhoc.wsdl
GetReplaceKeysResponse returns if the result is successful from the ReplaceKeys request. The response contains the DeviceIdentification and CorrelationUid which is received from the ReplaceKeys request.
All requests have similar response behaviour which is described in ResponseMessages.
XSD: sm-configuration.xsd