]> git.basschouten.com Git - openhab-addons.git/blob
f4b953a73720d4772914a81924636b74c1743602
[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 all powermeters.
22  *
23  * This fields have been identified to exist:
24  * com.kiwigrid.devices.powermeter.PowerMeter=[
25  * InductiveEnergySum,
26  * ACCurrentConsumptionL1,
27  * ACCurrentConsumptionL2,
28  * ACCurrentN,
29  * ACCurrentConsumptionL3,
30  * ApparentPowerL2,
31  * ConsumptionPowerL3,
32  * ConsumptionPowerL2,
33  * ApparentPowerL3,
34  * ApparentPowerL1,
35  * ConsumptionPowerNet,
36  * ReactivePowerL1,
37  * ReactivePowerL2,
38  * InductiveEnergyL2,
39  * InductiveEnergyL1,
40  * ReactivePowerL3,
41  * CapacitiveEnergyL2,
42  * CapacitiveEnergyL1,
43  * PhaseOfMaximumImbalance,
44  * InjectionPowerL1,
45  * ReactivePowerSum,
46  * ActivePowerL3,
47  * InjectionPowerL2,
48  * InjectionPowerL3,
49  * ActivePowerL1,
50  * ConsumptionPowerL1,
51  * InjectionEnergySum,
52  * ActivePowerL2,
53  * ImbalanceL1,
54  * InjectionPowerNet,
55  * ImbalanceL2,
56  * ImbalanceL3,
57  * CapacitiveEnergyL3,
58  * DirectionMetering,
59  * ConsumptionEnergySum,
60  * PowerOut,
61  * InjectionEnergyNet,
62  * ACVoltageL1,
63  * ACVoltageL2,
64  * ACVoltageL3,
65  * MaximumImbalance,
66  * CosinusPhiL3,
67  * CosinusPhiL2,
68  * CosinusPhiL1,
69  * FrequencyL1,
70  * FrequencyL3,
71  * FrequencyL2,
72  * ACCurrentInjectionL3,
73  * InjectionEnergyL3,
74  * ACCurrentInjectionL2,
75  * ConsumptionPowerSum,
76  * ACCurrentInjectionL1,
77  * InjectionEnergyL1,
78  * InjectionEnergyL2,
79  * ActivePowerSum,
80  * ConsumptionEnergyL2,
81  * ConsumptionEnergyL1,
82  * PowerFactorL1,
83  * PowerFactorL2,
84  * InjectionPowerSum,
85  * ConsumptionEnergyL3,
86  * PowerFactorL3,
87  * ACCurrentL3,
88  * CapacitiveEnergySum,
89  * WorkIn,
90  * InductiveEnergyL3,
91  * PowerIn,
92  * ACCurrentL1,
93  * ACCurrentL2,
94  * FrequencyGrid,
95  * ConsumptionEnergyNet,
96  * ApparentPowerSum,
97  * WorkOut
98  * ]
99  *
100  * @author Sven Carstens - Initial contribution
101  */
102 @NonNullByDefault
103 public class PowerMeter extends Device {
104     public static final String SOLAR_WATT_CLASSNAME = "com.kiwigrid.devices.powermeter.PowerMeter";
105
106     public PowerMeter(DeviceDTO deviceDTO) {
107         super(deviceDTO);
108
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);
115     }
116
117     @Override
118     protected String getSolarWattLabel() {
119         return "PowerMeter";
120     }
121 }