Skip to content

Commit 2da02dc

Browse files
authored
Add Ultra-thin display switch and occupancy sensor specs
Added specifications and mappings for the Ultra-thin display screen switch and updated occupancy sensor details.
1 parent 84dd98b commit 2da02dc

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

custom_components/xiaomi_gateway3/core/devices.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4597,6 +4597,48 @@
45974597
MapConv("mode_2", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}),
45984598
MapConv("mode_3", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless"}),
45994599
],
4600+
}, {
4601+
# MIOT https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:switch:0000A003:090615-akult4:2:0000D010
4602+
24360: ["PTX", "Ultra-thin display screen switch","PTX-X1 MAX", "090615.switch.akult4"],
4603+
"spec": [
4604+
BaseConv("switch_1", "switch", mi="2.p.1"),
4605+
BaseConv("switch_2", "switch", mi="3.p.1"),
4606+
BaseConv("switch_3", "switch", mi="4.p.1"),
4607+
BaseConv("switch_4", "switch", mi="5.p.1"),
4608+
MapConv("mode_1", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}),
4609+
MapConv("mode_2", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}),
4610+
MapConv("mode_3", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless"}),
4611+
MapConv("mode_4", "select", mi="5.p.2", map={0: "Wired And Wireless", 1: "Wireless"}),
4612+
MapConv("power_on_state", "select", mi="2.p.5", map={0: "Off", 1: "On", 2: "Default"}),
4613+
MapConv("backlight_level", "select", mi="17.p.2", map={0: "Level 0", 1: "Level 1", 2: "Level 2"}, entity=ENTITY_CONFIG),
4614+
MapConv("backlight_mode", "select", mi="17.p.3", map={0: "Default", 1: "auto", 2: "Not-disturb"}, entity=ENTITY_CONFIG),
4615+
BaseConv("action", "sensor"),
4616+
# Button press events
4617+
MapConv("action", mi="6.e.1.p.1", map={1: BUTTON_1_SINGLE, 2: BUTTON_2_SINGLE, 3: BUTTON_3_SINGLE, 4: BUTTON_4_SINGLE}), # Single press
4618+
MapConv("action", mi="6.e.3.p.1", map={1: BUTTON_1_DOUBLE, 2: BUTTON_2_DOUBLE, 3: BUTTON_3_DOUBLE, 4: BUTTON_4_DOUBLE}), # Double press
4619+
MapConv("action", mi="6.e.2.p.1", map={1: BUTTON_1_HOLD, 2: BUTTON_2_HOLD, 3: BUTTON_3_HOLD, 4: BUTTON_4_HOLD}), # Long press
4620+
# Scene switch events
4621+
ConstConv("action", mi="18.e.1", value="scene_one"),
4622+
ConstConv("action", mi="18.e.2", value="scene_two"),
4623+
ConstConv("action", mi="18.e.3", value="scene_three"),
4624+
ConstConv("action", mi="18.e.4", value="scene_four"),
4625+
# Backlight switch
4626+
BaseConv("backlight", "switch", mi="17.p.1"),
4627+
# Sensing mode switch
4628+
BaseConv("asensing_mode", "switch", mi="17.p.12", entity=ENTITY_CONFIG),
4629+
# Do Not Disturb mode switch
4630+
BaseConv("not_disturb_mode", "switch", mi="17.p.13", entity=ENTITY_CONFIG),
4631+
# Standby clock display switch (controlled via mode selection)
4632+
MapConv("no_one_screen", "select", mi="17.p.10", map={0: "Off", 1: "Low-energy", 2: "Digit-clock"}, entity=ENTITY_CONFIG),
4633+
# Auto standby time (screen off delay)
4634+
MathConv("screen_off_delay", "number", mi="17.p.4", min=3, max=180, entity=ENTITY_CONFIG),
4635+
# Occupancy/Vacancy detection binary sensor
4636+
ConstConv("action", mi="16.e.1", value="someone"), # Someone detected
4637+
ConstConv("action", mi="16.e.2", value="no_one"), # No one detected
4638+
BaseConv("occupancy", "binary_sensor", entity=ENTITY_LAZY),
4639+
ConstConv("occupancy", mi="16.e.1", value=True), # Occupied
4640+
ConstConv("occupancy", mi="16.e.2", value=False), # Vacant
4641+
],
46004642
}, {
46014643
# https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:090615-xw:1:0000C824
46024644
18736: ["PTX", "Human Body Presence Sensor (Top Mounted)", "PTX-MMW-MIM", "090615.sensor_occupy.xw"],

0 commit comments

Comments
 (0)