kubarskii/OCPP-J-CP-Simulator

Improvement: send meter values

Opened this issue · 1 comments

Hi,

It would be nice to be able to send meter values from the charge point to the backend:

$('#mv').click(function` () {
    onAction();
    sessionStorage.setItem('LastAction', "MeterValues");

    var transactionId = sessionStorage.getItem('TransactionId'); // Does not work this way
    var value = prompt("Please input the new meter value:", "123");

    var MV = JSON.stringify([2, id, "MeterValues", {"connectorId": 1, "transactionId": transactionId, "meterValue": [{"timestamp": formatDate(new Date()), "sampledValue": [{"value": value}]}]}]);

    _websocket.send(MV);
});

You posted this a long time ago, but you might be interested in the PR I just opened.