kubarskii / OCPP-J-CP-Simulator

A really simple cp simulator, that works with OCPP 1.6
Apache License 2.0
92 stars 128 forks source link

Improvement: send meter values #11

Open ghost opened 5 years ago

ghost commented 5 years ago

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);
});
ghost commented 4 years ago

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