@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
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# enyo Energy App SDK
|
|
2
|
+
|
|
3
|
+
This is the official TypeScript Energy App SDK for enyo. If you want to build your own Energy App to publish it on the enyo Hub, this is the package you need!
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
You can install the package using npm:
|
|
8
|
+
```bash
|
|
9
|
+
npm install @enyo/energy-app-sdk
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Take a look on our CLI to init a project and publish a new Energy App easily.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Here's a basic example of how to use the client:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { EnergyApp } from '@enyo/energy-app-sdk';
|
|
20
|
+
|
|
21
|
+
const energyAppInstance = new EnergyApp();
|
|
22
|
+
|
|
23
|
+
energyAppInstance.register((packageName: string, version: number) => {
|
|
24
|
+
console.log(`network state is ${client.isOnline() ? 'online' : 'offline'}. Package ${packageName} version ${version} is registered.`);
|
|
25
|
+
// This starts you Energy App, do all the things in here!
|
|
26
|
+
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Advanced Modbus Integration
|
|
31
|
+
|
|
32
|
+
The SDK includes a powerful, vendor-agnostic Modbus implementation for energy management systems. This allows you to connect to any Modbus-enabled device through configuration without code changes.
|
|
33
|
+
|
|
34
|
+
### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **Vendor Agnostic** - Works with SMA, Fronius, Huawei, or any Modbus device via configuration
|
|
37
|
+
- **Type Safe** - Full TypeScript support with proper DataBus message types
|
|
38
|
+
- **Configurable** - Register addresses, data types, scaling all configurable
|
|
39
|
+
- **Fault Tolerant** - Built-in connection health monitoring and retry logic
|
|
40
|
+
- **Modular** - Clean separation between inverters, batteries, and meters
|
|
41
|
+
|
|
42
|
+
### 🚀 Quick Start
|
|
43
|
+
|
|
44
|
+
#### Basic Modbus Setup
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { EnergyApp } from '@enyo/energy-app-sdk';
|
|
48
|
+
import {
|
|
49
|
+
EnergyAppModbusInverter,
|
|
50
|
+
EnergyAppModbusBattery,
|
|
51
|
+
EnergyAppModbusMeter
|
|
52
|
+
} from '@enyo/energy-app-sdk';
|
|
53
|
+
|
|
54
|
+
const energyApp = new EnergyApp();
|
|
55
|
+
const dependencies = { client: energyApp, randomUUID: () => crypto.randomUUID() };
|
|
56
|
+
|
|
57
|
+
// Network device configuration
|
|
58
|
+
const networkDevice = {
|
|
59
|
+
id: 'device-1',
|
|
60
|
+
hostname: '192.168.1.100',
|
|
61
|
+
// ... other network device properties
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// Create configurable inverter
|
|
65
|
+
const modbusInverter = new EnergyAppModbusInverter(dependencies, {
|
|
66
|
+
name: [{ language: 'en', name: 'Solar Inverter' }],
|
|
67
|
+
registers: {
|
|
68
|
+
serialNumber: {
|
|
69
|
+
address: 400001,
|
|
70
|
+
dataType: 'uint16'
|
|
71
|
+
},
|
|
72
|
+
power: {
|
|
73
|
+
address: 400010,
|
|
74
|
+
dataType: 'int32',
|
|
75
|
+
required: true
|
|
76
|
+
},
|
|
77
|
+
voltageL1: {
|
|
78
|
+
address: 400020,
|
|
79
|
+
dataType: 'uint32',
|
|
80
|
+
scale: 2
|
|
81
|
+
},
|
|
82
|
+
totalEnergy: {
|
|
83
|
+
address: 400030,
|
|
84
|
+
dataType: 'uint32'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
options: {
|
|
88
|
+
unitId: 1,
|
|
89
|
+
timeout: 5000
|
|
90
|
+
}
|
|
91
|
+
}, networkDevice);
|
|
92
|
+
|
|
93
|
+
// Create battery with inverter dependency
|
|
94
|
+
const modbusBattery = new EnergyAppModbusBattery(dependencies, {
|
|
95
|
+
inverter: modbusInverter,
|
|
96
|
+
name: [{ language: 'en', name: 'Battery Storage' }],
|
|
97
|
+
registers: {
|
|
98
|
+
soc: {
|
|
99
|
+
address: 500001,
|
|
100
|
+
dataType: 'uint16',
|
|
101
|
+
required: true
|
|
102
|
+
},
|
|
103
|
+
current: {
|
|
104
|
+
address: 500005,
|
|
105
|
+
dataType: 'int16',
|
|
106
|
+
scale: 1
|
|
107
|
+
},
|
|
108
|
+
voltage: {
|
|
109
|
+
address: 500010,
|
|
110
|
+
dataType: 'uint16',
|
|
111
|
+
scale: 1
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
options: {}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Create standalone meter
|
|
118
|
+
const modbusMeter = new EnergyAppModbusMeter(dependencies, {
|
|
119
|
+
name: [{ language: 'en', name: 'Grid Meter' }],
|
|
120
|
+
registers: {
|
|
121
|
+
gridPower: {
|
|
122
|
+
address: 600001,
|
|
123
|
+
dataType: 'int32',
|
|
124
|
+
required: true
|
|
125
|
+
},
|
|
126
|
+
gridFeedInEnergy: {
|
|
127
|
+
address: 600010,
|
|
128
|
+
dataType: 'uint32'
|
|
129
|
+
},
|
|
130
|
+
gridConsumptionEnergy: {
|
|
131
|
+
address: 600020,
|
|
132
|
+
dataType: 'uint32'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
options: {
|
|
136
|
+
unitId: 2
|
|
137
|
+
}
|
|
138
|
+
}, networkDevice);
|
|
139
|
+
|
|
140
|
+
// Connect and start data collection
|
|
141
|
+
await modbusInverter.connect();
|
|
142
|
+
await modbusBattery.connect();
|
|
143
|
+
await modbusMeter.connect();
|
|
144
|
+
|
|
145
|
+
// Fetch data (returns proper DataBus messages)
|
|
146
|
+
const inverterData = await modbusInverter.updateData();
|
|
147
|
+
const batteryData = await modbusBattery.updateData();
|
|
148
|
+
const meterData = await modbusMeter.updateData();
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 📊 Supported Data Types
|
|
152
|
+
|
|
153
|
+
- `uint16` - 16-bit unsigned integer (1 register)
|
|
154
|
+
- `int16` - 16-bit signed integer (1 register)
|
|
155
|
+
- `uint32` - 32-bit unsigned integer (2 registers)
|
|
156
|
+
- `int32` - 32-bit signed integer (2 registers)
|
|
157
|
+
- `float32` - 32-bit float (2 registers)
|
|
158
|
+
|
|
159
|
+
### ⚙️ Register Configuration
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
interface EnergyAppModbusRegisterConfig {
|
|
163
|
+
address: number; // Modbus register address
|
|
164
|
+
dataType: EnergyAppModbusDataType; // Data type
|
|
165
|
+
scale?: number; // Scaling factor (FIX2 = scale 2)
|
|
166
|
+
quantity?: number; // Number of registers (auto-calculated)
|
|
167
|
+
required?: boolean; // Whether register is required
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 🔄 DataBus Integration
|
|
172
|
+
|
|
173
|
+
The Modbus implementation seamlessly integrates with the enyo DataBus using typed messages:
|
|
174
|
+
|
|
175
|
+
- `EnyoDataBusInverterValuesV1` - Inverter data messages
|
|
176
|
+
- `EnyoDataBusBatteryValuesUpdateV1` - Battery data messages
|
|
177
|
+
- `EnyoDataBusMeterValuesUpdateV1` - Meter data messages
|
|
178
|
+
|
|
179
|
+
All messages include proper timestamps and message types for seamless integration with the enyo platform.
|
|
180
|
+
|
|
181
|
+
### 🛠️ Error Handling
|
|
182
|
+
|
|
183
|
+
The implementation provides comprehensive error handling with specific error types:
|
|
184
|
+
|
|
185
|
+
- **EnergyAppModbusConfigurationError** - Invalid configuration parameters
|
|
186
|
+
- **EnergyAppModbusConnectionError** - Connection and communication failures
|
|
187
|
+
- **EnergyAppModbusReadError** - Register read failures with context
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
try {
|
|
191
|
+
await modbusInverter.connect();
|
|
192
|
+
const data = await modbusInverter.updateData();
|
|
193
|
+
} catch (error) {
|
|
194
|
+
if (error instanceof EnergyAppModbusConnectionError) {
|
|
195
|
+
console.error('Connection failed:', error.message);
|
|
196
|
+
// Handle connection issues
|
|
197
|
+
} else if (error instanceof EnergyAppModbusConfigurationError) {
|
|
198
|
+
console.error('Configuration error:', error.message);
|
|
199
|
+
// Fix configuration issues
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 🏗️ Architecture
|
|
205
|
+
|
|
206
|
+
The Modbus implementation follows a clean, modular architecture:
|
|
207
|
+
|
|
208
|
+
- **EnergyAppModbusInverter** - Configurable inverter implementation
|
|
209
|
+
- **EnergyAppModbusBattery** - Battery with inverter dependency support
|
|
210
|
+
- **EnergyAppModbusMeter** - Standalone meter implementation
|
|
211
|
+
- **EnergyAppModbusRegisterMapper** - Configuration-driven register access
|
|
212
|
+
- **EnergyAppModbusDataTypeConverter** - Vendor-agnostic data handling
|
|
213
|
+
- **EnergyAppModbusFaultTolerantReader** - Fault-tolerant communication layer
|
|
214
|
+
- **EnergyAppModbusConnectionHealth** - Connection health monitoring
|
|
215
|
+
|
|
216
|
+
This modular design ensures maintainability, testability, and extensibility for future enhancements.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ConnectInterval } from "./packages/connect-interval.cjs";
|
|
2
|
+
import { ConnectModbus } from "./packages/connect-modbus.cjs";
|
|
3
|
+
import { ConnectNetworkDevices } from "./packages/connect-network-devices.cjs";
|
|
4
|
+
import { ConnectStorage } from "./packages/connect-storage.cjs";
|
|
5
|
+
import { ConnectAppliances } from "./packages/connect-appliance.cjs";
|
|
6
|
+
/**
|
|
7
|
+
* Main API interface for Connect EMS packages.
|
|
8
|
+
* Provides access to all system capabilities including lifecycle management,
|
|
9
|
+
* network operations, storage, and device communication.
|
|
10
|
+
*/
|
|
11
|
+
export interface ConnectEmsApi {
|
|
12
|
+
/** Register a callback that gets called when the package is initialized */
|
|
13
|
+
register: (callback: (packageName: string, version: number) => void) => void;
|
|
14
|
+
/** Register a callback that gets called when the system is shutting down */
|
|
15
|
+
onShutdown: (callback: () => Promise<void>) => void;
|
|
16
|
+
/** Check if the system is currently online */
|
|
17
|
+
isOnline: () => boolean;
|
|
18
|
+
/** Get the fetch API for HTTP requests */
|
|
19
|
+
useFetch: () => typeof fetch;
|
|
20
|
+
/** Get the interval management API */
|
|
21
|
+
useInterval: () => ConnectInterval;
|
|
22
|
+
/** Get the Modbus communication API */
|
|
23
|
+
useModbus: () => ConnectModbus;
|
|
24
|
+
/** Get the network device discovery API */
|
|
25
|
+
useNetworkDevices: () => ConnectNetworkDevices;
|
|
26
|
+
/** Get the persistent storage API */
|
|
27
|
+
useStorage: () => ConnectStorage;
|
|
28
|
+
/** Get the Appliance API */
|
|
29
|
+
useAppliances: () => ConnectAppliances;
|
|
30
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectEmsPermissionEnum = void 0;
|
|
4
|
+
var ConnectEmsPermissionEnum;
|
|
5
|
+
(function (ConnectEmsPermissionEnum) {
|
|
6
|
+
ConnectEmsPermissionEnum["RestrictedInternetAccess"] = "RestrictedInternetAccess";
|
|
7
|
+
})(ConnectEmsPermissionEnum || (exports.ConnectEmsPermissionEnum = ConnectEmsPermissionEnum = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ConnectEmsPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'Modbus';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectPackageCategory = void 0;
|
|
4
|
+
exports.defineConnectEmsPackage = defineConnectEmsPackage;
|
|
5
|
+
var ConnectPackageCategory;
|
|
6
|
+
(function (ConnectPackageCategory) {
|
|
7
|
+
ConnectPackageCategory["Inverter"] = "inverter";
|
|
8
|
+
ConnectPackageCategory["Wallbox"] = "wallbox";
|
|
9
|
+
ConnectPackageCategory["Meter"] = "meter";
|
|
10
|
+
ConnectPackageCategory["SmartControl"] = "smart-control";
|
|
11
|
+
})(ConnectPackageCategory || (exports.ConnectPackageCategory = ConnectPackageCategory = {}));
|
|
12
|
+
function defineConnectEmsPackage(definition) {
|
|
13
|
+
return definition;
|
|
14
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ConnectEmsPermissionType } from "./connect-ems-permission.type.cjs";
|
|
2
|
+
export type ConnectPackageLanguage = 'de' | 'en';
|
|
3
|
+
export declare enum ConnectPackageCategory {
|
|
4
|
+
Inverter = "inverter",
|
|
5
|
+
Wallbox = "wallbox",
|
|
6
|
+
Meter = "meter",
|
|
7
|
+
SmartControl = "smart-control"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Configuration options for restricting internet access in a Connect EMS package.
|
|
11
|
+
* Defines which internet origins (domains) the EMS Integration is allowed to access.
|
|
12
|
+
*/
|
|
13
|
+
export interface ConnectPackageRestrictedInternetAccessOption {
|
|
14
|
+
/** List of allowed internet origins (domains) that the EMS Integration can access. Only these origins will be accessible. This information is shown to the user */
|
|
15
|
+
origins: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Optional configuration settings for a Connect EMS package.
|
|
19
|
+
*/
|
|
20
|
+
export interface ConnectPackageOptions {
|
|
21
|
+
/** Configuration for restricting internet access to specific domains */
|
|
22
|
+
restrictedInternetAccess?: ConnectPackageRestrictedInternetAccessOption;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Localized store entry information for a Connect EMS package.
|
|
26
|
+
* Contains all the display information shown to users in the package store.
|
|
27
|
+
*/
|
|
28
|
+
export interface ConnectPackageStoreEntry {
|
|
29
|
+
/** Language code for this store entry */
|
|
30
|
+
language: ConnectPackageLanguage;
|
|
31
|
+
/** Display title of the package */
|
|
32
|
+
title: string;
|
|
33
|
+
/** Brief description shown in package listings */
|
|
34
|
+
shortDescription: string;
|
|
35
|
+
/** Detailed description of the package functionality */
|
|
36
|
+
description: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Complete definition for a Connect EMS package.
|
|
40
|
+
* This interface defines all the metadata, permissions, and configuration
|
|
41
|
+
* required to register a package with the Connect EMS system.
|
|
42
|
+
*/
|
|
43
|
+
export interface ConnectPackageDefinition {
|
|
44
|
+
/** Schema version for the package definition format */
|
|
45
|
+
version: '1';
|
|
46
|
+
/** Unique identifier for the package */
|
|
47
|
+
packageName: string;
|
|
48
|
+
/** Categories that this package belongs to */
|
|
49
|
+
categories: ConnectPackageCategory[];
|
|
50
|
+
/** Localized store information for different languages */
|
|
51
|
+
storeEntry: ConnectPackageStoreEntry[];
|
|
52
|
+
/** Required permissions for this package to function */
|
|
53
|
+
permissions: ConnectEmsPermissionType[];
|
|
54
|
+
/** Optional configuration settings */
|
|
55
|
+
options?: ConnectPackageOptions;
|
|
56
|
+
}
|
|
57
|
+
export declare function defineConnectEmsPackage(definition: ConnectPackageDefinition): ConnectPackageDefinition;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnergyAppApplianceTypeEnum = void 0;
|
|
4
|
+
var EnergyAppApplianceTypeEnum;
|
|
5
|
+
(function (EnergyAppApplianceTypeEnum) {
|
|
6
|
+
EnergyAppApplianceTypeEnum["Inverter"] = "Inverter";
|
|
7
|
+
EnergyAppApplianceTypeEnum["Charger"] = "Charger";
|
|
8
|
+
EnergyAppApplianceTypeEnum["Storage"] = "Storage";
|
|
9
|
+
EnergyAppApplianceTypeEnum["Meter"] = "Meter";
|
|
10
|
+
EnergyAppApplianceTypeEnum["HeatPump"] = "heat-pump";
|
|
11
|
+
EnergyAppApplianceTypeEnum["EnergyManagement"] = "energy-management";
|
|
12
|
+
EnergyAppApplianceTypeEnum["BatteryStorage"] = "battery-storage";
|
|
13
|
+
EnergyAppApplianceTypeEnum["ClimateControl"] = "climate-control";
|
|
14
|
+
})(EnergyAppApplianceTypeEnum || (exports.EnergyAppApplianceTypeEnum = EnergyAppApplianceTypeEnum = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum EnergyAppApplianceTypeEnum {
|
|
2
|
+
Inverter = "Inverter",
|
|
3
|
+
Charger = "Charger",
|
|
4
|
+
Storage = "Storage",
|
|
5
|
+
Meter = "Meter",
|
|
6
|
+
HeatPump = "heat-pump",
|
|
7
|
+
EnergyManagement = "energy-management",
|
|
8
|
+
BatteryStorage = "battery-storage",
|
|
9
|
+
ClimateControl = "climate-control"
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EnergyAppPackageLanguage } from "./energy-app-package-definition.cjs";
|
|
2
|
+
export interface EnergyAppPackageConfigurationTranslatedValue {
|
|
3
|
+
/** Language code */
|
|
4
|
+
language: EnergyAppPackageLanguage;
|
|
5
|
+
/** The displayed value */
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EnergyAppPackageConfigurationSettingSelectOption {
|
|
9
|
+
value: string;
|
|
10
|
+
/** The displayed name of the option */
|
|
11
|
+
optionName: EnergyAppPackageConfigurationTranslatedValue[];
|
|
12
|
+
}
|
|
13
|
+
export interface EnergyAppPackageConfigurationSetting {
|
|
14
|
+
/** internal name of the setting */
|
|
15
|
+
name: string;
|
|
16
|
+
/** the type of the setting */
|
|
17
|
+
type: 'text' | 'select';
|
|
18
|
+
/** if the setting is required */
|
|
19
|
+
required: boolean;
|
|
20
|
+
/** The displayed name of the field */
|
|
21
|
+
fieldName: EnergyAppPackageConfigurationTranslatedValue[];
|
|
22
|
+
/** An optional description for the user*/
|
|
23
|
+
fieldDescription?: EnergyAppPackageConfigurationTranslatedValue[];
|
|
24
|
+
/** The optional default value or default selection value*/
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
selectOptions?: EnergyAppPackageConfigurationSettingSelectOption[];
|
|
27
|
+
}
|
|
28
|
+
export interface EnergyAppPackageConfiguration {
|
|
29
|
+
settings?: EnergyAppPackageConfigurationSetting[];
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnergyAppPackageCategory = void 0;
|
|
4
|
+
exports.defineEnergyAppPackage = defineEnergyAppPackage;
|
|
5
|
+
const version_js_1 = require("./version.cjs");
|
|
6
|
+
var EnergyAppPackageCategory;
|
|
7
|
+
(function (EnergyAppPackageCategory) {
|
|
8
|
+
EnergyAppPackageCategory["Inverter"] = "inverter";
|
|
9
|
+
EnergyAppPackageCategory["Wallbox"] = "wallbox";
|
|
10
|
+
EnergyAppPackageCategory["Meter"] = "meter";
|
|
11
|
+
EnergyAppPackageCategory["EnergyManagement"] = "energy-management";
|
|
12
|
+
EnergyAppPackageCategory["HeatPump"] = "heat-pump";
|
|
13
|
+
EnergyAppPackageCategory["BatteryStorage"] = "battery-storage";
|
|
14
|
+
EnergyAppPackageCategory["ClimateControl"] = "climate-control";
|
|
15
|
+
EnergyAppPackageCategory["ElectricityTariff"] = "electricity-tariff";
|
|
16
|
+
})(EnergyAppPackageCategory || (exports.EnergyAppPackageCategory = EnergyAppPackageCategory = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Defines an Energy App package with automatic SDK version injection.
|
|
19
|
+
* This function automatically adds the current SDK version to the package definition
|
|
20
|
+
* for debugging and compatibility tracking purposes.
|
|
21
|
+
*
|
|
22
|
+
* @param definition The Energy App package definition
|
|
23
|
+
* @returns The enhanced package definition with SDK version included
|
|
24
|
+
*/
|
|
25
|
+
function defineEnergyAppPackage(definition) {
|
|
26
|
+
return {
|
|
27
|
+
...definition,
|
|
28
|
+
sdkVersion: (0, version_js_1.getSdkVersion)()
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { EnergyAppPermissionType } from "./energy-app-permission.type.cjs";
|
|
2
|
+
export type EnergyAppPackageLanguage = 'de' | 'en';
|
|
3
|
+
export declare enum EnergyAppPackageCategory {
|
|
4
|
+
Inverter = "inverter",
|
|
5
|
+
Wallbox = "wallbox",
|
|
6
|
+
Meter = "meter",
|
|
7
|
+
EnergyManagement = "energy-management",
|
|
8
|
+
HeatPump = "heat-pump",
|
|
9
|
+
BatteryStorage = "battery-storage",
|
|
10
|
+
ClimateControl = "climate-control",
|
|
11
|
+
ElectricityTariff = "electricity-tariff"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Configuration options for restricting internet access in an Energy App package.
|
|
15
|
+
* Defines which internet origins (domains) the Energy App is allowed to access.
|
|
16
|
+
*/
|
|
17
|
+
export interface EnergyAppPackageRestrictedInternetAccessOption {
|
|
18
|
+
/** List of allowed internet origins (domains) that the Energy App can access. Only these origins will be accessible. This information is shown to the user */
|
|
19
|
+
origins: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Optional device detection configuration for hostname detection. The check is always lower case string
|
|
23
|
+
*/
|
|
24
|
+
export interface EnergyAppPackageOptionsDeviceDetectionHostname {
|
|
25
|
+
operation: 'eq' | 'startsWith';
|
|
26
|
+
matchingValue: string;
|
|
27
|
+
}
|
|
28
|
+
export interface EnergyAppPackageOptionsDeviceDetectionModbus {
|
|
29
|
+
unitIds: number[];
|
|
30
|
+
/** Register address, for example 30001 */
|
|
31
|
+
registerAddress: number;
|
|
32
|
+
/** Register size, for example 2 for 30001 - 30002 */
|
|
33
|
+
registerSize: number;
|
|
34
|
+
/** the data type of the register, numbers will be mapped to strings to compare with matching values */
|
|
35
|
+
type: 'string' | 'UInt32BE' | 'UInt16BE' | 'UInt32LE' | 'UInt16LE';
|
|
36
|
+
/** matching values, for example the vendor names or model names */
|
|
37
|
+
matchingValues: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface EnergyAppPackageOptionsDeviceDetectionHttp {
|
|
40
|
+
/** port of http call */
|
|
41
|
+
port: number;
|
|
42
|
+
/** path of http call */
|
|
43
|
+
path: string;
|
|
44
|
+
/** the operation to do */
|
|
45
|
+
operation: 'body_json_field_eq' | 'header_eq' | 'header_startsWith';
|
|
46
|
+
/** for rest APIs with json response, define the field for example device.vendor*/
|
|
47
|
+
field?: string;
|
|
48
|
+
headerName?: string;
|
|
49
|
+
/** matching values, for example the vendor names or model names */
|
|
50
|
+
matchingValues: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface EnergyAppPackageOptionsDeviceDetectionOcpp {
|
|
53
|
+
/** ocpp message name, for example BootNotification */
|
|
54
|
+
message: string;
|
|
55
|
+
/** field name in the boot notification */
|
|
56
|
+
field: string;
|
|
57
|
+
/** matching values, for example the vendor names or model names */
|
|
58
|
+
matchingValues: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Optional device detection configuration
|
|
62
|
+
*/
|
|
63
|
+
export interface EnergyAppPackageOptionsDeviceDetection {
|
|
64
|
+
hostName?: EnergyAppPackageOptionsDeviceDetectionHostname[];
|
|
65
|
+
modbus?: EnergyAppPackageOptionsDeviceDetectionModbus[];
|
|
66
|
+
http?: EnergyAppPackageOptionsDeviceDetectionHttp[];
|
|
67
|
+
ocpp?: EnergyAppPackageOptionsDeviceDetectionOcpp[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Optional configuration settings for an Energy App package.
|
|
71
|
+
*/
|
|
72
|
+
export interface EnergyAppPackageOptions {
|
|
73
|
+
/** Configuration for restricting internet access to specific domains */
|
|
74
|
+
restrictedInternetAccess?: EnergyAppPackageRestrictedInternetAccessOption;
|
|
75
|
+
/** device detection configuration to auto-suggest this energy app on onboarding */
|
|
76
|
+
deviceDetection?: EnergyAppPackageOptionsDeviceDetection;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Localized store entry information for an Energy App package.
|
|
80
|
+
* Contains all the display information shown to users in the package store.
|
|
81
|
+
*/
|
|
82
|
+
export interface EnergyAppPackageStoreEntry {
|
|
83
|
+
/** Language code for this store entry */
|
|
84
|
+
language: EnergyAppPackageLanguage;
|
|
85
|
+
/** Display title of the package */
|
|
86
|
+
title: string;
|
|
87
|
+
/** Brief description shown in package listings */
|
|
88
|
+
shortDescription: string;
|
|
89
|
+
/** Detailed description of the package functionality */
|
|
90
|
+
description: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Complete definition for a enyo Energy App package.
|
|
94
|
+
* This interface defines all the metadata, permissions, and configuration
|
|
95
|
+
* required to register a package with the enyo Hub.
|
|
96
|
+
*/
|
|
97
|
+
export interface EnergyAppPackageDefinition {
|
|
98
|
+
/** Schema version for the package definition format */
|
|
99
|
+
version: '1';
|
|
100
|
+
/** Unique identifier for the package */
|
|
101
|
+
packageName: string;
|
|
102
|
+
/** Optional path to the logo */
|
|
103
|
+
logo?: string;
|
|
104
|
+
/** Categories that this package belongs to */
|
|
105
|
+
categories: EnergyAppPackageCategory[];
|
|
106
|
+
/** Localized store information for different languages */
|
|
107
|
+
storeEntry: EnergyAppPackageStoreEntry[];
|
|
108
|
+
/** Required permissions for this package to function */
|
|
109
|
+
permissions: EnergyAppPermissionType[];
|
|
110
|
+
/** Optional configuration settings */
|
|
111
|
+
options?: EnergyAppPackageOptions;
|
|
112
|
+
/** The version of the enyo SDK used to build this package (automatically injected) */
|
|
113
|
+
sdkVersion: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Defines an Energy App package with automatic SDK version injection.
|
|
117
|
+
* This function automatically adds the current SDK version to the package definition
|
|
118
|
+
* for debugging and compatibility tracking purposes.
|
|
119
|
+
*
|
|
120
|
+
* @param definition The Energy App package definition
|
|
121
|
+
* @returns The enhanced package definition with SDK version included
|
|
122
|
+
*/
|
|
123
|
+
export declare function defineEnergyAppPackage(definition: Omit<EnergyAppPackageDefinition, 'sdkVersion'>): EnergyAppPackageDefinition;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnergyAppPermissionTypeEnum = void 0;
|
|
4
|
+
var EnergyAppPermissionTypeEnum;
|
|
5
|
+
(function (EnergyAppPermissionTypeEnum) {
|
|
6
|
+
EnergyAppPermissionTypeEnum["RestrictedInternetAccess"] = "RestrictedInternetAccess";
|
|
7
|
+
EnergyAppPermissionTypeEnum["NetworkDeviceDiscovery"] = "NetworkDeviceDiscovery";
|
|
8
|
+
EnergyAppPermissionTypeEnum["NetworkDeviceSearch"] = "NetworkDeviceSearch";
|
|
9
|
+
EnergyAppPermissionTypeEnum["NetworkDeviceAccess"] = "NetworkDeviceAccess";
|
|
10
|
+
EnergyAppPermissionTypeEnum["Modbus"] = "Modbus";
|
|
11
|
+
EnergyAppPermissionTypeEnum["Storage"] = "Storage";
|
|
12
|
+
EnergyAppPermissionTypeEnum["Appliance"] = "Appliance";
|
|
13
|
+
EnergyAppPermissionTypeEnum["AllAppliances"] = "AllAppliances";
|
|
14
|
+
EnergyAppPermissionTypeEnum["SendDataBusValues"] = "SendDataBusValues";
|
|
15
|
+
EnergyAppPermissionTypeEnum["SubscribeDataBus"] = "SubscribeDataBus";
|
|
16
|
+
EnergyAppPermissionTypeEnum["SendDataBusCommands"] = "SendDataBusCommands";
|
|
17
|
+
EnergyAppPermissionTypeEnum["OcppServer"] = "OcppServer";
|
|
18
|
+
EnergyAppPermissionTypeEnum["ChargingCard"] = "ChargingCard";
|
|
19
|
+
EnergyAppPermissionTypeEnum["Vehicle"] = "Vehicle";
|
|
20
|
+
EnergyAppPermissionTypeEnum["Charge"] = "Charge";
|
|
21
|
+
})(EnergyAppPermissionTypeEnum || (exports.EnergyAppPermissionTypeEnum = EnergyAppPermissionTypeEnum = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer';
|
|
2
|
+
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
|
+
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
|
+
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
5
|
+
NetworkDeviceSearch = "NetworkDeviceSearch",
|
|
6
|
+
NetworkDeviceAccess = "NetworkDeviceAccess",
|
|
7
|
+
Modbus = "Modbus",
|
|
8
|
+
Storage = "Storage",
|
|
9
|
+
Appliance = "Appliance",
|
|
10
|
+
AllAppliances = "AllAppliances",
|
|
11
|
+
SendDataBusValues = "SendDataBusValues",
|
|
12
|
+
SubscribeDataBus = "SubscribeDataBus",
|
|
13
|
+
SendDataBusCommands = "SendDataBusCommands",
|
|
14
|
+
OcppServer = "OcppServer",
|
|
15
|
+
ChargingCard = "ChargingCard",
|
|
16
|
+
Vehicle = "Vehicle",
|
|
17
|
+
Charge = "Charge"
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnergyAppStateEnum = void 0;
|
|
4
|
+
var EnergyAppStateEnum;
|
|
5
|
+
(function (EnergyAppStateEnum) {
|
|
6
|
+
EnergyAppStateEnum["Launching"] = "launching";
|
|
7
|
+
EnergyAppStateEnum["Running"] = "running";
|
|
8
|
+
/** This state tells the user that a configuration is required which blocks the energy app from running*/
|
|
9
|
+
EnergyAppStateEnum["ConfigurationRequired"] = "configuration-required";
|
|
10
|
+
/** This state tells the user that an internet connection of the system is required which blocks the energy app from running*/
|
|
11
|
+
EnergyAppStateEnum["InternetConnectionRequired"] = "internet-connection-required";
|
|
12
|
+
})(EnergyAppStateEnum || (exports.EnergyAppStateEnum = EnergyAppStateEnum = {}));
|