]> git.basschouten.com Git - openhab-addons.git/blob
64d8375ad4ec4522d35e5c43cc924d5ef34da823
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.solax.internal.model;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.solax.internal.connectivity.rawdata.RawDataBean;
18
19 /**
20  * The {@link InverterData} interface should implement the interface that returns the parsed data in human readable code
21  * and format.
22  *
23  * @author Konstantin Polihronov - Initial contribution
24  */
25 @NonNullByDefault
26 public interface InverterData extends RawDataBean {
27     @Nullable
28     String getWifiSerial();
29
30     @Nullable
31     String getWifiVersion();
32
33     InverterType getInverterType();
34
35     short getInverterVoltage();
36
37     short getInverterCurrent();
38
39     short getInverterOutputPower();
40
41     short getInverterFrequency();
42
43     short getPV1Voltage();
44
45     short getPV1Current();
46
47     short getPV1Power();
48
49     short getPV2Voltage();
50
51     short getPV2Current();
52
53     short getPV2Power();
54
55     default short getPVTotalPower() {
56         return (short) (getPV1Power() + getPV2Power());
57     }
58
59     default short getPVTotalCurrent() {
60         return (short) (getPV1Current() + getPV2Current());
61     }
62
63     short getBatteryVoltage(); // V / 100
64
65     short getBatteryCurrent(); // A / 100
66
67     short getBatteryPower(); // W
68
69     short getBatteryTemperature(); // temperature C
70
71     short getBatterySoC(); // % battery SoC
72
73     long getOnGridTotalYield(); // KWh total Yeld from the sun (to the grid?)
74
75     short getOnGridDailyYield(); // KWh daily Yeld from the sun (to the grid?)
76
77     long getTotalFeedInEnergy(); // KWh all times
78
79     long getTotalConsumption(); // KWh all times
80
81     short getFeedInPower();
82
83     default String toStringDetailed() {
84         return "WifiSerial = " + getWifiSerial() + ", WifiVersion = " + getWifiVersion() + ", InverterType = "
85                 + getInverterType() + ", InverterVoltage = " + getInverterVoltage() + "V, InverterCurrent = "
86                 + getInverterCurrent() + "A, InverterPower = " + getInverterOutputPower() + "W, BatteryPower = "
87                 + getBatteryPower() + "W, Battery SoC = " + getBatterySoC() + "%, FeedIn Power = " + getFeedInPower()
88                 + "W, Total PV Power = " + (getPV1Power() + getPV2Power()) + "W, Total Consumption = "
89                 + getTotalConsumption() + "kWh, Total Feed-in Energy = " + getTotalFeedInEnergy()
90                 + "kWh, Total On-Grid Yield = " + getOnGridTotalYield() + "kWh.";
91     }
92 }