Code: Select all
numeric("radar_sensitivity", ea.STATE_SET)
.withValueMin(0)
.withValueMax(9)
.withValueStep(1)
.withDescription("Detection threshold for the strength of object energy"),
e
.numeric("detection_range", ea.STATE_SET)
.withValueMin(0)
.withValueMax(8)
.withValueStep(0.1)
.withUnit("m")
.withDescription("Maximum distance detected by the sensor"),
e
.numeric("shield_range", ea.STATE_SET)
.withValueMin(0)
.withValueMax(8)
.withValueStep(0.1)
.withUnit("m")
.withDescription("Nearest distance detected by the sensor"),
e
.numeric("entry_sensitivity", ea.STATE_SET)
.withValueMin(0)
.withValueMax(9)
.withValueStep(1)
.withDescription("Sensitivity threshold triggered for the first time when the target enters the detection range"),
e
.numeric("entry_distance_indentation", ea.STATE_SET)
.withValueMin(0)
.withValueMax(8)
.withValueStep(0.1)
.withUnit("m")
.withDescription("Indent the distance inward based on the detection distance"),
e
.numeric("entry_filter_time", ea.STATE_SET)
.withValueMin(0)
.withValueMax(10)
.withValueStep(0.1)
.withUnit("s")
.withDescription("Sensitivity threshold triggered for the first time when the target enters the detection range "),
e
.numeric("departure_delay", ea.STATE_SET)
.withValueMin(0)
.withValueMax(600)
.withValueStep(1)
.withUnit("s")
.withDescription("Confirmation time after the target disappears"),
e
.numeric("block_time", ea.STATE_SET)
.withValueMin(0)
.withValueMax(10)
.withValueStep(0.1)
.withUnit("s")
.withDescription("Time for the target to be detected again after switching from manned(occupy) to unmanned(unoccupy) mode"),
e.binary("breaker_status", ea.STATE_SET, "ON", "OFF").withDescription("Remotely control the breaker in standard mode"),
e
.enum("breaker_mode", ea.STATE_SET, ["standard", "local"])
.withDescription("Breaker mode: standard is remotely controlled, local is automatic"),
e
.numeric("illuminance_threshold", ea.STATE_SET)
.withValueMin(0)
.withValueMax(420)
.withValueStep(0.1)
.withUnit("lx")
.withDescription("Illumination threshold for local (automatic) switching mode operation"),
e.enum("status_indication", ea.STATE_SET, ["OFF", "ON"]).withDescription("Indicator light will flash when human presence is detected"),
e
.enum("sensor", ea.STATE_SET, ["on", "off", "occupied", "unoccupied"])
.withDescription(
"The radar sensor can be set in four states: on, off, occupied and unoccupied. For example, if set to occupied, " +
"it will continue to maintain presence regardless of whether someone is present or not. If set to unoccupied, the unoccupied " +
"state will be maintained permanently.",
),
],
meta: {
tuyaDatapoints: [
[1, "presence", tuya.valueConverter.trueFalse1],
[2, "radar_sensitivity", tuya.valueConverter.raw],
[3, "shield_range", tuya.valueConverter.divideBy100],
[4, "detection_range", tuya.valueConverter.divideBy100],
[6, "equipment_status", tuya.valueConverter.raw],
[9, "target_distance", tuya.valueConverter.divideBy100],
[101, "entry_filter_time", tuya.valueConverter.divideBy10],
[102, "departure_delay", tuya.valueConverter.raw],
[103, "cline", tuya.valueConverter.raw],
[104, "illuminance", tuya.valueConverter.divideBy10],
[105, "entry_sensitivity", tuya.valueConverter.raw],
[106, "entry_distance_indentation", tuya.valueConverter.divideBy100],
[
107,
"breaker_mode",
tuya.valueConverterBasic.lookup({
standard: tuya.enum(0),
local: tuya.enum(1),
}),
],
[
108,
"breaker_status",
tuya.valueConverterBasic.lookup({
OFF: tuya.enum(0),
ON: tuya.enum(1),
}),
],
[
109,
"status_indication",
tuya.valueConverterBasic.lookup({
OFF: tuya.enum(0),
ON: tuya.enum(1),
}),
],
[110, "illuminance_threshold", tuya.valueConverter.divideBy10],
[
111,
"breaker_polarity",
tuya.valueConverterBasic.lookup({
NC: tuya.enum(0),
NO: tuya.enum(1),
}),
],
[112, "block_time", tuya.valueConverter.divideBy10],
[113, "parameter_setting_result", tuya.valueConverter.raw],
[114, "factory_parameters", tuya.valueConverter.raw],
[
115,
"sensor",
tuya.valueConverterBasic.lookup({
on: tuya.enum(0),
off: tuya.enum(1),
occupied: tuya.enum(2),
unoccupied: tuya.enum(3),
}),