@enyo-energy/energy-app-sdk 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -0
- package/dist/cjs/connect-ems-api.cjs +2 -0
- package/dist/cjs/connect-ems-api.d.cts +30 -0
- package/dist/cjs/connect-ems-permission.enum.cjs +7 -0
- package/dist/cjs/connect-ems-permission.enum.d.cts +3 -0
- package/dist/cjs/connect-ems-permission.type.cjs +2 -0
- package/dist/cjs/connect-ems-permission.type.d.cts +1 -0
- package/dist/cjs/connect-package-definition.cjs +14 -0
- package/dist/cjs/connect-package-definition.d.cts +57 -0
- package/dist/cjs/energy-app-appliance-type.enum.cjs +14 -0
- package/dist/cjs/energy-app-appliance-type.enum.d.cts +10 -0
- package/dist/cjs/energy-app-package-configuration.cjs +2 -0
- package/dist/cjs/energy-app-package-configuration.d.cts +30 -0
- package/dist/cjs/energy-app-package-definition.cjs +30 -0
- package/dist/cjs/energy-app-package-definition.d.cts +123 -0
- package/dist/cjs/energy-app-permission.type.cjs +21 -0
- package/dist/cjs/energy-app-permission.type.d.cts +18 -0
- package/dist/cjs/enyo-energy-app-sdk.cjs +12 -0
- package/dist/cjs/enyo-energy-app-sdk.d.cts +67 -0
- package/dist/cjs/hems-one-energy-app-sdk.cjs +12 -0
- package/dist/cjs/hems-one-energy-app-sdk.d.cts +64 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.cjs +388 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.d.cts +59 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.cjs +37 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.d.cts +15 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.cjs +130 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.d.cts +41 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.cjs +49 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.cts +10 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.cjs +348 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.d.cts +56 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.cjs +199 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.d.cts +26 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.cjs +98 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.d.cts +13 -0
- package/dist/cjs/implementations/modbus/interfaces.cjs +29 -0
- package/dist/cjs/implementations/modbus/interfaces.d.cts +202 -0
- package/dist/cjs/implementations/ocpp/ocpp-common.cjs +337 -0
- package/dist/cjs/implementations/ocpp/ocpp-common.d.cts +75 -0
- package/dist/cjs/implementations/ocpp/ocpp16.cjs +51 -0
- package/dist/cjs/implementations/ocpp/ocpp16.d.cts +137 -0
- package/dist/cjs/implementations/ocpp/ocpp201.cjs +84 -0
- package/dist/cjs/implementations/ocpp/ocpp201.d.cts +215 -0
- package/dist/cjs/index.cjs +117 -0
- package/dist/cjs/index.d.cts +56 -0
- package/dist/cjs/mockConnectEmsApi.cjs +167 -0
- package/dist/cjs/mockConnectEmsApi.d.cts +10 -0
- package/dist/cjs/packages/connect-appliance.cjs +2 -0
- package/dist/cjs/packages/connect-appliance.d.cts +24 -0
- package/dist/cjs/packages/connect-http-api.cjs +2 -0
- package/dist/cjs/packages/connect-http-api.d.cts +15 -0
- package/dist/cjs/packages/connect-interval.cjs +2 -0
- package/dist/cjs/packages/connect-interval.d.cts +15 -0
- package/dist/cjs/packages/connect-modbus.cjs +2 -0
- package/dist/cjs/packages/connect-modbus.d.cts +60 -0
- package/dist/cjs/packages/connect-network-devices.cjs +2 -0
- package/dist/cjs/packages/connect-network-devices.d.cts +40 -0
- package/dist/cjs/packages/connect-storage.cjs +2 -0
- package/dist/cjs/packages/connect-storage.d.cts +14 -0
- package/dist/cjs/packages/energy-app-appliance.cjs +2 -0
- package/dist/cjs/packages/energy-app-appliance.d.cts +17 -0
- package/dist/cjs/packages/energy-app-authentication.cjs +2 -0
- package/dist/cjs/packages/energy-app-authentication.d.cts +52 -0
- package/dist/cjs/packages/energy-app-charge.cjs +2 -0
- package/dist/cjs/packages/energy-app-charge.d.cts +13 -0
- package/dist/cjs/packages/energy-app-charging-card.cjs +2 -0
- package/dist/cjs/packages/energy-app-charging-card.d.cts +11 -0
- package/dist/cjs/packages/energy-app-data-bus.cjs +2 -0
- package/dist/cjs/packages/energy-app-data-bus.d.cts +12 -0
- package/dist/cjs/packages/energy-app-electricity-prices.cjs +2 -0
- package/dist/cjs/packages/energy-app-electricity-prices.d.cts +59 -0
- package/dist/cjs/packages/energy-app-interval.cjs +2 -0
- package/dist/cjs/packages/energy-app-interval.d.cts +15 -0
- package/dist/cjs/packages/energy-app-modbus.cjs +2 -0
- package/dist/cjs/packages/energy-app-modbus.d.cts +46 -0
- package/dist/cjs/packages/energy-app-network-device.cjs +2 -0
- package/dist/cjs/packages/energy-app-network-device.d.cts +25 -0
- package/dist/cjs/packages/energy-app-notification.cjs +2 -0
- package/dist/cjs/packages/energy-app-notification.d.cts +50 -0
- package/dist/cjs/packages/energy-app-ocpp.cjs +16 -0
- package/dist/cjs/packages/energy-app-ocpp.d.cts +52 -0
- package/dist/cjs/packages/energy-app-settings.cjs +2 -0
- package/dist/cjs/packages/energy-app-settings.d.cts +47 -0
- package/dist/cjs/packages/energy-app-storage.cjs +2 -0
- package/dist/cjs/packages/energy-app-storage.d.cts +14 -0
- package/dist/cjs/packages/energy-app-vehicle.cjs +2 -0
- package/dist/cjs/packages/energy-app-vehicle.d.cts +11 -0
- package/dist/cjs/permission-not-granted.cjs +18 -0
- package/dist/cjs/permission-not-granted.d.cts +8 -0
- package/dist/cjs/types/connect-appliance-type.enum.cjs +10 -0
- package/dist/cjs/types/connect-appliance-type.enum.d.cts +6 -0
- package/dist/cjs/types/energy-app-settings.cjs +2 -0
- package/dist/cjs/types/energy-app-settings.d.cts +74 -0
- package/dist/cjs/types/enyo-appliance.cjs +33 -0
- package/dist/cjs/types/enyo-appliance.d.cts +81 -0
- package/dist/cjs/types/enyo-authentication.cjs +9 -0
- package/dist/cjs/types/enyo-authentication.d.cts +69 -0
- package/dist/cjs/types/enyo-battery-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-battery-appliance.d.cts +6 -0
- package/dist/cjs/types/enyo-charge.cjs +15 -0
- package/dist/cjs/types/enyo-charge.d.cts +82 -0
- package/dist/cjs/types/enyo-charger-appliance.cjs +41 -0
- package/dist/cjs/types/enyo-charger-appliance.d.cts +49 -0
- package/dist/cjs/types/enyo-charging-card.cjs +2 -0
- package/dist/cjs/types/enyo-charging-card.d.cts +11 -0
- package/dist/cjs/types/enyo-data-bus-value.cjs +78 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +379 -0
- package/dist/cjs/types/enyo-electricity-prices.cjs +2 -0
- package/dist/cjs/types/enyo-electricity-prices.d.cts +63 -0
- package/dist/cjs/types/enyo-energy-tariff.cjs +2 -0
- package/dist/cjs/types/enyo-energy-tariff.d.cts +70 -0
- package/dist/cjs/types/enyo-heatpump-appliance.cjs +19 -0
- package/dist/cjs/types/enyo-heatpump-appliance.d.cts +34 -0
- package/dist/cjs/types/enyo-inverter-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-inverter-appliance.d.cts +3 -0
- package/dist/cjs/types/enyo-meter-appliance.cjs +10 -0
- package/dist/cjs/types/enyo-meter-appliance.d.cts +10 -0
- package/dist/cjs/types/enyo-network-device.cjs +2 -0
- package/dist/cjs/types/enyo-network-device.d.cts +31 -0
- package/dist/cjs/types/enyo-notification.cjs +2 -0
- package/dist/cjs/types/enyo-notification.d.cts +48 -0
- package/dist/cjs/types/enyo-settings.cjs +2 -0
- package/dist/cjs/types/enyo-settings.d.cts +74 -0
- package/dist/cjs/types/enyo-source.enum.cjs +8 -0
- package/dist/cjs/types/enyo-source.enum.d.cts +4 -0
- package/dist/cjs/types/enyo-vehicle.cjs +2 -0
- package/dist/cjs/types/enyo-vehicle.d.cts +12 -0
- package/dist/cjs/types/enyo-websocket-connection.cjs +2 -0
- package/dist/cjs/types/enyo-websocket-connection.d.cts +8 -0
- package/dist/cjs/types/hems-one-appliance.cjs +33 -0
- package/dist/cjs/types/hems-one-appliance.d.cts +81 -0
- package/dist/cjs/types/hems-one-authentication.cjs +9 -0
- package/dist/cjs/types/hems-one-authentication.d.cts +69 -0
- package/dist/cjs/types/hems-one-battery-appliance.cjs +2 -0
- package/dist/cjs/types/hems-one-battery-appliance.d.cts +6 -0
- package/dist/cjs/types/hems-one-charge.cjs +15 -0
- package/dist/cjs/types/hems-one-charge.d.cts +82 -0
- package/dist/cjs/types/hems-one-charger-appliance.cjs +41 -0
- package/dist/cjs/types/hems-one-charger-appliance.d.cts +49 -0
- package/dist/cjs/types/hems-one-charging-card.cjs +2 -0
- package/dist/cjs/types/hems-one-charging-card.d.cts +11 -0
- package/dist/cjs/types/hems-one-data-bus-command.cjs +9 -0
- package/dist/cjs/types/hems-one-data-bus-command.d.cts +34 -0
- package/dist/cjs/types/hems-one-data-bus-value.cjs +78 -0
- package/dist/cjs/types/hems-one-data-bus-value.d.cts +379 -0
- package/dist/cjs/types/hems-one-electricity-prices.cjs +2 -0
- package/dist/cjs/types/hems-one-electricity-prices.d.cts +63 -0
- package/dist/cjs/types/hems-one-energy-tariff.cjs +2 -0
- package/dist/cjs/types/hems-one-energy-tariff.d.cts +70 -0
- package/dist/cjs/types/hems-one-heatpump-appliance.cjs +19 -0
- package/dist/cjs/types/hems-one-heatpump-appliance.d.cts +34 -0
- package/dist/cjs/types/hems-one-inverter-appliance.cjs +2 -0
- package/dist/cjs/types/hems-one-inverter-appliance.d.cts +3 -0
- package/dist/cjs/types/hems-one-meter-appliance.cjs +10 -0
- package/dist/cjs/types/hems-one-meter-appliance.d.cts +10 -0
- package/dist/cjs/types/hems-one-network-device.cjs +2 -0
- package/dist/cjs/types/hems-one-network-device.d.cts +31 -0
- package/dist/cjs/types/hems-one-source.enum.cjs +8 -0
- package/dist/cjs/types/hems-one-source.enum.d.cts +4 -0
- package/dist/cjs/types/hems-one-vehicle.cjs +2 -0
- package/dist/cjs/types/hems-one-vehicle.d.cts +12 -0
- package/dist/cjs/types/hems-one-websocket-connection.cjs +2 -0
- package/dist/cjs/types/hems-one-websocket-connection.d.cts +8 -0
- package/dist/cjs/version.cjs +19 -0
- package/dist/cjs/version.d.cts +13 -0
- package/dist/connect-ems-api.d.ts +30 -0
- package/dist/connect-ems-api.js +1 -0
- package/dist/connect-ems-permission.enum.d.ts +3 -0
- package/dist/connect-ems-permission.enum.js +4 -0
- package/dist/connect-ems-permission.type.d.ts +1 -0
- package/dist/connect-ems-permission.type.js +1 -0
- package/dist/connect-package-definition.d.ts +57 -0
- package/dist/connect-package-definition.js +10 -0
- package/dist/energy-app-appliance-type.enum.d.ts +10 -0
- package/dist/energy-app-appliance-type.enum.js +11 -0
- package/dist/energy-app-package-configuration.d.ts +30 -0
- package/dist/energy-app-package-configuration.js +1 -0
- package/dist/energy-app-package-definition.d.ts +123 -0
- package/dist/energy-app-package-definition.js +26 -0
- package/dist/energy-app-permission.type.d.ts +18 -0
- package/dist/energy-app-permission.type.js +18 -0
- package/dist/enyo-energy-app-sdk.d.ts +67 -0
- package/dist/enyo-energy-app-sdk.js +9 -0
- package/dist/hems-one-energy-app-sdk.d.ts +67 -0
- package/dist/hems-one-energy-app-sdk.js +9 -0
- package/dist/implementations/modbus/EnergyAppModbusBattery.d.ts +59 -0
- package/dist/implementations/modbus/EnergyAppModbusBattery.js +384 -0
- package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.d.ts +15 -0
- package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.js +33 -0
- package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.d.ts +41 -0
- package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.js +126 -0
- package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.ts +10 -0
- package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.js +45 -0
- package/dist/implementations/modbus/EnergyAppModbusInverter.d.ts +56 -0
- package/dist/implementations/modbus/EnergyAppModbusInverter.js +344 -0
- package/dist/implementations/modbus/EnergyAppModbusMeter.d.ts +26 -0
- package/dist/implementations/modbus/EnergyAppModbusMeter.js +195 -0
- package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.d.ts +13 -0
- package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.js +94 -0
- package/dist/implementations/modbus/interfaces.d.ts +202 -0
- package/dist/implementations/modbus/interfaces.js +23 -0
- package/dist/implementations/ocpp/ocpp-common.d.ts +75 -0
- package/dist/implementations/ocpp/ocpp-common.js +328 -0
- package/dist/implementations/ocpp/ocpp16.d.ts +137 -0
- package/dist/implementations/ocpp/ocpp16.js +48 -0
- package/dist/implementations/ocpp/ocpp201.d.ts +215 -0
- package/dist/implementations/ocpp/ocpp201.js +81 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +99 -0
- package/dist/mockConnectEmsApi.d.ts +10 -0
- package/dist/mockConnectEmsApi.js +160 -0
- package/dist/packages/connect-appliance.d.ts +24 -0
- package/dist/packages/connect-appliance.js +1 -0
- package/dist/packages/connect-http-api.d.ts +15 -0
- package/dist/packages/connect-http-api.js +1 -0
- package/dist/packages/connect-interval.d.ts +15 -0
- package/dist/packages/connect-interval.js +1 -0
- package/dist/packages/connect-modbus.d.ts +60 -0
- package/dist/packages/connect-modbus.js +1 -0
- package/dist/packages/connect-network-devices.d.ts +40 -0
- package/dist/packages/connect-network-devices.js +1 -0
- package/dist/packages/connect-storage.d.ts +14 -0
- package/dist/packages/connect-storage.js +1 -0
- package/dist/packages/energy-app-appliance.d.ts +17 -0
- package/dist/packages/energy-app-appliance.js +1 -0
- package/dist/packages/energy-app-authentication.d.ts +52 -0
- package/dist/packages/energy-app-authentication.js +1 -0
- package/dist/packages/energy-app-charge.d.ts +13 -0
- package/dist/packages/energy-app-charge.js +1 -0
- package/dist/packages/energy-app-charging-card.d.ts +11 -0
- package/dist/packages/energy-app-charging-card.js +1 -0
- package/dist/packages/energy-app-data-bus.d.ts +12 -0
- package/dist/packages/energy-app-data-bus.js +1 -0
- package/dist/packages/energy-app-electricity-prices.d.ts +59 -0
- package/dist/packages/energy-app-electricity-prices.js +1 -0
- package/dist/packages/energy-app-interval.d.ts +15 -0
- package/dist/packages/energy-app-interval.js +1 -0
- package/dist/packages/energy-app-modbus.d.ts +46 -0
- package/dist/packages/energy-app-modbus.js +1 -0
- package/dist/packages/energy-app-network-device.d.ts +25 -0
- package/dist/packages/energy-app-network-device.js +1 -0
- package/dist/packages/energy-app-notification.d.ts +50 -0
- package/dist/packages/energy-app-notification.js +1 -0
- package/dist/packages/energy-app-ocpp.d.ts +52 -0
- package/dist/packages/energy-app-ocpp.js +13 -0
- package/dist/packages/energy-app-settings.d.ts +47 -0
- package/dist/packages/energy-app-settings.js +1 -0
- package/dist/packages/energy-app-storage.d.ts +14 -0
- package/dist/packages/energy-app-storage.js +1 -0
- package/dist/packages/energy-app-vehicle.d.ts +11 -0
- package/dist/packages/energy-app-vehicle.js +1 -0
- package/dist/permission-not-granted.d.ts +8 -0
- package/dist/permission-not-granted.js +14 -0
- package/dist/types/connect-appliance-type.enum.d.ts +6 -0
- package/dist/types/connect-appliance-type.enum.js +7 -0
- package/dist/types/energy-app-settings.d.ts +74 -0
- package/dist/types/energy-app-settings.js +1 -0
- package/dist/types/enyo-appliance.d.ts +81 -0
- package/dist/types/enyo-appliance.js +30 -0
- package/dist/types/enyo-authentication.d.ts +69 -0
- package/dist/types/enyo-authentication.js +6 -0
- package/dist/types/enyo-battery-appliance.d.ts +6 -0
- package/dist/types/enyo-battery-appliance.js +1 -0
- package/dist/types/enyo-charge.d.ts +82 -0
- package/dist/types/enyo-charge.js +12 -0
- package/dist/types/enyo-charger-appliance.d.ts +49 -0
- package/dist/types/enyo-charger-appliance.js +38 -0
- package/dist/types/enyo-charging-card.d.ts +11 -0
- package/dist/types/enyo-charging-card.js +1 -0
- package/dist/types/enyo-data-bus-value.d.ts +379 -0
- package/dist/types/enyo-data-bus-value.js +75 -0
- package/dist/types/enyo-electricity-prices.d.ts +63 -0
- package/dist/types/enyo-electricity-prices.js +1 -0
- package/dist/types/enyo-energy-tariff.d.ts +70 -0
- package/dist/types/enyo-energy-tariff.js +1 -0
- package/dist/types/enyo-heatpump-appliance.d.ts +34 -0
- package/dist/types/enyo-heatpump-appliance.js +16 -0
- package/dist/types/enyo-inverter-appliance.d.ts +3 -0
- package/dist/types/enyo-inverter-appliance.js +1 -0
- package/dist/types/enyo-meter-appliance.d.ts +10 -0
- package/dist/types/enyo-meter-appliance.js +7 -0
- package/dist/types/enyo-network-device.d.ts +31 -0
- package/dist/types/enyo-network-device.js +1 -0
- package/dist/types/enyo-notification.d.ts +48 -0
- package/dist/types/enyo-notification.js +1 -0
- package/dist/types/enyo-settings.d.ts +74 -0
- package/dist/types/enyo-settings.js +1 -0
- package/dist/types/enyo-source.enum.d.ts +4 -0
- package/dist/types/enyo-source.enum.js +5 -0
- package/dist/types/enyo-vehicle.d.ts +12 -0
- package/dist/types/enyo-vehicle.js +1 -0
- package/dist/types/enyo-websocket-connection.d.ts +8 -0
- package/dist/types/enyo-websocket-connection.js +1 -0
- package/dist/types/hems-one-appliance.d.ts +81 -0
- package/dist/types/hems-one-appliance.js +30 -0
- package/dist/types/hems-one-authentication.d.ts +69 -0
- package/dist/types/hems-one-authentication.js +6 -0
- package/dist/types/hems-one-battery-appliance.d.ts +6 -0
- package/dist/types/hems-one-battery-appliance.js +1 -0
- package/dist/types/hems-one-charge.d.ts +82 -0
- package/dist/types/hems-one-charge.js +12 -0
- package/dist/types/hems-one-charger-appliance.d.ts +49 -0
- package/dist/types/hems-one-charger-appliance.js +38 -0
- package/dist/types/hems-one-charging-card.d.ts +11 -0
- package/dist/types/hems-one-charging-card.js +1 -0
- package/dist/types/hems-one-data-bus-command.d.ts +34 -0
- package/dist/types/hems-one-data-bus-command.js +6 -0
- package/dist/types/hems-one-data-bus-value.d.ts +379 -0
- package/dist/types/hems-one-data-bus-value.js +75 -0
- package/dist/types/hems-one-electricity-prices.d.ts +63 -0
- package/dist/types/hems-one-electricity-prices.js +1 -0
- package/dist/types/hems-one-energy-tariff.d.ts +70 -0
- package/dist/types/hems-one-energy-tariff.js +1 -0
- package/dist/types/hems-one-heatpump-appliance.d.ts +34 -0
- package/dist/types/hems-one-heatpump-appliance.js +16 -0
- package/dist/types/hems-one-inverter-appliance.d.ts +3 -0
- package/dist/types/hems-one-inverter-appliance.js +1 -0
- package/dist/types/hems-one-meter-appliance.d.ts +10 -0
- package/dist/types/hems-one-meter-appliance.js +7 -0
- package/dist/types/hems-one-network-device.d.ts +31 -0
- package/dist/types/hems-one-network-device.js +1 -0
- package/dist/types/hems-one-source.enum.d.ts +4 -0
- package/dist/types/hems-one-source.enum.js +5 -0
- package/dist/types/hems-one-vehicle.d.ts +12 -0
- package/dist/types/hems-one-vehicle.js +1 -0
- package/dist/types/hems-one-websocket-connection.d.ts +8 -0
- package/dist/types/hems-one-websocket-connection.js +1 -0
- package/dist/version.d.ts +13 -0
- package/dist/version.js +15 -0
- package/package.json +43 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenericChargePointStatus = exports.ErrorCode = exports.MESSAGE_TYPE = void 0;
|
|
4
|
+
exports.mapOCCP16StatusToGeneric = mapOCCP16StatusToGeneric;
|
|
5
|
+
exports.mapOCCP201StatusToGeneric = mapOCCP201StatusToGeneric;
|
|
6
|
+
exports.mapGenericToOCCP16Status = mapGenericToOCCP16Status;
|
|
7
|
+
exports.mapGenericToOCCP201Status = mapGenericToOCCP201Status;
|
|
8
|
+
exports.mapOCPP16MeterValueToGeneric = mapOCPP16MeterValueToGeneric;
|
|
9
|
+
exports.mapOCPP201MeterValueToGeneric = mapOCPP201MeterValueToGeneric;
|
|
10
|
+
exports.MESSAGE_TYPE = {
|
|
11
|
+
CALL: 2,
|
|
12
|
+
CALLRESULT: 3,
|
|
13
|
+
CALLERROR: 4,
|
|
14
|
+
};
|
|
15
|
+
var ErrorCode;
|
|
16
|
+
(function (ErrorCode) {
|
|
17
|
+
ErrorCode["NotImplemented"] = "NotImplemented";
|
|
18
|
+
ErrorCode["NotSupported"] = "NotSupported";
|
|
19
|
+
ErrorCode["InternalError"] = "InternalError";
|
|
20
|
+
ErrorCode["ProtocolError"] = "ProtocolError";
|
|
21
|
+
ErrorCode["SecurityError"] = "SecurityError";
|
|
22
|
+
ErrorCode["FormationViolation"] = "FormationViolation";
|
|
23
|
+
ErrorCode["PropertyConstraintViolation"] = "PropertyConstraintViolation";
|
|
24
|
+
ErrorCode["OccurenceConstraintViolation"] = "OccurenceConstraintViolation";
|
|
25
|
+
ErrorCode["TypeConstraintViolation"] = "TypeConstraintViolation";
|
|
26
|
+
ErrorCode["GenericError"] = "GenericError";
|
|
27
|
+
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
28
|
+
var GenericChargePointStatus;
|
|
29
|
+
(function (GenericChargePointStatus) {
|
|
30
|
+
GenericChargePointStatus["Available"] = "Available";
|
|
31
|
+
GenericChargePointStatus["Occupied"] = "Occupied";
|
|
32
|
+
GenericChargePointStatus["Suspended"] = "Suspended";
|
|
33
|
+
GenericChargePointStatus["Finishing"] = "Finishing";
|
|
34
|
+
GenericChargePointStatus["Reserved"] = "Reserved";
|
|
35
|
+
GenericChargePointStatus["Unavailable"] = "Unavailable";
|
|
36
|
+
GenericChargePointStatus["Faulted"] = "Faulted";
|
|
37
|
+
})(GenericChargePointStatus || (exports.GenericChargePointStatus = GenericChargePointStatus = {}));
|
|
38
|
+
const ocpp16_js_1 = require("./ocpp16.cjs");
|
|
39
|
+
const ocpp201_js_1 = require("./ocpp201.cjs");
|
|
40
|
+
function mapOCCP16StatusToGeneric(status) {
|
|
41
|
+
switch (status) {
|
|
42
|
+
case ocpp16_js_1.ChargePointStatus.Available:
|
|
43
|
+
return GenericChargePointStatus.Available;
|
|
44
|
+
case ocpp16_js_1.ChargePointStatus.Preparing:
|
|
45
|
+
case ocpp16_js_1.ChargePointStatus.Charging:
|
|
46
|
+
return GenericChargePointStatus.Occupied;
|
|
47
|
+
case ocpp16_js_1.ChargePointStatus.SuspendedEVSE:
|
|
48
|
+
case ocpp16_js_1.ChargePointStatus.SuspendedEV:
|
|
49
|
+
return GenericChargePointStatus.Suspended;
|
|
50
|
+
case ocpp16_js_1.ChargePointStatus.Finishing:
|
|
51
|
+
return GenericChargePointStatus.Finishing;
|
|
52
|
+
case ocpp16_js_1.ChargePointStatus.Reserved:
|
|
53
|
+
return GenericChargePointStatus.Reserved;
|
|
54
|
+
case ocpp16_js_1.ChargePointStatus.Unavailable:
|
|
55
|
+
return GenericChargePointStatus.Unavailable;
|
|
56
|
+
case ocpp16_js_1.ChargePointStatus.Faulted:
|
|
57
|
+
return GenericChargePointStatus.Faulted;
|
|
58
|
+
default:
|
|
59
|
+
return GenericChargePointStatus.Unavailable;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function mapOCCP201StatusToGeneric(connectorStatus, chargingState) {
|
|
63
|
+
if (connectorStatus === ocpp201_js_1.ConnectorStatusEnumType.Available) {
|
|
64
|
+
return GenericChargePointStatus.Available;
|
|
65
|
+
}
|
|
66
|
+
if (connectorStatus === ocpp201_js_1.ConnectorStatusEnumType.Reserved) {
|
|
67
|
+
return GenericChargePointStatus.Reserved;
|
|
68
|
+
}
|
|
69
|
+
if (connectorStatus === ocpp201_js_1.ConnectorStatusEnumType.Unavailable) {
|
|
70
|
+
return GenericChargePointStatus.Unavailable;
|
|
71
|
+
}
|
|
72
|
+
if (connectorStatus === ocpp201_js_1.ConnectorStatusEnumType.Faulted) {
|
|
73
|
+
return GenericChargePointStatus.Faulted;
|
|
74
|
+
}
|
|
75
|
+
if (connectorStatus === ocpp201_js_1.ConnectorStatusEnumType.Occupied) {
|
|
76
|
+
if (chargingState === 'SuspendedEV' || chargingState === 'SuspendedEVSE') {
|
|
77
|
+
return GenericChargePointStatus.Suspended;
|
|
78
|
+
}
|
|
79
|
+
if (chargingState === 'Charging' || chargingState === 'EVConnected') {
|
|
80
|
+
return GenericChargePointStatus.Occupied;
|
|
81
|
+
}
|
|
82
|
+
if (chargingState === 'Idle') {
|
|
83
|
+
return GenericChargePointStatus.Finishing;
|
|
84
|
+
}
|
|
85
|
+
return GenericChargePointStatus.Occupied;
|
|
86
|
+
}
|
|
87
|
+
return GenericChargePointStatus.Unavailable;
|
|
88
|
+
}
|
|
89
|
+
function mapGenericToOCCP16Status(status) {
|
|
90
|
+
switch (status) {
|
|
91
|
+
case GenericChargePointStatus.Available:
|
|
92
|
+
return ocpp16_js_1.ChargePointStatus.Available;
|
|
93
|
+
case GenericChargePointStatus.Occupied:
|
|
94
|
+
return ocpp16_js_1.ChargePointStatus.Charging;
|
|
95
|
+
case GenericChargePointStatus.Suspended:
|
|
96
|
+
return ocpp16_js_1.ChargePointStatus.SuspendedEVSE;
|
|
97
|
+
case GenericChargePointStatus.Finishing:
|
|
98
|
+
return ocpp16_js_1.ChargePointStatus.Finishing;
|
|
99
|
+
case GenericChargePointStatus.Reserved:
|
|
100
|
+
return ocpp16_js_1.ChargePointStatus.Reserved;
|
|
101
|
+
case GenericChargePointStatus.Unavailable:
|
|
102
|
+
return ocpp16_js_1.ChargePointStatus.Unavailable;
|
|
103
|
+
case GenericChargePointStatus.Faulted:
|
|
104
|
+
return ocpp16_js_1.ChargePointStatus.Faulted;
|
|
105
|
+
default:
|
|
106
|
+
return ocpp16_js_1.ChargePointStatus.Unavailable;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function mapGenericToOCCP201Status(status) {
|
|
110
|
+
switch (status) {
|
|
111
|
+
case GenericChargePointStatus.Available:
|
|
112
|
+
return ocpp201_js_1.ConnectorStatusEnumType.Available;
|
|
113
|
+
case GenericChargePointStatus.Occupied:
|
|
114
|
+
case GenericChargePointStatus.Suspended:
|
|
115
|
+
case GenericChargePointStatus.Finishing:
|
|
116
|
+
return ocpp201_js_1.ConnectorStatusEnumType.Occupied;
|
|
117
|
+
case GenericChargePointStatus.Reserved:
|
|
118
|
+
return ocpp201_js_1.ConnectorStatusEnumType.Reserved;
|
|
119
|
+
case GenericChargePointStatus.Unavailable:
|
|
120
|
+
return ocpp201_js_1.ConnectorStatusEnumType.Unavailable;
|
|
121
|
+
case GenericChargePointStatus.Faulted:
|
|
122
|
+
return ocpp201_js_1.ConnectorStatusEnumType.Faulted;
|
|
123
|
+
default:
|
|
124
|
+
return ocpp201_js_1.ConnectorStatusEnumType.Unavailable;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function mapOCPP16MeterValueToGeneric(sampledValues) {
|
|
128
|
+
const currentMeterValueInWattHours = getOCPP16MeterValueByMeasurand(sampledValues, 'Energy.Active.Import.Register');
|
|
129
|
+
const powerActiveImport = getOCPP16MeterValueByMeasurand(sampledValues, 'Power.Active.Import');
|
|
130
|
+
const evSoC = getOCPP16MeterValueByMeasurand(sampledValues, 'SoC');
|
|
131
|
+
const outletVoltage = getOCPP16OutletVoltage(sampledValues);
|
|
132
|
+
const outletCurrent = getOCPP16OutletCurrent(sampledValues);
|
|
133
|
+
return {
|
|
134
|
+
context: mapOCPP16MeterValueContext(sampledValues),
|
|
135
|
+
currentMeterValueInWattHours: convertToWattHours(currentMeterValueInWattHours),
|
|
136
|
+
powerImportByEvInWatt: convertToWatt(powerActiveImport),
|
|
137
|
+
evStateOfChargeInPercent: convertToPercent(evSoC),
|
|
138
|
+
outletVoltagePhase1: convertToVoltage(outletVoltage.phase1),
|
|
139
|
+
outletVoltagePhase2: convertToVoltage(outletVoltage.phase2),
|
|
140
|
+
outletVoltagePhase3: convertToVoltage(outletVoltage.phase3),
|
|
141
|
+
outletCurrentPhase1: convertToAmpere(outletCurrent.phase1),
|
|
142
|
+
outletCurrentPhase2: convertToAmpere(outletCurrent.phase2),
|
|
143
|
+
outletCurrentPhase3: convertToAmpere(outletCurrent.phase3),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function mapOCPP16MeterValueContext(sampledValues) {
|
|
147
|
+
const valuesWithContext = sampledValues.filter(s => s.context !== undefined);
|
|
148
|
+
if (valuesWithContext.length > 0) {
|
|
149
|
+
switch (valuesWithContext[0].context) {
|
|
150
|
+
case 'Transaction.Begin':
|
|
151
|
+
return 'Transaction.Begin';
|
|
152
|
+
case "Transaction.End":
|
|
153
|
+
return 'Transaction.End';
|
|
154
|
+
case "Sample.Clock":
|
|
155
|
+
return 'Sample.Clock';
|
|
156
|
+
case "Interruption.Begin":
|
|
157
|
+
return 'Interruption.Begin';
|
|
158
|
+
case "Interruption.End":
|
|
159
|
+
return 'Interruption.End';
|
|
160
|
+
case "Sample.Periodic":
|
|
161
|
+
return 'Sample.Periodic';
|
|
162
|
+
case "Trigger":
|
|
163
|
+
return 'Trigger';
|
|
164
|
+
default:
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
function getOCPP16MeterValueByMeasurand(sampledValues, measurand, phase) {
|
|
171
|
+
try {
|
|
172
|
+
const meterValue = sampledValues.find((sampledValue) => sampledValue.measurand === measurand &&
|
|
173
|
+
(!phase || sampledValue.phase === phase));
|
|
174
|
+
if (!meterValue) {
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
unit: meterValue.unit,
|
|
179
|
+
value: Number.parseFloat(meterValue.value),
|
|
180
|
+
context: meterValue.context,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
catch (_) {
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function getOCPP16OutletCurrent(sampledValues) {
|
|
188
|
+
const phase1 = getOCPP16MeterValueByMeasurand(sampledValues, 'Current.Import', 'L1');
|
|
189
|
+
const phase2 = getOCPP16MeterValueByMeasurand(sampledValues, 'Current.Import', 'L2');
|
|
190
|
+
const phase3 = getOCPP16MeterValueByMeasurand(sampledValues, 'Current.Import', 'L3');
|
|
191
|
+
return {
|
|
192
|
+
phase1,
|
|
193
|
+
phase2,
|
|
194
|
+
phase3,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function getOCPP16OutletVoltage(sampledValues) {
|
|
198
|
+
const phase1 = getOCPP16MeterValueByMeasurand(sampledValues, 'Voltage', 'L1');
|
|
199
|
+
const phase2 = getOCPP16MeterValueByMeasurand(sampledValues, 'Voltage', 'L2');
|
|
200
|
+
const phase3 = getOCPP16MeterValueByMeasurand(sampledValues, 'Voltage', 'L3');
|
|
201
|
+
return {
|
|
202
|
+
phase1,
|
|
203
|
+
phase2,
|
|
204
|
+
phase3,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function convertToWattHours(instance) {
|
|
208
|
+
if (!instance) {
|
|
209
|
+
return 0;
|
|
210
|
+
}
|
|
211
|
+
if (instance.unit === 'Wh') {
|
|
212
|
+
return instance.value;
|
|
213
|
+
}
|
|
214
|
+
if (instance.unit === 'kWh') {
|
|
215
|
+
return instance.value * 1000;
|
|
216
|
+
}
|
|
217
|
+
throw new Error(`Cannot convert ${instance.value} ${instance.unit} into Wh`);
|
|
218
|
+
}
|
|
219
|
+
function convertToWatt(instance) {
|
|
220
|
+
if (!instance) {
|
|
221
|
+
return 0;
|
|
222
|
+
}
|
|
223
|
+
if (instance.unit === 'W') {
|
|
224
|
+
return instance.value;
|
|
225
|
+
}
|
|
226
|
+
if (instance.unit === 'kW') {
|
|
227
|
+
return instance.value * 1000;
|
|
228
|
+
}
|
|
229
|
+
throw new Error(`Cannot convert ${instance.value} ${instance.unit} into W`);
|
|
230
|
+
}
|
|
231
|
+
function convertToPercent(instance) {
|
|
232
|
+
if (!instance) {
|
|
233
|
+
return 0;
|
|
234
|
+
}
|
|
235
|
+
if (instance.unit === 'Percent') {
|
|
236
|
+
return instance.value;
|
|
237
|
+
}
|
|
238
|
+
throw new Error(`Cannot convert ${instance.value} ${instance.unit} into Percent`);
|
|
239
|
+
}
|
|
240
|
+
function convertToVoltage(instance) {
|
|
241
|
+
if (!instance) {
|
|
242
|
+
return 0;
|
|
243
|
+
}
|
|
244
|
+
if (instance.unit === 'V') {
|
|
245
|
+
return instance.value;
|
|
246
|
+
}
|
|
247
|
+
throw new Error(`Cannot convert ${instance.value} ${instance.unit} into V`);
|
|
248
|
+
}
|
|
249
|
+
function convertToAmpere(instance) {
|
|
250
|
+
if (!instance) {
|
|
251
|
+
return 0;
|
|
252
|
+
}
|
|
253
|
+
if (instance.unit === 'A') {
|
|
254
|
+
return instance.value;
|
|
255
|
+
}
|
|
256
|
+
throw new Error(`Cannot convert ${instance.value} ${instance.unit} into A`);
|
|
257
|
+
}
|
|
258
|
+
// OCPP 2.0.1 meter value mapping functions
|
|
259
|
+
function mapOCPP201MeterValueToGeneric(sampledValues) {
|
|
260
|
+
const currentMeterValueInWattHours = getOCPP201MeterValueByMeasurand(sampledValues, 'Energy.Active.Import');
|
|
261
|
+
const powerActiveImport = getOCPP201MeterValueByMeasurand(sampledValues, 'Power.Active.Import');
|
|
262
|
+
const evSoC = getOCPP201MeterValueByMeasurand(sampledValues, 'SoC');
|
|
263
|
+
const outletVoltage = getOCPP201OutletVoltage(sampledValues);
|
|
264
|
+
const outletCurrent = getOCPP201OutletCurrent(sampledValues);
|
|
265
|
+
return {
|
|
266
|
+
context: mapOCPP201MeterValueContext(sampledValues),
|
|
267
|
+
currentMeterValueInWattHours: convertToWattHours(currentMeterValueInWattHours),
|
|
268
|
+
powerImportByEvInWatt: convertToWatt(powerActiveImport),
|
|
269
|
+
evStateOfChargeInPercent: convertToPercent(evSoC),
|
|
270
|
+
outletVoltagePhase1: convertToVoltage(outletVoltage.phase1),
|
|
271
|
+
outletVoltagePhase2: convertToVoltage(outletVoltage.phase2),
|
|
272
|
+
outletVoltagePhase3: convertToVoltage(outletVoltage.phase3),
|
|
273
|
+
outletCurrentPhase1: convertToAmpere(outletCurrent.phase1),
|
|
274
|
+
outletCurrentPhase2: convertToAmpere(outletCurrent.phase2),
|
|
275
|
+
outletCurrentPhase3: convertToAmpere(outletCurrent.phase3),
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function mapOCPP201MeterValueContext(sampledValues) {
|
|
279
|
+
const valuesWithContext = sampledValues.filter(s => s.context !== undefined);
|
|
280
|
+
if (valuesWithContext.length > 0) {
|
|
281
|
+
switch (valuesWithContext[0].context) {
|
|
282
|
+
case 'Transaction.Begin':
|
|
283
|
+
return 'Transaction.Begin';
|
|
284
|
+
case "Transaction.End":
|
|
285
|
+
return 'Transaction.End';
|
|
286
|
+
case "Sample.Clock":
|
|
287
|
+
return 'Sample.Clock';
|
|
288
|
+
case "Interruption.Begin":
|
|
289
|
+
return 'Interruption.Begin';
|
|
290
|
+
case "Interruption.End":
|
|
291
|
+
return 'Interruption.End';
|
|
292
|
+
case "Sample.Periodic":
|
|
293
|
+
return 'Sample.Periodic';
|
|
294
|
+
case "Trigger":
|
|
295
|
+
return 'Trigger';
|
|
296
|
+
default:
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return undefined;
|
|
301
|
+
}
|
|
302
|
+
function getOCPP201MeterValueByMeasurand(sampledValues, measurand, phase) {
|
|
303
|
+
try {
|
|
304
|
+
const meterValue = sampledValues.find((sampledValue) => sampledValue.measurand === measurand &&
|
|
305
|
+
(!phase || sampledValue.phase === phase));
|
|
306
|
+
if (!meterValue) {
|
|
307
|
+
return undefined;
|
|
308
|
+
}
|
|
309
|
+
return {
|
|
310
|
+
unit: meterValue.unitOfMeasure?.unit,
|
|
311
|
+
value: meterValue.value,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
catch (_) {
|
|
315
|
+
return undefined;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function getOCPP201OutletCurrent(sampledValues) {
|
|
319
|
+
const phase1 = getOCPP201MeterValueByMeasurand(sampledValues, 'Current.Import', 'L1');
|
|
320
|
+
const phase2 = getOCPP201MeterValueByMeasurand(sampledValues, 'Current.Import', 'L2');
|
|
321
|
+
const phase3 = getOCPP201MeterValueByMeasurand(sampledValues, 'Current.Import', 'L3');
|
|
322
|
+
return {
|
|
323
|
+
phase1,
|
|
324
|
+
phase2,
|
|
325
|
+
phase3,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
function getOCPP201OutletVoltage(sampledValues) {
|
|
329
|
+
const phase1 = getOCPP201MeterValueByMeasurand(sampledValues, 'Voltage', 'L1');
|
|
330
|
+
const phase2 = getOCPP201MeterValueByMeasurand(sampledValues, 'Voltage', 'L2');
|
|
331
|
+
const phase3 = getOCPP201MeterValueByMeasurand(sampledValues, 'Voltage', 'L3');
|
|
332
|
+
return {
|
|
333
|
+
phase1,
|
|
334
|
+
phase2,
|
|
335
|
+
phase3,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export type OCPPVersion = '1.6' | '2.0.1';
|
|
2
|
+
export type MessageType = 2 | 3 | 4;
|
|
3
|
+
export declare const MESSAGE_TYPE: {
|
|
4
|
+
readonly CALL: 2;
|
|
5
|
+
readonly CALLRESULT: 3;
|
|
6
|
+
readonly CALLERROR: 4;
|
|
7
|
+
};
|
|
8
|
+
export interface OCPPMessage {
|
|
9
|
+
messageType: MessageType;
|
|
10
|
+
messageId: string;
|
|
11
|
+
action?: string;
|
|
12
|
+
payload?: any;
|
|
13
|
+
errorCode?: string;
|
|
14
|
+
errorDescription?: string;
|
|
15
|
+
errorDetails?: any;
|
|
16
|
+
}
|
|
17
|
+
export interface CallMessage extends OCPPMessage {
|
|
18
|
+
messageType: typeof MESSAGE_TYPE.CALL;
|
|
19
|
+
action: string;
|
|
20
|
+
payload: any;
|
|
21
|
+
}
|
|
22
|
+
export interface CallResultMessage extends OCPPMessage {
|
|
23
|
+
messageType: typeof MESSAGE_TYPE.CALLRESULT;
|
|
24
|
+
payload: any;
|
|
25
|
+
}
|
|
26
|
+
export interface CallErrorMessage extends OCPPMessage {
|
|
27
|
+
messageType: typeof MESSAGE_TYPE.CALLERROR;
|
|
28
|
+
errorCode: string;
|
|
29
|
+
errorDescription: string;
|
|
30
|
+
errorDetails?: any;
|
|
31
|
+
}
|
|
32
|
+
export type OCPPMessageUnion = CallMessage | CallResultMessage | CallErrorMessage;
|
|
33
|
+
export declare enum ErrorCode {
|
|
34
|
+
NotImplemented = "NotImplemented",
|
|
35
|
+
NotSupported = "NotSupported",
|
|
36
|
+
InternalError = "InternalError",
|
|
37
|
+
ProtocolError = "ProtocolError",
|
|
38
|
+
SecurityError = "SecurityError",
|
|
39
|
+
FormationViolation = "FormationViolation",
|
|
40
|
+
PropertyConstraintViolation = "PropertyConstraintViolation",
|
|
41
|
+
OccurenceConstraintViolation = "OccurenceConstraintViolation",
|
|
42
|
+
TypeConstraintViolation = "TypeConstraintViolation",
|
|
43
|
+
GenericError = "GenericError"
|
|
44
|
+
}
|
|
45
|
+
export declare enum GenericChargePointStatus {
|
|
46
|
+
Available = "Available",
|
|
47
|
+
Occupied = "Occupied",
|
|
48
|
+
Suspended = "Suspended",
|
|
49
|
+
Finishing = "Finishing",
|
|
50
|
+
Reserved = "Reserved",
|
|
51
|
+
Unavailable = "Unavailable",
|
|
52
|
+
Faulted = "Faulted"
|
|
53
|
+
}
|
|
54
|
+
import { ChargePointStatus, OCPP16MeterValueSampledValue } from './ocpp16.cjs';
|
|
55
|
+
import { ConnectorStatusEnumType, OCPP201TransactionEventRequest } from './ocpp201.cjs';
|
|
56
|
+
export type OCPP201MeterValueSampledValue = NonNullable<NonNullable<OCPP201TransactionEventRequest['meterValue']>[number]['sampledValue'][number]>;
|
|
57
|
+
export declare function mapOCCP16StatusToGeneric(status: ChargePointStatus): GenericChargePointStatus;
|
|
58
|
+
export declare function mapOCCP201StatusToGeneric(connectorStatus: ConnectorStatusEnumType, chargingState?: 'Charging' | 'EVConnected' | 'SuspendedEV' | 'SuspendedEVSE' | 'Idle'): GenericChargePointStatus;
|
|
59
|
+
export declare function mapGenericToOCCP16Status(status: GenericChargePointStatus): ChargePointStatus;
|
|
60
|
+
export declare function mapGenericToOCCP201Status(status: GenericChargePointStatus): ConnectorStatusEnumType;
|
|
61
|
+
export type GenericOcppMeterValueContext = 'Transaction.Begin' | 'Transaction.End' | 'Sample.Clock' | 'Sample.Periodic' | 'Trigger' | 'Interruption.Begin' | 'Interruption.End';
|
|
62
|
+
export interface GenericOcppMeterValues {
|
|
63
|
+
context?: GenericOcppMeterValueContext;
|
|
64
|
+
outletVoltagePhase1: number;
|
|
65
|
+
outletVoltagePhase2: number;
|
|
66
|
+
outletVoltagePhase3: number;
|
|
67
|
+
outletCurrentPhase1: number;
|
|
68
|
+
outletCurrentPhase2: number;
|
|
69
|
+
outletCurrentPhase3: number;
|
|
70
|
+
powerImportByEvInWatt: number;
|
|
71
|
+
evStateOfChargeInPercent: number;
|
|
72
|
+
currentMeterValueInWattHours: number;
|
|
73
|
+
}
|
|
74
|
+
export declare function mapOCPP16MeterValueToGeneric(sampledValues: OCPP16MeterValueSampledValue[]): GenericOcppMeterValues;
|
|
75
|
+
export declare function mapOCPP201MeterValueToGeneric(sampledValues: OCPP201MeterValueSampledValue[]): GenericOcppMeterValues;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChargePointStatus = exports.RegistrationStatus = exports.OCPP16Action = void 0;
|
|
4
|
+
var OCPP16Action;
|
|
5
|
+
(function (OCPP16Action) {
|
|
6
|
+
OCPP16Action["Authorize"] = "Authorize";
|
|
7
|
+
OCPP16Action["BootNotification"] = "BootNotification";
|
|
8
|
+
OCPP16Action["CancelReservation"] = "CancelReservation";
|
|
9
|
+
OCPP16Action["ChangeAvailability"] = "ChangeAvailability";
|
|
10
|
+
OCPP16Action["ChangeConfiguration"] = "ChangeConfiguration";
|
|
11
|
+
OCPP16Action["ClearCache"] = "ClearCache";
|
|
12
|
+
OCPP16Action["ClearChargingProfile"] = "ClearChargingProfile";
|
|
13
|
+
OCPP16Action["DataTransfer"] = "DataTransfer";
|
|
14
|
+
OCPP16Action["DiagnosticsStatusNotification"] = "DiagnosticsStatusNotification";
|
|
15
|
+
OCPP16Action["FirmwareStatusNotification"] = "FirmwareStatusNotification";
|
|
16
|
+
OCPP16Action["GetConfiguration"] = "GetConfiguration";
|
|
17
|
+
OCPP16Action["GetDiagnostics"] = "GetDiagnostics";
|
|
18
|
+
OCPP16Action["GetLocalListVersion"] = "GetLocalListVersion";
|
|
19
|
+
OCPP16Action["Heartbeat"] = "Heartbeat";
|
|
20
|
+
OCPP16Action["MeterValues"] = "MeterValues";
|
|
21
|
+
OCPP16Action["RemoteStartTransaction"] = "RemoteStartTransaction";
|
|
22
|
+
OCPP16Action["RemoteStopTransaction"] = "RemoteStopTransaction";
|
|
23
|
+
OCPP16Action["ReserveNow"] = "ReserveNow";
|
|
24
|
+
OCPP16Action["Reset"] = "Reset";
|
|
25
|
+
OCPP16Action["SendLocalList"] = "SendLocalList";
|
|
26
|
+
OCPP16Action["SetChargingProfile"] = "SetChargingProfile";
|
|
27
|
+
OCPP16Action["StartTransaction"] = "StartTransaction";
|
|
28
|
+
OCPP16Action["StatusNotification"] = "StatusNotification";
|
|
29
|
+
OCPP16Action["StopTransaction"] = "StopTransaction";
|
|
30
|
+
OCPP16Action["TriggerMessage"] = "TriggerMessage";
|
|
31
|
+
OCPP16Action["UnlockConnector"] = "UnlockConnector";
|
|
32
|
+
OCPP16Action["UpdateFirmware"] = "UpdateFirmware";
|
|
33
|
+
})(OCPP16Action || (exports.OCPP16Action = OCPP16Action = {}));
|
|
34
|
+
var RegistrationStatus;
|
|
35
|
+
(function (RegistrationStatus) {
|
|
36
|
+
RegistrationStatus["Accepted"] = "Accepted";
|
|
37
|
+
RegistrationStatus["Pending"] = "Pending";
|
|
38
|
+
RegistrationStatus["Rejected"] = "Rejected";
|
|
39
|
+
})(RegistrationStatus || (exports.RegistrationStatus = RegistrationStatus = {}));
|
|
40
|
+
var ChargePointStatus;
|
|
41
|
+
(function (ChargePointStatus) {
|
|
42
|
+
ChargePointStatus["Available"] = "Available";
|
|
43
|
+
ChargePointStatus["Preparing"] = "Preparing";
|
|
44
|
+
ChargePointStatus["Charging"] = "Charging";
|
|
45
|
+
ChargePointStatus["SuspendedEVSE"] = "SuspendedEVSE";
|
|
46
|
+
ChargePointStatus["SuspendedEV"] = "SuspendedEV";
|
|
47
|
+
ChargePointStatus["Finishing"] = "Finishing";
|
|
48
|
+
ChargePointStatus["Reserved"] = "Reserved";
|
|
49
|
+
ChargePointStatus["Unavailable"] = "Unavailable";
|
|
50
|
+
ChargePointStatus["Faulted"] = "Faulted";
|
|
51
|
+
})(ChargePointStatus || (exports.ChargePointStatus = ChargePointStatus = {}));
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export declare enum OCPP16Action {
|
|
2
|
+
Authorize = "Authorize",
|
|
3
|
+
BootNotification = "BootNotification",
|
|
4
|
+
CancelReservation = "CancelReservation",
|
|
5
|
+
ChangeAvailability = "ChangeAvailability",
|
|
6
|
+
ChangeConfiguration = "ChangeConfiguration",
|
|
7
|
+
ClearCache = "ClearCache",
|
|
8
|
+
ClearChargingProfile = "ClearChargingProfile",
|
|
9
|
+
DataTransfer = "DataTransfer",
|
|
10
|
+
DiagnosticsStatusNotification = "DiagnosticsStatusNotification",
|
|
11
|
+
FirmwareStatusNotification = "FirmwareStatusNotification",
|
|
12
|
+
GetConfiguration = "GetConfiguration",
|
|
13
|
+
GetDiagnostics = "GetDiagnostics",
|
|
14
|
+
GetLocalListVersion = "GetLocalListVersion",
|
|
15
|
+
Heartbeat = "Heartbeat",
|
|
16
|
+
MeterValues = "MeterValues",
|
|
17
|
+
RemoteStartTransaction = "RemoteStartTransaction",
|
|
18
|
+
RemoteStopTransaction = "RemoteStopTransaction",
|
|
19
|
+
ReserveNow = "ReserveNow",
|
|
20
|
+
Reset = "Reset",
|
|
21
|
+
SendLocalList = "SendLocalList",
|
|
22
|
+
SetChargingProfile = "SetChargingProfile",
|
|
23
|
+
StartTransaction = "StartTransaction",
|
|
24
|
+
StatusNotification = "StatusNotification",
|
|
25
|
+
StopTransaction = "StopTransaction",
|
|
26
|
+
TriggerMessage = "TriggerMessage",
|
|
27
|
+
UnlockConnector = "UnlockConnector",
|
|
28
|
+
UpdateFirmware = "UpdateFirmware"
|
|
29
|
+
}
|
|
30
|
+
export declare enum RegistrationStatus {
|
|
31
|
+
Accepted = "Accepted",
|
|
32
|
+
Pending = "Pending",
|
|
33
|
+
Rejected = "Rejected"
|
|
34
|
+
}
|
|
35
|
+
export declare enum ChargePointStatus {
|
|
36
|
+
Available = "Available",
|
|
37
|
+
Preparing = "Preparing",
|
|
38
|
+
Charging = "Charging",
|
|
39
|
+
SuspendedEVSE = "SuspendedEVSE",
|
|
40
|
+
SuspendedEV = "SuspendedEV",
|
|
41
|
+
Finishing = "Finishing",
|
|
42
|
+
Reserved = "Reserved",
|
|
43
|
+
Unavailable = "Unavailable",
|
|
44
|
+
Faulted = "Faulted"
|
|
45
|
+
}
|
|
46
|
+
export interface OCPP16BootNotificationRequest {
|
|
47
|
+
chargePointVendor: string;
|
|
48
|
+
chargePointModel: string;
|
|
49
|
+
chargePointSerialNumber?: string;
|
|
50
|
+
chargeBoxSerialNumber?: string;
|
|
51
|
+
firmwareVersion?: string;
|
|
52
|
+
iccid?: string;
|
|
53
|
+
imsi?: string;
|
|
54
|
+
meterSerialNumber?: string;
|
|
55
|
+
meterType?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface OCPP16BootNotificationResponse {
|
|
58
|
+
status: RegistrationStatus;
|
|
59
|
+
currentTime: string;
|
|
60
|
+
interval: number;
|
|
61
|
+
}
|
|
62
|
+
export interface OCPP16HeartbeatRequest {
|
|
63
|
+
}
|
|
64
|
+
export interface OCPP16HeartbeatResponse {
|
|
65
|
+
currentTime: string;
|
|
66
|
+
}
|
|
67
|
+
export interface OCPP16StatusNotificationRequest {
|
|
68
|
+
connectorId: number;
|
|
69
|
+
status: ChargePointStatus;
|
|
70
|
+
errorCode: string;
|
|
71
|
+
info?: string;
|
|
72
|
+
timestamp?: string;
|
|
73
|
+
vendorId?: string;
|
|
74
|
+
vendorErrorCode?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface OCPP16StatusNotificationResponse {
|
|
77
|
+
}
|
|
78
|
+
export interface OCPP16AuthorizeRequest {
|
|
79
|
+
idTag: string;
|
|
80
|
+
}
|
|
81
|
+
export interface OCPP16AuthorizeResponse {
|
|
82
|
+
idTagInfo: {
|
|
83
|
+
status: 'Accepted' | 'Blocked' | 'Expired' | 'Invalid' | 'ConcurrentTx';
|
|
84
|
+
expiryDate?: string;
|
|
85
|
+
parentIdTag?: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface OCPP16StartTransactionRequest {
|
|
89
|
+
connectorId: number;
|
|
90
|
+
idTag: string;
|
|
91
|
+
meterStart: number;
|
|
92
|
+
timestamp: string;
|
|
93
|
+
reservationId?: number;
|
|
94
|
+
}
|
|
95
|
+
export interface OCPP16StartTransactionResponse {
|
|
96
|
+
transactionId: number;
|
|
97
|
+
idTagInfo: {
|
|
98
|
+
status: 'Accepted' | 'Blocked' | 'Expired' | 'Invalid' | 'ConcurrentTx';
|
|
99
|
+
expiryDate?: string;
|
|
100
|
+
parentIdTag?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface OCPP16StopTransactionRequest {
|
|
104
|
+
transactionId: number;
|
|
105
|
+
timestamp: string;
|
|
106
|
+
meterStop: number;
|
|
107
|
+
idTag?: string;
|
|
108
|
+
reason?: string;
|
|
109
|
+
transactionData?: any[];
|
|
110
|
+
}
|
|
111
|
+
export interface OCPP16StopTransactionResponse {
|
|
112
|
+
idTagInfo?: {
|
|
113
|
+
status: 'Accepted' | 'Blocked' | 'Expired' | 'Invalid' | 'ConcurrentTx';
|
|
114
|
+
expiryDate?: string;
|
|
115
|
+
parentIdTag?: string;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export type OCPP16MeterValueContext = 'Interruption.Begin' | 'Interruption.End' | 'Sample.Clock' | 'Sample.Periodic' | 'Transaction.Begin' | 'Transaction.End' | 'Trigger';
|
|
119
|
+
export type OCPP16MeterValueMeasurand = 'Voltage' | 'Current.Import' | 'Power.Active.Import' | 'SoC' | 'Power.Offered' | 'Energy.Active.Import.Register';
|
|
120
|
+
export interface OCPP16MeterValueSampledValue {
|
|
121
|
+
value: string;
|
|
122
|
+
format?: 'SignedData' | 'Raw';
|
|
123
|
+
measurand: OCPP16MeterValueMeasurand;
|
|
124
|
+
context?: OCPP16MeterValueContext;
|
|
125
|
+
location?: 'Outlet' | 'EV';
|
|
126
|
+
unit: 'V' | 'A' | 'W' | 'Percent' | 'Wh';
|
|
127
|
+
phase?: 'L1' | 'L2' | 'L3';
|
|
128
|
+
}
|
|
129
|
+
export interface OCPP16MeterValue {
|
|
130
|
+
timestamp: string;
|
|
131
|
+
sampledValue: OCPP16MeterValueSampledValue[];
|
|
132
|
+
}
|
|
133
|
+
export interface OCPP16MeterValuesMessage {
|
|
134
|
+
connectorId: number;
|
|
135
|
+
transactionId: number;
|
|
136
|
+
meterValue: OCPP16MeterValue[];
|
|
137
|
+
}
|