Skip to content

Commit 442f763

Browse files
committed
Add lock, cover, and light platform support to HEMS Echonet Lite integration
This commit adds three new platforms for the HEMS Echonet Lite integration: - Lock platform (class code 0x026F): Electric lock control with main/sub lock support and jam detection via alarm status - Cover platform (class codes 0x0260, 0x0263): Blind and shutter control with dynamic feature support based on available EPCs, position and tilt control - Light platform (class codes 0x0290, 0x0291, 0x02A3, 0x02A4): Support for general and mono-functional lighting with brightness, color temperature (only 0x0290), and lighting mode effects Also includes updated constants, icon definitions, and localized strings (English and Japanese) for all new platforms.
1 parent 31283fe commit 442f763

12 files changed

Lines changed: 1002 additions & 23 deletions

File tree

README.md

Lines changed: 65 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,97 @@ ECHONET Lite protocol integration for Home Assistant, powered by [pyhems](https:
1414
- **Event-driven updates** — entity state changes are pushed immediately upon frame receipt
1515
- **Property polling** every 60 seconds for devices that do not send notifications
1616
- **Runtime health monitoring** — creates repair issues when no frames are received for 5 minutes
17-
- **9 entity platforms**: Climate, Fan, Water Heater, Binary Sensor, Button, Number, Select, Sensor, Switch
18-
- **Experimental mode** to enable unverified device classes
17+
- **12 entity platforms**: Climate, Fan, Water Heater, Lock, Cover, Light, Binary Sensor, Button, Number, Select, Sensor, Switch
18+
- **Experimental mode** to enable 50+ additional unverified device classes
1919

2020
## Supported Devices
2121

22-
### Stable Device Classes
22+
Device classes fall into two categories:
23+
24+
- **Stable** — enabled by default, no extra configuration needed
25+
- **Experimental** — must be enabled via the integration options; not verified with real hardware
2326

24-
These device classes are enabled by default:
27+
### Stable Device Classes
2528

26-
| Class Code | Device | Entity Platform |
27-
|------------|--------|-----------------|
29+
| Class Code | Device | HA Platform |
30+
|------------|--------|-------------|
2831
| 0x0130 | Home Air Conditioner | Climate + generic entities |
32+
| 0x0133 | Ventilation Fan | Fan + generic entities |
33+
| 0x0134 | Air Conditioner Ventilation Fan | Fan + generic entities |
2934
| 0x0135 | Air Cleaner | Fan + generic entities |
3035
| 0x0279 | Residential Solar Power Generation | Generic entities |
3136
| 0x027D | Storage Battery | Generic entities |
32-
| 0x05FD | Switch (supporting JEM-A/HA terminals) | Generic entities |
37+
| 0x05FD | Switch (JEM-A/HA terminals) | Generic entities |
3338
| 0x05FF | Controller | Generic entities |
3439

35-
### Climate (0x0130) Features
40+
### Experimental Device Classes with Dedicated Platforms
41+
42+
The following experimental classes are exposed as fully-featured HA platform entities:
43+
44+
| Class Code | Device | HA Platform |
45+
|------------|--------|-------------|
46+
| 0x026B | Electric Heat-Pump Water Heater | Water Heater + generic entities |
47+
| 0x026F | Electric Lock | Lock + generic entities |
48+
| 0x0260 | Electrically Operated Blind | Cover + generic entities |
49+
| 0x0263 | Electrically Operated Shutter | Cover + generic entities |
50+
| 0x0290 | General Lighting | Light + generic entities |
51+
| 0x0291 | Mono-Functional Lighting | Light + generic entities |
52+
| 0x02A3 | Lighting System | Light + generic entities |
53+
| 0x02A4 | Extended Lighting System | Light + generic entities |
54+
55+
All other experimental classes are supported via generic entities only.
56+
57+
## Platform Details
58+
59+
### Climate (0x0130)
3660

3761
- **HVAC modes**: Off, Auto, Cool, Heat, Dry, Fan Only
3862
- **Fan modes**: Auto, Low (Level 1) – High (Level 8), 9 speeds
3963
- **Swing modes**: Off, Vertical, Horizontal, Both
4064
- **Temperature**: 0–50°C, 1°C step
4165

42-
### Fan (0x0133, 0x0134, 0x0135) Features
66+
### Fan (0x0133, 0x0134, 0x0135)
4367

4468
- **Speed**: 8 levels mapped to percentage
4569
- **Preset modes**: Auto, Manual
4670

47-
### Water Heater (0x026B) Features
71+
### Water Heater (0x026B)
4872

49-
The electric heat-pump water heater class is exposed as a high-level `WaterHeaterEntity` that aggregates operation status (EPC 0x80), operation mode (EPC 0xB0) and target temperature (EPC 0xB3) into a single entity.
73+
Aggregates operation status (EPC 0x80), operation mode (EPC 0xB0) and target temperature (EPC 0xB3) into a single entity.
5074

5175
- **Operations**: `auto` (automatic water heating), `manual` (manual water heating), `manual_off` (manual heating stopped / away), `off`
52-
- **Target temperature**: setpoint via EPC 0xB3 (range derived from the device's MRA definition, 1 °C step)
53-
- **Current temperature**: measured water temperature (EPC 0xC1) — also exposed as a standalone sensor, mirroring the climate platform's room-temperature convention
76+
- **Target temperature**: setpoint via EPC 0xB3 (range derived from the device's MRA definition, 1°C step)
77+
- **Current temperature**: measured water temperature (EPC 0xC1) — also exposed as a standalone sensor
78+
79+
### Lock (0x026F)
80+
81+
- **Locked state**: requires both main lock (EPC 0xE0) and sub-lock (EPC 0xE1, if advertised) to be locked
82+
- **Jammed state**: indicated when alarm status (EPC 0xE5) reports an abnormality
83+
- **Lock / Unlock**: writes to main lock (EPC 0xE0) only
5484

55-
> **Note**: 0x026B is currently part of the **experimental** device class set (see below) and must be enabled via the integration options. The dedicated water heater entity is created only after the device is discovered with experimental mode on.
85+
### Cover (0x0260 Blind, 0x0263 Shutter)
86+
87+
- **Commands**: Open, Close, Stop (always available)
88+
- **Position control** (EPC 0xE1): available when the device supports set operations, 0–100%
89+
- **Tilt control** (EPC 0xE2): available when the device supports set operations, 0–100% mapped to 0–180°
90+
- **State** (EPC 0xEA): Open, Closed, Opening, Closing, Stopped; falls back to position percentage when not advertised
91+
92+
### Light (0x0290, 0x0291, 0x02A3, 0x02A4)
93+
94+
| Feature | 0x0290 General | 0x0291 Mono | 0x02A3 System | 0x02A4 Extended |
95+
|---------|:-:|:-:|:-:|:-:|
96+
| On / Off |||||
97+
| Brightness (EPC 0xB0, 0–100%) |||||
98+
| Color temperature (EPC 0xB1) |||||
99+
| Lighting mode effect (EPC 0xB6) |||||
100+
101+
**Color temperature presets** (0x0290 only): Incandescent (2700 K), White (4000 K), Daylight White (5000 K), Daylight Color (6500 K). Arbitrary kelvin values are snapped to the nearest preset.
102+
103+
**Lighting mode effects** (0x0290 only): `auto`, `normal` (main lighting), `night` (night lighting), `color` (color lighting).
56104

57105
### Generic Entity Platforms
58106

59-
Properties are automatically mapped to entity platforms based on the ECHONET Lite property definition:
107+
All remaining properties are automatically mapped based on the ECHONET Lite property definition:
60108

61109
| Condition | Writable | Read-only |
62110
|-----------|----------|-----------|
@@ -65,14 +113,6 @@ Properties are automatically mapped to entity platforms based on the ECHONET Lit
65113
| 1-value enum | Button ||
66114
| Numeric | Number | Sensor |
67115

68-
### Experimental Device Classes
69-
70-
Enable **"Enable experimental device classes"** in the integration options to access 50+ additional device classes, including:
71-
72-
Electric water heaters (0x026B, with the dedicated Water Heater entity described above), electric locks, lighting, refrigerators, washing machines, smart meters, EV chargers, bathroom dryers, and more.
73-
74-
> **Note**: Experimental device classes have not been verified with real hardware. Some entities may behave unexpectedly.
75-
76116
## Installation
77117

78118
### HACS (Recommended)
@@ -107,6 +147,8 @@ After setup, configure in **Settings → Devices & Services → HEMS → Configu
107147
|--------|-------------|---------|
108148
| Enable experimental device classes | Include unverified device classes | Off |
109149

150+
> Enabling experimental mode is required for Water Heater, Lock, Cover, Light, and all other non-stable device classes.
151+
110152
### Reconfiguration
111153

112154
The network interface can be changed at any time via **Settings → Devices & Services → HEMS → Reconfigure**.

custom_components/echonet_lite/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@
7979
Platform.BINARY_SENSOR,
8080
Platform.BUTTON,
8181
Platform.CLIMATE,
82+
Platform.COVER,
8283
Platform.FAN,
84+
Platform.LIGHT,
85+
Platform.LOCK,
8386
Platform.NUMBER,
8487
Platform.SELECT,
8588
Platform.SENSOR,

custom_components/echonet_lite/const.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,16 @@
5252
CLASS_CODE_VENTILATION_FAN = 0x0133
5353
CLASS_CODE_AIR_CONDITIONER_VENTILATION_FAN = 0x0134
5454
CLASS_CODE_AIR_CLEANER = 0x0135
55+
CLASS_CODE_ELECTRICALLY_OPERATED_BLIND = 0x0260
56+
CLASS_CODE_ELECTRICALLY_OPERATED_SHUTTER = 0x0263
5557
CLASS_CODE_ELECTRIC_WATER_HEATER = 0x026B
58+
CLASS_CODE_ELECTRIC_LOCK = 0x026F
5659
CLASS_CODE_HOUSEHOLD_SOLAR_POWER_GENERATION = 0x0279
5760
CLASS_CODE_STORAGE_BATTERY = 0x027D
61+
CLASS_CODE_GENERAL_LIGHTING = 0x0290
62+
CLASS_CODE_MONO_FUNCTIONAL_LIGHTING = 0x0291
63+
CLASS_CODE_LIGHTING_SYSTEM = 0x02A3
64+
CLASS_CODE_EXTENDED_LIGHTING_SYSTEM = 0x02A4
5865
CLASS_CODE_SWITCH = 0x05FD # Switch (supporting JEM-A/HA terminals)
5966
CLASS_CODE_CONTROLLER = 0x05FF
6067

@@ -95,6 +102,22 @@
95102
EPC_ROOM_TEMPERATURE = 0xBB
96103
EPC_MEASURED_WATER_TEMPERATURE = 0xC1
97104

105+
# Class-specific EPCs used by the light platform.
106+
EPC_LIGHT_LEVEL = 0xB0
107+
EPC_LIGHT_COLOR = 0xB1
108+
EPC_LIGHTING_MODE = 0xB6
109+
110+
# Class-specific EPCs used by the cover platform.
111+
EPC_COVER_OPEN_CLOSE = 0xE0
112+
EPC_COVER_POSITION = 0xE1
113+
EPC_COVER_ANGLE = 0xE2
114+
EPC_COVER_OPEN_CLOSED_STATUS = 0xEA
115+
116+
# Class-specific EPCs used by the lock platform.
117+
EPC_LOCK_SETTING_1 = 0xE0
118+
EPC_LOCK_SETTING_2 = 0xE1
119+
EPC_LOCK_ALARM_STATUS = 0xE5
120+
98121
# Stable (non-experimental) device class codes
99122
# These device classes have been verified with real hardware.
100123
# Other device classes are considered experimental.
@@ -148,6 +171,55 @@
148171
EPC_TARGET_TEMPERATURE,
149172
}
150173
),
174+
CLASS_CODE_ELECTRIC_LOCK: frozenset(
175+
{
176+
EPC_LOCK_SETTING_1,
177+
EPC_LOCK_SETTING_2,
178+
EPC_LOCK_ALARM_STATUS,
179+
}
180+
),
181+
CLASS_CODE_ELECTRICALLY_OPERATED_BLIND: frozenset(
182+
{
183+
EPC_COVER_OPEN_CLOSE,
184+
EPC_COVER_POSITION,
185+
EPC_COVER_ANGLE,
186+
EPC_COVER_OPEN_CLOSED_STATUS,
187+
}
188+
),
189+
CLASS_CODE_ELECTRICALLY_OPERATED_SHUTTER: frozenset(
190+
{
191+
EPC_COVER_OPEN_CLOSE,
192+
EPC_COVER_POSITION,
193+
EPC_COVER_ANGLE,
194+
EPC_COVER_OPEN_CLOSED_STATUS,
195+
}
196+
),
197+
CLASS_CODE_MONO_FUNCTIONAL_LIGHTING: frozenset(
198+
{
199+
EPC_OPERATION_STATUS,
200+
EPC_LIGHT_LEVEL,
201+
}
202+
),
203+
CLASS_CODE_GENERAL_LIGHTING: frozenset(
204+
{
205+
EPC_OPERATION_STATUS,
206+
EPC_LIGHT_LEVEL,
207+
EPC_LIGHT_COLOR,
208+
EPC_LIGHTING_MODE,
209+
}
210+
),
211+
CLASS_CODE_LIGHTING_SYSTEM: frozenset(
212+
{
213+
EPC_OPERATION_STATUS,
214+
EPC_LIGHT_LEVEL,
215+
}
216+
),
217+
CLASS_CODE_EXTENDED_LIGHTING_SYSTEM: frozenset(
218+
{
219+
EPC_OPERATION_STATUS,
220+
EPC_LIGHT_LEVEL,
221+
}
222+
),
151223
}
152224

