Skip to content

Commit b3876ad

Browse files
authored
[homewizard] Support for kWh meter, Plug-in Battery and API v2. (openhab#18099)
* Added support for kWh meter, Plug-in Battery and API v2. Signed-off-by: Gearrel Welvaart <[email protected]>
1 parent 2155b66 commit b3876ad

File tree

67 files changed

+4402
-1204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4402
-1204
lines changed

bundles/org.openhab.binding.homewizard/README.md

+65-43
Large diffs are not rendered by default.

bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardBindingConstants.java

+84-19
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,111 @@
2020
* used across the full binding.
2121
*
2222
* @author Daniël van Os - Initial contribution
23+
* @author Gearrel Welvaart - Added constants
24+
*
2325
*/
2426
@NonNullByDefault
2527
public class HomeWizardBindingConstants {
2628

2729
private static final String BINDING_ID = "homewizard";
2830

31+
// List of supported devices
32+
public static final String HWE_P1 = "hwe-p1";
33+
public static final String HWE_SKT = "hwe-skt";
34+
public static final String HWE_WTR = "hwe-wtr";
35+
public static final String HWE_KWH = "hwe-kwh";
36+
public static final String HWE_KWH1 = "hwe-kwh1";
37+
public static final String HWE_KWH3 = "hwe-kwh3";
38+
public static final String SDM230_WIFI = "sdm230-wifi";
39+
public static final String SDM630_WIFI = "sdm630-wifi";
40+
public static final String HWE_BAT = "hwe-bat";
41+
2942
// List of all Thing Type UIDs
43+
public static final ThingTypeUID THING_TYPE_HWE_P1 = new ThingTypeUID(BINDING_ID, HWE_P1);
44+
public static final ThingTypeUID THING_TYPE_HWE_SKT = new ThingTypeUID(BINDING_ID, HWE_SKT);
45+
public static final ThingTypeUID THING_TYPE_HWE_WTR = new ThingTypeUID(BINDING_ID, HWE_WTR);
46+
public static final ThingTypeUID THING_TYPE_HWE_KWH = new ThingTypeUID(BINDING_ID, HWE_KWH);
47+
public static final ThingTypeUID THING_TYPE_HWE_BAT = new ThingTypeUID(BINDING_ID, HWE_BAT);
48+
3049
public static final ThingTypeUID THING_TYPE_P1_METER = new ThingTypeUID(BINDING_ID, "p1_wifi_meter");
3150
public static final ThingTypeUID THING_TYPE_ENERGY_SOCKET = new ThingTypeUID(BINDING_ID, "energy_socket");
3251
public static final ThingTypeUID THING_TYPE_WATERMETER = new ThingTypeUID(BINDING_ID, "watermeter");
3352

34-
// List of all Channel ids
35-
public static final String CHANNEL_ACTIVE_CURRENT = "active_current";
36-
public static final String CHANNEL_ACTIVE_CURRENT_L1 = "active_current_l1";
37-
public static final String CHANNEL_ACTIVE_CURRENT_L2 = "active_current_l2";
38-
public static final String CHANNEL_ACTIVE_CURRENT_L3 = "active_current_l3";
39-
public static final String CHANNEL_ACTIVE_POWER = "active_power";
40-
public static final String CHANNEL_ACTIVE_POWER_L1 = "active_power_l1";
41-
public static final String CHANNEL_ACTIVE_POWER_L2 = "active_power_l2";
42-
public static final String CHANNEL_ACTIVE_POWER_L3 = "active_power_l3";
43-
public static final String CHANNEL_ACTIVE_VOLTAGE = "active_voltage";
44-
public static final String CHANNEL_ACTIVE_VOLTAGE_L1 = "active_voltage_l1";
45-
public static final String CHANNEL_ACTIVE_VOLTAGE_L2 = "active_voltage_l2";
46-
public static final String CHANNEL_ACTIVE_VOLTAGE_L3 = "active_voltage_l3";
53+
// Channel Groups
54+
public static final String CHANNEL_GROUP_ENERGY = "energy";
55+
public static final String CHANNEL_GROUP_WATER = "water";
56+
public static final String CHANNEL_GROUP_SKT_CONTROL = "control";
57+
58+
// Energy Meter Channels
59+
public static final String CHANNEL_ENERGY_IMPORT = "energy_import";
60+
public static final String CHANNEL_ENERGY_IMPORT_T1 = "energy_import_t1";
61+
public static final String CHANNEL_ENERGY_IMPORT_T2 = "energy_import_t2";
62+
public static final String LEGACY_CHANNEL_ENERGY_IMPORT_T1 = "total_energy_import_t1";
63+
public static final String LEGACY_CHANNEL_ENERGY_IMPORT_T2 = "total_energy_import_t2";
64+
65+
public static final String CHANNEL_ENERGY_EXPORT = "energy_export";
66+
public static final String CHANNEL_ENERGY_EXPORT_T1 = "energy_export_t1";
67+
public static final String CHANNEL_ENERGY_EXPORT_T2 = "energy_export_t2";
68+
public static final String LEGACY_CHANNEL_ENERGY_EXPORT_T1 = "total_energy_export_t1";
69+
public static final String LEGACY_CHANNEL_ENERGY_EXPORT_T2 = "total_energy_export_t2";
70+
71+
public static final String CHANNEL_POWER = "power";
72+
public static final String CHANNEL_POWER_L1 = "power_l1";
73+
public static final String CHANNEL_POWER_L2 = "power_l2";
74+
public static final String CHANNEL_POWER_L3 = "power_l3";
75+
public static final String LEGACY_CHANNEL_POWER = "active_power";
76+
public static final String LEGACY_CHANNEL_POWER_L1 = "active_power_l1";
77+
public static final String LEGACY_CHANNEL_POWER_L2 = "active_power_l2";
78+
public static final String LEGACY_CHANNEL_POWER_L3 = "active_power_l3";
79+
80+
public static final String CHANNEL_VOLTAGE = "voltage";
81+
public static final String CHANNEL_VOLTAGE_L1 = "voltage_l1";
82+
public static final String CHANNEL_VOLTAGE_L2 = "voltage_l2";
83+
public static final String CHANNEL_VOLTAGE_L3 = "voltage_l3";
84+
public static final String LEGACY_CHANNEL_VOLTAGE = "active_voltage";
85+
public static final String LEGACY_CHANNEL_VOLTAGE_L1 = "active_voltage_l1";
86+
public static final String LEGACY_CHANNEL_VOLTAGE_L2 = "active_voltage_l2";
87+
public static final String LEGACY_CHANNEL_VOLTAGE_L3 = "active_voltage_l3";
88+
89+
public static final String CHANNEL_CURRENT = "current";
90+
public static final String CHANNEL_CURRENT_L1 = "current_l1";
91+
public static final String CHANNEL_CURRENT_L2 = "current_l2";
92+
public static final String CHANNEL_CURRENT_L3 = "current_l3";
93+
public static final String LEGACY_CHANNEL_CURRENT = "active_current";
94+
public static final String LEGACY_CHANNEL_CURRENT_L1 = "active_current_l1";
95+
public static final String LEGACY_CHANNEL_CURRENT_L2 = "active_current_l2";
96+
public static final String LEGACY_CHANNEL_CURRENT_L3 = "active_current_l3";
97+
98+
public static final String CHANNEL_FREQUENCY = "frequency";
99+
100+
// P1 Meter Channels
47101
public static final String CHANNEL_POWER_FAILURES = "power_failures";
48102
public static final String CHANNEL_LONG_POWER_FAILURES = "long_power_failures";
49-
public static final String CHANNEL_ENERGY_IMPORT_T1 = "total_energy_import_t1";
50-
public static final String CHANNEL_ENERGY_IMPORT_T2 = "total_energy_import_t2";
51-
public static final String CHANNEL_ENERGY_EXPORT_T1 = "total_energy_export_t1";
52-
public static final String CHANNEL_ENERGY_EXPORT_T2 = "total_energy_export_t2";
53103

54104
public static final String CHANNEL_GAS_TIMESTAMP = "gas_timestamp";
55105
public static final String CHANNEL_GAS_TOTAL = "total_gas";
56-
public static final String CHANNEL_TOTAL_WATER = "total_water";
57-
public static final String CHANNEL_CURRENT_WATER = "current_water";
58106

107+
// Energy Socket And kWh Meter Channels
108+
public static final String CHANNEL_REACTIVE_POWER = "reactive_power";
109+
public static final String CHANNEL_APPARENT_POWER = "apparent_power";
110+
public static final String CHANNEL_POWER_FACTOR = "power_factor";
111+
112+
// Water Meter Channels
113+
public static final String CHANNEL_ACTIVE_LITER = "active_liter";
114+
public static final String CHANNEL_TOTAL_LITER = "total_liter";
115+
public static final String LEGACY_CHANNEL_ACTIVE_LITER = "active_water";
116+
public static final String LEGACY_CHANNEL_TOTAL_LITER = "total_water";
117+
118+
// Plug-In Battery Channels
119+
public static final String CHANNEL_STATE_OF_CHARGE = "state_of_charge";
120+
public static final String CHANNEL_CYCLES = "cycles";
121+
122+
// Energy Socket Control Channels
59123
public static final String CHANNEL_POWER_SWITCH = "power_switch";
60124
public static final String CHANNEL_POWER_LOCK = "power_lock";
61125
public static final String CHANNEL_RING_BRIGHTNESS = "ring_brightness";
62126

127+
//
63128
public static final String PROPERTY_METER_MODEL = "meterModel";
64129
public static final String PROPERTY_METER_VERSION = "meterVersion";
65130
}

bundles/org.openhab.binding.homewizard/src/main/java/org/openhab/binding/homewizard/internal/HomeWizardConfiguration.java

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* The {@link HomeWizardConfiguration} class contains fields mapping thing configuration parameters.
1919
*
2020
* @author Daniël van Os - Initial contribution
21+
* @author Gearrel Welvaart - Added API version
22+
*
2123
*/
2224
@NonNullByDefault
2325
public class HomeWizardConfiguration {
@@ -31,4 +33,14 @@ public class HomeWizardConfiguration {
3133
* Refresh delay in seconds
3234
*/
3335
public Integer refreshDelay = 5;
36+
37+
/**
38+
* The API version to be used
39+
*/
40+
public Integer apiVersion = 1;
41+
42+
/**
43+
* Bearer token for API v2
44+
*/
45+
public String bearerToken = "";
3446
}

0 commit comments

Comments
 (0)