]> git.basschouten.com Git - openhab-addons.git/blob
c58bba6d8a07520e5861d64b93dd46995476051b
[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.nikohomecontrol.internal.protocol.nhc2;
14
15 import java.util.List;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * {@link NhcDevice2} represents a Niko Home Control II device. It is used when parsing the device response json and
22  * when creating the state update json to send to the Connected Controller.
23  *
24  * @author Mark Herwege - Initial Contribution
25  */
26 @NonNullByDefault
27 class NhcDevice2 {
28     static class NhcProperty {
29         // fields for lights
30         @Nullable
31         String status;
32         @Nullable
33         String brightness;
34         @Nullable
35         String aligned;
36         @Nullable
37         String basicState;
38         // fields for motors
39         @Nullable
40         String action;
41         @Nullable
42         String position;
43         @Nullable
44         String moving;
45         // fields for thermostats and hvac
46         @Nullable
47         String setpointTemperature;
48         @Nullable
49         String program;
50         @Nullable
51         String overruleActive;
52         @Nullable
53         String overruleSetpoint;
54         @Nullable
55         String overruleTime;
56         @Nullable
57         String ecoSave;
58         @Nullable
59         String demand;
60         @Nullable
61         String operationMode;
62         @Nullable
63         String ambientTemperature;
64         @Nullable
65         String protectMode;
66         @Nullable
67         String thermostatOn;
68         @Nullable
69         String hvacOn;
70         // fields for fans and ventilation
71         @Nullable
72         String fanSpeed;
73         // fields for electricity metering
74         @Nullable
75         String electricalEnergy;
76         @Nullable
77         String electricalPower;
78         @Nullable
79         String electricalPowerToGrid;
80         @Nullable
81         String electricalPowerFromGrid;
82         @Nullable
83         String electricalPowerProduction;
84         @Nullable
85         String electricalPowerSelfConsumption;
86         @Nullable
87         String electricalPowerConsumption;
88         @Nullable
89         String electricalPowerProductionThresholdExceeded;
90         @Nullable
91         String reportInstantUsage;
92         // fields for access control
93         @Nullable
94         String doorlock;
95     }
96
97     static class NhcTrait {
98         @Nullable
99         String macAddress;
100         // fields for energyMeters metering
101         @Nullable
102         String channel;
103         @Nullable
104         String meterType;
105     }
106
107     static class NhcParameter {
108         @Nullable
109         String locationId;
110         @Nullable
111         String locationName;
112         @Nullable
113         String locationIcon;
114         // fields for electricity metering
115         @Nullable
116         String flow;
117         @Nullable
118         String segment;
119         @Nullable
120         String clampType;
121         @Nullable
122         String shortName;
123     }
124
125     String name = "";
126     String uuid = "";
127     String technology = "";
128     String identifier = "";
129     String model = "";
130     String type = "";
131     String online = "";
132     @Nullable
133     List<NhcProperty> properties;
134     @Nullable
135     List<NhcTrait> traits;
136     @Nullable
137     List<NhcParameter> parameters;
138 }