153225

@@ -382,8 +454,16 @@ def infer_entity_registry_enabled_default(
382454
"CLASS_CODE_AIR_CLEANER",
383455
"CLASS_CODE_AIR_CONDITIONER_VENTILATION_FAN",
384456
"CLASS_CODE_CONTROLLER",
457+
"CLASS_CODE_ELECTRICALLY_OPERATED_BLIND",
458+
"CLASS_CODE_ELECTRICALLY_OPERATED_SHUTTER",
459+
"CLASS_CODE_ELECTRIC_LOCK",
460+
"CLASS_CODE_ELECTRIC_WATER_HEATER",
461+
"CLASS_CODE_EXTENDED_LIGHTING_SYSTEM",
462+
"CLASS_CODE_GENERAL_LIGHTING",
385463
"CLASS_CODE_HOME_AIR_CONDITIONER",
386464
"CLASS_CODE_HOUSEHOLD_SOLAR_POWER_GENERATION",
465+
"CLASS_CODE_LIGHTING_SYSTEM",
466+
"CLASS_CODE_MONO_FUNCTIONAL_LIGHTING",
387467
"CLASS_CODE_STORAGE_BATTERY",
388468
"CLASS_CODE_SWITCH",
389469
"CLASS_CODE_VENTILATION_FAN",
@@ -396,6 +476,10 @@ def infer_entity_registry_enabled_default(
396476
"DOMAIN",
397477
"ENTITY_CATEGORY_BY_EPC",
398478
"EPC_AIR_FLOW_LEVEL",
479+
"EPC_COVER_ANGLE",
480+
"EPC_COVER_OPEN_CLOSE",
481+
"EPC_COVER_OPEN_CLOSED_STATUS",
482+
"EPC_COVER_POSITION",
399483
"EPC_CUMULATIVE_OPERATING_TIME",
400484
"EPC_CURRENT_DATE",
401485
"EPC_CURRENT_LIMIT",
@@ -406,6 +490,12 @@ def infer_entity_registry_enabled_default(
406490
"EPC_GET_PROPERTY_MAP",
407491
"EPC_INF_PROPERTY_MAP",
408492
"EPC_INSTALLATION_LOCATION",
493+
"EPC_LIGHTING_MODE",
494+
"EPC_LIGHT_COLOR",
495+
"EPC_LIGHT_LEVEL",
496+
"EPC_LOCK_ALARM_STATUS",
497+
"EPC_LOCK_SETTING_1",
498+
"EPC_LOCK_SETTING_2",
409499
"EPC_MANUFACTURER_CODE",
410500
"EPC_MANUFACTURER_FAULT_CODE",
411501
"EPC_OPERATION_MODE",

0 commit comments

Comments
 (0)