2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.solarforecast.internal.actions;
15 import java.time.Instant;
16 import java.time.LocalDate;
18 import javax.measure.quantity.Energy;
19 import javax.measure.quantity.Power;
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.openhab.binding.solarforecast.internal.solcast.SolcastObject.QueryMode;
23 import org.openhab.core.library.types.QuantityType;
24 import org.openhab.core.types.TimeSeries;
27 * The {@link SolarForecast} Interface needed for Actions
29 * @author Bernd Weymann - Initial contribution
32 public interface SolarForecast {
34 * Argument can be used to query an average forecast scenario
36 public static final String AVERAGE = "average";
38 * Argument can be used to query an optimistic forecast scenario
40 public static final String OPTIMISTIC = "optimistic";
42 * Argument can be used to query a pessimistic forecast scenario
44 public static final String PESSIMISTIC = "pessimistic";
47 * Returns electric energy production for one day
50 * @param args possible arguments from this interface
51 * @return QuantityType<Energy> in kW/h
53 QuantityType<Energy> getDay(LocalDate date, String... args);
56 * Returns electric energy between two timestamps
60 * @param args possible arguments from this interface
61 * @return QuantityType<Energy> in kW/h
63 QuantityType<Energy> getEnergy(Instant start, Instant end, String... args);
66 * Returns electric power at one specific point of time
69 * @param args possible arguments from this interface
70 * @return QuantityType<Power> in kW
72 QuantityType<Power> getPower(Instant timestamp, String... args);
75 * Get the first date and time of forecast data
79 Instant getForecastBegin();
82 * Get the last date and time of forecast data
86 Instant getForecastEnd();
89 * Get TimeSeries for Power forecast
91 * @param mode QueryMode for optimistic, pessimistic or average estimation
92 * @return TimeSeries containing QuantityType<Power>
94 TimeSeries getPowerTimeSeries(QueryMode mode);
97 * Get TimeSeries for Energy forecast
99 * @param mode QueryMode for optimistic, pessimistic or average estimation
100 * @return TimeSeries containing QuantityType<Energy>
102 TimeSeries getEnergyTimeSeries(QueryMode mode);
105 * SolarForecast identifier
107 * @return unique String to identify solar plane
109 String getIdentifier();