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.solarwatt.internal.domain.model;
15 import static org.openhab.binding.solarwatt.internal.SolarwattBindingConstants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.solarwatt.internal.domain.dto.DeviceDTO;
21 * Base class for everything supplying battery base power.
23 * This fields have been identified to exist:
24 * com.kiwigrid.devices.batteryconverter.BatteryConverter=[
28 * ResistanceBatteryMean,
30 * VoltageBatteryCellMax,
33 * StateOfChargeMinimum,
34 * StateEqualizingChargeRequiredIsSet,
36 * VoltageBatteryCellMin,
37 * VoltageBatteryCellMean,
45 * TemperatureBatteryCellMax,
47 * TemperatureBatteryMin,
48 * ResistanceBatteryMin,
49 * StateOfChargeMinimumLimit,
55 * ResistanceBatteryString,
56 * VoltageBatteryString,
57 * IdSerialNumberBatteryModules,
58 * CountBatteryModules,
60 * TemperatureBatteryMax,
61 * TemperatureBatteryCellMin,
62 * StateOfChargeReactivateDischarging,
63 * IdMyReserveSetupRole,
64 * ResistanceBatteryMax,
68 * StateOfChargeShutDownLimit,
69 * CountBatteryContactor,
71 * TimeEqualizingChargeRemaining,
73 * MapInstallationDetails
76 * @author Sven Carstens - Initial contribution
79 public class BatteryConverter extends Inverter {
80 public static final String SOLAR_WATT_CLASSNAME = "com.kiwigrid.devices.batteryconverter.BatteryConverter";
82 public BatteryConverter(DeviceDTO deviceDTO) {
87 public void update(DeviceDTO deviceDTO) {
88 super.update(deviceDTO);
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);
102 protected String getSolarWattLabel() {
103 return "BatteryConverter";