]> git.basschouten.com Git - openhab-addons.git/blob
b6d37bb26971c12b3cd11fa69b2b81fba451ea7f
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.solarforecast.internal.actions;
14
15 import java.time.Instant;
16 import java.time.LocalDate;
17
18 import javax.measure.quantity.Energy;
19 import javax.measure.quantity.Power;
20
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;
25
26 /**
27  * The {@link SolarForecast} Interface needed for Actions
28  *
29  * @author Bernd Weymann - Initial contribution
30  */
31 @NonNullByDefault
32 public interface SolarForecast {
33     /**
34      * Argument can be used to query an average forecast scenario
35      */
36     public static final String AVERAGE = "average";
37     /**
38      * Argument can be used to query an optimistic forecast scenario
39      */
40     public static final String OPTIMISTIC = "optimistic";
41     /**
42      * Argument can be used to query a pessimistic forecast scenario
43      */
44     public static final String PESSIMISTIC = "pessimistic";
45
46     /**
47      * Returns electric energy production for one day
48      *
49      * @param date
50      * @param args possible arguments from this interface
51      * @return QuantityType<Energy> in kW/h
52      */
53     QuantityType<Energy> getDay(LocalDate date, String... args);
54
55     /**
56      * Returns electric energy between two timestamps
57      *
58      * @param start
59      * @param end
60      * @param args possible arguments from this interface
61      * @return QuantityType<Energy> in kW/h
62      */
63     QuantityType<Energy> getEnergy(Instant start, Instant end, String... args);
64
65     /**
66      * Returns electric power at one specific point of time
67      *
68      * @param timestamp
69      * @param args possible arguments from this interface
70      * @return QuantityType<Power> in kW
71      */
72     QuantityType<Power> getPower(Instant timestamp, String... args);
73
74     /**
75      * Get the first date and time of forecast data
76      *
77      * @return date time
78      */
79     Instant getForecastBegin();
80
81     /**
82      * Get the last date and time of forecast data
83      *
84      * @return date time
85      */
86     Instant getForecastEnd();
87
88     /**
89      * Get TimeSeries for Power forecast
90      *
91      * @param mode QueryMode for optimistic, pessimistic or average estimation
92      * @return TimeSeries containing QuantityType<Power>
93      */
94     TimeSeries getPowerTimeSeries(QueryMode mode);
95
96     /**
97      * Get TimeSeries for Energy forecast
98      *
99      * @param mode QueryMode for optimistic, pessimistic or average estimation
100      * @return TimeSeries containing QuantityType<Energy>
101      */
102     TimeSeries getEnergyTimeSeries(QueryMode mode);
103
104     /**
105      * SolarForecast identifier
106      *
107      * @return unique String to identify solar plane
108      */
109     String getIdentifier();
110 }