]> git.basschouten.com Git - openhab-addons.git/blob
3ed56425dc5bba3cf1f9acf05110b4d0ebb5aa4b
[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.solarwatt.internal.domain.model;
14
15 import static org.openhab.binding.solarwatt.internal.SolarwattBindingConstants.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.solarwatt.internal.domain.dto.DeviceDTO;
19
20 /**
21  * Base class for everything supplying battery base power.
22  *
23  * This fields have been identified to exist:
24  * com.kiwigrid.devices.batteryconverter.BatteryConverter=[
25  * PowerACIn,
26  * UpTimePDG,
27  * CurrentStringDCIn,
28  * ResistanceBatteryMean,
29  * CurrentBatteryIn,
30  * VoltageBatteryCellMax,
31  * VoltageGRMOut,
32  * FactorForecast,
33  * StateOfChargeMinimum,
34  * StateEqualizingChargeRequiredIsSet,
35  * WorkCharge,
36  * VoltageBatteryCellMin,
37  * VoltageBatteryCellMean,
38  * StateOfHealth,
39  * FactorForecastCAN,
40  * StateOfCharge,
41  * IdFirmwareGRM,
42  * WorkCapacity,
43  * CurrentGRMOut,
44  * StatePDG,
45  * TemperatureBatteryCellMax,
46  * TemperatureGRM,
47  * TemperatureBatteryMin,
48  * ResistanceBatteryMin,
49  * StateOfChargeMinimumLimit,
50  * IdUrlPdg,
51  * TemperatureBattery,
52  * VoltageGRMIn,
53  * CurrentGRMIn,
54  * IdSerialNumberGRM,
55  * ResistanceBatteryString,
56  * VoltageBatteryString,
57  * IdSerialNumberBatteryModules,
58  * CountBatteryModules,
59  * ModeConverter,
60  * TemperatureBatteryMax,
61  * TemperatureBatteryCellMin,
62  * StateOfChargeReactivateDischarging,
63  * IdMyReserveSetupRole,
64  * ResistanceBatteryMax,
65  * AvailableModes,
66  * PowerACInMax,
67  * PowerACInLimit,
68  * StateOfChargeShutDownLimit,
69  * CountBatteryContactor,
70  * CurrentBatteryOut,
71  * TimeEqualizingChargeRemaining,
72  * WorkACIn,
73  * MapInstallationDetails
74  * ]
75  *
76  * @author Sven Carstens - Initial contribution
77  */
78 @NonNullByDefault
79 public class BatteryConverter extends Inverter {
80     public static final String SOLAR_WATT_CLASSNAME = "com.kiwigrid.devices.batteryconverter.BatteryConverter";
81
82     public BatteryConverter(DeviceDTO deviceDTO) {
83         super(deviceDTO);
84     }
85
86     @Override
87     public void update(DeviceDTO deviceDTO) {
88         super.update(deviceDTO);
89
90         this.addSwitchState(CHANNEL_MODE_CONVERTER, deviceDTO);
91         this.addPercentQuantity(CHANNEL_STATE_OF_CHARGE, deviceDTO);
92         this.addPercentQuantity(CHANNEL_STATE_OF_HEALTH, deviceDTO);
93         this.addCelsiusQuantity(CHANNEL_TEMPERATURE_BATTERY, deviceDTO);
94         this.addWattHourQuantity(CHANNEL_WORK_AC_IN, deviceDTO);
95         this.addWattQuantity(CHANNEL_POWER_AC_IN, deviceDTO);
96         this.addVoltageQuantity(CHANNEL_VOLTAGE_BATTERY_CELL_MIN, deviceDTO, true);
97         this.addVoltageQuantity(CHANNEL_VOLTAGE_BATTERY_CELL_MEAN, deviceDTO, true);
98         this.addVoltageQuantity(CHANNEL_VOLTAGE_BATTERY_CELL_MAX, deviceDTO, true);
99     }
100
101     @Override
102     protected String getSolarWattLabel() {
103         return "BatteryConverter";
104     }
105 }