Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 70 additions & 14 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23428,20 +23428,30 @@ export const definitions: DefinitionWithExtend[] = [
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_fodv6bkr"]),
model: "RM28-LE",
vendor: "Ronco",
description: "Zigbee roller shade motor",
description: "Zigbee roller shade motor (RM28-LE-W1-2-20)",
extend: [tuya.modernExtend.tuyaBase({dp: true})],
options: [exposes.options.invert_cover()],
exposes: [
e.battery(),
e.cover_position().setAccess("position", ea.STATE_SET),
e.enum("reverse_direction", ea.STATE_SET, ["forward", "back"]).withDescription("Reverse the motor direction"),
e.text("work_state", ea.STATE),
e.enum("click_control", ea.STATE_SET, ["up", "down"]).withDescription("Single motor steps"),
e.enum("border", ea.STATE_SET, ["up", "down", "up_delete", "down_delete", "remove_top_bottom"]),
e.binary("motor_fault", ea.STATE, true, false),
e.enum("mode", ea.STATE_SET, ["morning", "night"]).withDescription("Operating mode. morning=normal, night=slower and quieter"),
e.enum("motor_direction", ea.STATE_SET, ["forward", "back"]).withDescription("Motor rotation direction. Change if blind moves wrong way"),
e.binary("auto_power", ea.STATE_SET, true, false).withDescription("Auto-complete open/close when curtain is manually pulled"),
e.enum("work_state", ea.STATE, ["opening", "closing"]).withDescription("Current motor movement status"),
e.enum("countdown", ea.STATE_SET, ["cancel", "1h", "2h", "3h", "4h"]).withDescription("Countdown timer to trigger open/close"),
e.numeric("countdown_left", ea.STATE).withUnit("s").withDescription("Remaining countdown time in seconds"),
e.numeric("time_total", ea.STATE).withUnit("ms").withDescription("Full travel time in ms, populated after calibration"),
e
.enum("situation_set", ea.STATE, ["fully_open", "fully_close"])
.withDescription("Whether motor treats 100% as fully open or fully closed"),
e.binary("motor_fault", ea.STATE, true, false).withDescription("Motor hardware fault"),
e.battery(),
e
.enum("border", ea.SET, ["up", "down", "up_delete", "down_delete", "remove_top_bottom"])
.withDescription("Set or clear motor travel limits"),
e.numeric("position_best", ea.STATE_SET).withValueMin(0).withValueMax(100).withUnit("%").withDescription("Saved favourite position"),
e.enum("click_control", ea.SET, ["up", "down"]).withDescription("Single jog step up or down"),
],
meta: {
// All datapoints go in here
tuyaDatapoints: [
[
1,
Expand All @@ -23454,15 +23464,53 @@ export const definitions: DefinitionWithExtend[] = [
],
[2, "position", tuya.valueConverter.coverPosition],
[3, "position", tuya.valueConverter.coverPosition],
[5, "reverse_direction", tuya.valueConverterBasic.lookup({forward: tuya.enum(0), back: tuya.enum(1)})],
[
4,
"mode",
tuya.valueConverterBasic.lookup({
morning: tuya.enum(0),
night: tuya.enum(1),
}),
],
[
5,
"motor_direction",
tuya.valueConverterBasic.lookup({
forward: tuya.enum(0),
back: tuya.enum(1),
}),
],
[6, "auto_power", tuya.valueConverter.onOff],
[
7,
"work_state",
tuya.valueConverterBasic.lookup((options) =>
options.invert_cover ? {opening: tuya.enum(0), closing: tuya.enum(1)} : {opening: tuya.enum(1), closing: tuya.enum(0)},
),
tuya.valueConverterBasic.lookup({
opening: tuya.enum(0),
closing: tuya.enum(1),
}),
],
[12, "motor_fault", tuya.valueConverter.trueFalse1],
[
8,
"countdown",
tuya.valueConverterBasic.lookup({
cancel: tuya.enum(0),
"1h": tuya.enum(1),
"2h": tuya.enum(2),
"3h": tuya.enum(3),
"4h": tuya.enum(4),
}),
],
[9, "countdown_left", tuya.valueConverter.raw],
[10, "time_total", tuya.valueConverter.raw],
[
11,
"situation_set",
tuya.valueConverterBasic.lookup({
fully_open: tuya.enum(0),
fully_close: tuya.enum(1),
}),
],
[12, "motor_fault", {from: (v: number) => v !== 0}],
[13, "battery", tuya.valueConverter.raw],
[
16,
Expand All @@ -23475,7 +23523,15 @@ export const definitions: DefinitionWithExtend[] = [
remove_top_bottom: tuya.enum(4),
}),
],
[20, "click_control", tuya.valueConverterBasic.lookup({up: tuya.enum(0), down: tuya.enum(1)})],
[19, "position_best", tuya.valueConverter.raw],
[
20,
"click_control",
tuya.valueConverterBasic.lookup({
up: tuya.enum(0),
down: tuya.enum(1),
}),
],
],
},
},
Expand Down