I successfully created a component using JSON-RPC functions, which can be sent directly over the HTTP API. However, when I try to use the Edge → Backend WebSocket API, I encounter the following issue in the logs:
[ctrlBackend1] Unhandled Notification: {"jsonrpc":"2.0","method":"createComponentConfig","params":{"factoryPid":"Simulator.ProductionMeter.Acting","properties":[{"name":"id","value":"meter2"},{"name":"alias","value":"PV BRF Malmo"},{"name":"datasource.id","value":"_simulator"},{"name":"enabled","value":true}]}}
In the project in WebSocketHandler:
String jsonMessage = "{\n" +
" \"jsonrpc\": \"2.0\",\n" +
" \"method\": \"createComponentConfig\",\n" +
" \"params\": {\n" +
" \"factoryPid\": \"Simulator.ProductionMeter.Acting\",\n" +
" \"properties\": [\n" +
" {\n" +
" \"name\": \"id\",\n" +
" \"value\": \"meter2\"\n" +
" },\n" +
" {\n" +
" \"name\": \"alias\",\n" +
" \"value\": \"PV BRF Malmo\"\n" +
" },\n" +
" {\n" +
" \"name\": \"datasource.id\",\n" +
" \"value\": \"_simulator\"\n" +
" },\n" +
" {\n" +
" \"name\": \"enabled\",\n" +
" \"value\": true\n" +
" }\n" +
" ]\n" +
" }\n" +
"}";
session.sendMessage(new TextMessage(jsonMessage));
So, in conclusion, I send the message via WebSocket to the server, but OpenEMS does not recognize it.