2 * Copyright (c) 2010-2023 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.solax.internal.model;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.solax.internal.connectivity.rawdata.RawDataBean;
20 * The {@link InverterData} interface should implement the interface that returns the parsed data in human readable code
23 * @author Konstantin Polihronov - Initial contribution
26 public interface InverterData extends RawDataBean {
28 String getWifiSerial();
31 String getWifiVersion();
33 InverterType getInverterType();
35 short getInverterVoltage();
37 short getInverterCurrent();
39 short getInverterOutputPower();
41 short getInverterFrequency();
43 short getPV1Voltage();
45 short getPV1Current();
49 short getPV2Voltage();
51 short getPV2Current();
55 default short getPVTotalPower() {
56 return (short) (getPV1Power() + getPV2Power());
59 default short getPVTotalCurrent() {
60 return (short) (getPV1Current() + getPV2Current());
63 short getBatteryVoltage(); // V / 100
65 short getBatteryCurrent(); // A / 100
67 short getBatteryPower(); // W
69 short getBatteryTemperature(); // temperature C
71 short getBatterySoC(); // % battery SoC
73 long getOnGridTotalYield(); // KWh total Yeld from the sun (to the grid?)
75 short getOnGridDailyYield(); // KWh daily Yeld from the sun (to the grid?)
77 long getTotalFeedInEnergy(); // KWh all times
79 long getTotalConsumption(); // KWh all times
81 short getFeedInPower();
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.";