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 all powermeters.
23 * This fields have been identified to exist:
24 * com.kiwigrid.devices.powermeter.PowerMeter=[
26 * ACCurrentConsumptionL1,
27 * ACCurrentConsumptionL2,
29 * ACCurrentConsumptionL3,
35 * ConsumptionPowerNet,
43 * PhaseOfMaximumImbalance,
59 * ConsumptionEnergySum,
72 * ACCurrentInjectionL3,
74 * ACCurrentInjectionL2,
75 * ConsumptionPowerSum,
76 * ACCurrentInjectionL1,
80 * ConsumptionEnergyL2,
81 * ConsumptionEnergyL1,
85 * ConsumptionEnergyL3,
88 * CapacitiveEnergySum,
95 * ConsumptionEnergyNet,
100 * @author Sven Carstens - Initial contribution
103 public class PowerMeter extends Device {
104 public static final String SOLAR_WATT_CLASSNAME = "com.kiwigrid.devices.powermeter.PowerMeter";
106 public PowerMeter(DeviceDTO deviceDTO) {
109 this.addStringState(CHANNEL_DIRECTION_METERING, deviceDTO);
110 this.addWattQuantity(CHANNEL_POWER_IN, deviceDTO);
111 this.addWattQuantity(CHANNEL_POWER_OUT, deviceDTO);
112 this.addWattHourQuantity(CHANNEL_WORK_IN, deviceDTO);
113 this.addWattHourQuantity(CHANNEL_WORK_OUT, deviceDTO);
114 this.addWattHourQuantity(CHANNEL_CONSUMPTION_ENERGY_SUM, deviceDTO);
118 protected String getSolarWattLabel() {