Class QueryHistoricTimeseriesExportXlsxResponse


  • public class QueryHistoricTimeseriesExportXlsxResponse
    extends Base64PayloadResponse
    Represents a JSON-RPC Response for 'queryHistoricTimeseriesExportXlxs'.

     {
       "jsonrpc": "2.0",
       "id": "UUID",
       "result": {
         "payload": Base64-String
       }
     }
     
    • Field Detail

      • GRID_BUY_ACTIVE_ENERGY

        public static ChannelAddress GRID_BUY_ACTIVE_ENERGY
      • GRID_SELL_ACTIVE_ENERGY

        public static ChannelAddress GRID_SELL_ACTIVE_ENERGY
      • PRODUCTION_ACTIVE_POWER

        public static ChannelAddress PRODUCTION_ACTIVE_POWER
      • PRODUCTION_ACTIVE_ENERGY

        public static ChannelAddress PRODUCTION_ACTIVE_ENERGY
      • CONSUMPTION_ACTIVE_POWER

        public static ChannelAddress CONSUMPTION_ACTIVE_POWER
      • CONSUMPTION_ACTIVE_ENERGY

        public static ChannelAddress CONSUMPTION_ACTIVE_ENERGY
      • ESS_DISCHARGE_POWER

        public static ChannelAddress ESS_DISCHARGE_POWER
      • ESS_DC_CHARGE_ENERGY

        public static ChannelAddress ESS_DC_CHARGE_ENERGY
      • ESS_DC_DISCHARGE_ENERGY

        public static ChannelAddress ESS_DC_DISCHARGE_ENERGY
      • POWER_CHANNELS

        public static java.util.Set<ChannelAddress> POWER_CHANNELS
        All Power Channels, i.e. Channels that are exported per channel and timestamp.
      • ENERGY_CHANNELS

        public static java.util.Set<ChannelAddress> ENERGY_CHANNELS
        All Energy Channels, i.e. exported with one value per channel.
    • Constructor Detail

      • QueryHistoricTimeseriesExportXlsxResponse

        public QueryHistoricTimeseriesExportXlsxResponse​(java.util.UUID id,
                                                         java.lang.String edgeId,
                                                         java.time.ZonedDateTime fromDate,
                                                         java.time.ZonedDateTime toDate,
                                                         java.util.SortedMap<java.time.ZonedDateTime,​java.util.SortedMap<ChannelAddress,​com.google.gson.JsonElement>> historicData,
                                                         java.util.SortedMap<ChannelAddress,​com.google.gson.JsonElement> historicEnergy)
                                                  throws java.io.IOException,
                                                         OpenemsError.OpenemsNamedException
        Constructs a QueryHistoricTimeseriesExportXlsxResponse.

        While constructing, the actual Excel file is generated as payload of the JSON-RPC Response.

        Parameters:
        id - the JSON-RPC ID
        edgeId - the Edge-ID
        fromDate - the start date of the export
        toDate - the end date of the export
        historicData - the power data per channel and timestamp
        historicEnergy - the energy data, one value per channel
        Throws:
        java.io.IOException - on error
        OpenemsError.OpenemsNamedException - on error
    • Method Detail

      • addBasicInfo

        protected static void addBasicInfo​(org.dhatim.fastexcel.Worksheet ws,
                                           java.lang.String edgId,
                                           java.time.ZonedDateTime fromDate,
                                           java.time.ZonedDateTime toDate)
        Adds basic information like the Edge-ID, date of creation,...
        Parameters:
        ws - the Worksheet
        edgeId - the edgeId number
        fromDate - the fromdate the excel exported from
        toDate - the todate the excel exported to
      • addStringValueBold

        protected static void addStringValueBold​(org.dhatim.fastexcel.Worksheet ws,
                                                 int row,
                                                 int col,
                                                 java.lang.String value)
        Helper method to add a value in bold font style to the excel sheet.
        Parameters:
        ws - the Worksheet
        row - row number
        col - column number
        value - actual value to be bold
      • addStringValueItalic

        protected static void addStringValueItalic​(org.dhatim.fastexcel.Worksheet ws,
                                                   int row,
                                                   int col,
                                                   java.lang.String value)
        Helper method to add a value in bold + italic font style to the excel sheet.
        Parameters:
        ws - the Worksheet
        row - row number
        column - column number
        value - actual value to be bold
      • addKwhValueIfnotNull

        protected static void addKwhValueIfnotNull​(org.dhatim.fastexcel.Worksheet ws,
                                                   int row,
                                                   int col,
                                                   com.google.gson.JsonElement jsonElement)
                                            throws OpenemsError.OpenemsNamedException
        Helper method to add a energy value in unit [Wh] to the excel sheet. The value is rounded to 100 Wh and formatted as [kWh]. If the value is 'null', "nicht vorhanden" is added instead.
        Parameters:
        ws - the Worksheet
        row - row number
        col - column number
        jsonElement - the value
        Throws:
        OpenemsError.OpenemsNamedException - on error
      • addStringValueRightAligned

        protected static void addStringValueRightAligned​(org.dhatim.fastexcel.Worksheet ws,
                                                         int row,
                                                         int col,
                                                         java.lang.String value)
        Helper method to add the value to the excel sheet.
        Parameters:
        ws - the Worksheet
        row - row number
        col - column number
        value - actual value in the sheet
      • addStringValue

        protected static void addStringValue​(org.dhatim.fastexcel.Worksheet ws,
                                             int row,
                                             int col,
                                             java.lang.String value)
        Helper method to add the value to the excel sheet.
        Parameters:
        ws - the Worksheet
        row - row number
        col - column number
        value - actual value in the sheet
      • addFloatValue

        protected static void addFloatValue​(org.dhatim.fastexcel.Worksheet ws,
                                            int row,
                                            int col,
                                            float value)
        Helper method to add the value to the excel sheet. The float value is mathematically rounded.
        Parameters:
        ws - the Worksheet
        row - row number
        col - column number
        value - actual value in the sheet