Skip to content
Merged
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
6182d58
update
jintj Nov 25, 2025
c8e166a
Update third_reality.ts
Koenkk Nov 25, 2025
7d61cf2
update
jintj Nov 26, 2025
757727e
Merge branch 'master' of https://github.com/3reality-support/zigbee-h…
jintj Nov 26, 2025
b0214c1
Merge branch 'Koenkk:master' into master
3reality-support Nov 26, 2025
584816a
update
jintj Nov 26, 2025
04d51da
Merge branch 'master' of https://github.com/3reality-support/zigbee-h…
jintj Nov 26, 2025
fefa5d6
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 26, 2025
632d215
update
jintj Nov 26, 2025
32f4847
Merge branch 'master' of https://github.com/3reality-support/zigbee-h…
jintj Nov 26, 2025
ec1324e
update
jintj Nov 26, 2025
68bd787
Merge branch 'Koenkk:master' into master
3reality-support Nov 27, 2025
32531e9
update
jintj Nov 27, 2025
2ef9a19
update
jintj Nov 27, 2025
6e810c3
Merge branch 'Koenkk:master' into master
3reality-support Dec 8, 2025
2828d25
update
jintj Dec 8, 2025
4f8d15f
Merge branch 'Koenkk:master' into master
3reality-support Dec 10, 2025
c0467a1
update
jintj Dec 10, 2025
e705f3e
Merge branch 'Koenkk:master' into master
3reality-support Dec 11, 2025
2a884b1
update
jintj Dec 11, 2025
b317d2f
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 11, 2025
3d3e6f6
update
jintj Dec 11, 2025
147e9b5
Merge branch 'master' of https://github.com/3reality-support/zigbee-h…
jintj Dec 11, 2025
4d96b10
update
jintj Dec 11, 2025
42f8349
Merge branch 'master' into master
3reality-support Dec 15, 2025
baca09a
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 15, 2025
3f754bb
update
jintj Dec 15, 2025
96c37e6
update
jintj Dec 15, 2025
79b7a7c
Merge branch 'master' into master
3reality-support Dec 17, 2025
ef300a9
Merge branch 'master' into master
Koenkk Dec 18, 2025
cb2d310
Merge branch 'Koenkk:master' into master
3reality-support Dec 19, 2025
db5883b
update
jintj Dec 19, 2025
c830f1b
Merge branch 'Koenkk:master' into master
3reality-support Dec 26, 2025
486e74f
Merge branch 'Koenkk:master' into master
3reality-support Jan 4, 2026
6e8a80a
UPDATE
jintj Jan 4, 2026
665a4fd
update
jintj Jan 4, 2026
fc5c35b
u
Koenkk Jan 4, 2026
0b71d40
Merge branch 'Koenkk:master' into master
3reality-support Jan 12, 2026
d1a4b84
update
jintj Jan 12, 2026
94f1c05
update
jintj Jan 12, 2026
8ffecff
Merge branch 'Koenkk:master' into master
3reality-support Jan 15, 2026
55067b1
update
jintj Jan 15, 2026
5a6dbdf
Merge branch 'Koenkk:master' into master
3reality-support Jan 16, 2026
1b774c4
update
jintj Jan 16, 2026
8284ba2
Merge branch 'Koenkk:master' into master
3reality-support Jan 30, 2026
3e0dc6a
update
jintj Jan 30, 2026
d468c77
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 30, 2026
2c38690
Merge branch 'Koenkk:master' into master
3reality-support Feb 3, 2026
b8d92c4
update
jintj Feb 3, 2026
267e116
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 3, 2026
2ac6e96
Update src/devices/third_reality.ts
3reality-support Feb 4, 2026
d09f751
Merge branch 'Koenkk:master' into master
3reality-support Feb 4, 2026
3dc8052
Update third_reality.ts
3reality-support Feb 4, 2026
6c2089c
Update third_reality.ts
3reality-support Feb 4, 2026
2d244fa
Apply suggestion from @Koenkk
Koenkk Feb 5, 2026
c3555c8
Apply suggestion from @Koenkk
Koenkk Feb 5, 2026
9b7da79
Apply suggestion from @Koenkk
Koenkk Feb 5, 2026
dd5ce99
Merge branch 'Koenkk:master' into master
3reality-support Feb 9, 2026
3787af3
update
jintj Feb 9, 2026
ae00b8a
update
jintj Feb 9, 2026
a3fdd76
Merge branch 'Koenkk:master' into master
3reality-support Feb 10, 2026
73cf4f7
update
jintj Feb 10, 2026
60bc78c
Merge branch 'Koenkk:master' into master
3reality-support Mar 3, 2026
443f309
update
jintj Mar 3, 2026
67af83b
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 3, 2026
fd3157c
Merge branch 'Koenkk:master' into master
3reality-support Mar 5, 2026
9d89041
update
jintj Mar 5, 2026
5aabae9
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 5, 2026
253b410
update
jintj Mar 5, 2026
1a5fe2d
Merge branch 'Koenkk:master' into master
3reality-support Mar 9, 2026
ed6b4af
update
jintj Mar 9, 2026
52f299d
Merge branch 'Koenkk:master' into master
3reality-support Mar 10, 2026
4fc7532
update
jintj Mar 10, 2026
d682e81
update
jintj Mar 10, 2026
a58847b
update
jintj Mar 10, 2026
71a105e
Merge branch 'Koenkk:master' into master
3reality-support Mar 12, 2026
5280bde
update
jintj Mar 13, 2026
3553909
update
jintj Mar 13, 2026
929d96b
update
jintj Mar 13, 2026
59d0462
Merge branch 'Koenkk:master' into master
3reality-support Mar 16, 2026
4aeab8f
update
jintj Mar 16, 2026
6d50a31
update
jintj Mar 16, 2026
76b3095
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 16, 2026
3201db7
Merge branch 'Koenkk:master' into master
3reality-support Mar 20, 2026
c2315e6
update
jintj Mar 20, 2026
2bf4118
Merge branch 'Koenkk:master' into master
3reality-support Mar 30, 2026
1b61625
update
jintj Mar 30, 2026
3ebd5fa
Merge branch 'Koenkk:master' into master
3reality-support Apr 2, 2026
7265273
update
jintj Apr 2, 2026
540c5b9
Merge branch 'Koenkk:master' into master
3reality-support Apr 10, 2026
7267341
update
jintj Apr 10, 2026
eb628eb
update
jintj Apr 10, 2026
0eea383
update
jintj Apr 10, 2026
4c776cf
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 10, 2026
eaa5bd7
update
jintj Apr 10, 2026
37ae500
Merge branch 'master' of https://github.com/3reality-support/zigbee-h…
jintj Apr 10, 2026
4ac06ee
Merge branch 'master' into master
Koenkk Apr 11, 2026
908f26f
Merge branch 'Koenkk:master' into master
3reality-support Apr 13, 2026
0278da6
update
jintj Apr 13, 2026
4f4601f
update
jintj Apr 13, 2026
8ed7a81
update
jintj Apr 14, 2026
2053bbb
Merge branch 'master' into master
3reality-support Apr 14, 2026
13c1150
Merge branch 'Koenkk:master' into master
3reality-support Apr 17, 2026
15762c1
update
jintj Apr 17, 2026
bb20161
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 17, 2026
f1c26e4
Merge branch 'Koenkk:master' into master
3reality-support Apr 28, 2026
6caacdc
Merge branch 'Koenkk:master' into master
3reality-support Apr 29, 2026
c2e937b
update
jintj Apr 29, 2026
aa81b46
Merge branch 'Koenkk:master' into master
3reality-support May 7, 2026
21cfad8
update
jintj May 7, 2026
78f2c49
[autofix.ci] apply automated fixes
autofix-ci[bot] May 7, 2026
ab3a2b3
update
jintj May 7, 2026
d7becd2
update
jintj May 7, 2026
80301f8
update
jintj May 7, 2026
4339795
[autofix.ci] apply automated fixes
autofix-ci[bot] May 7, 2026
0c38b1d
Merge branch 'Koenkk:master' into master
3reality-support May 8, 2026
b84d567
update
jintj May 8, 2026
c5b3703
[autofix.ci] apply automated fixes
autofix-ci[bot] May 8, 2026
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
59 changes: 56 additions & 3 deletions src/devices/third_reality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,63 @@ import * as tz from "../converters/toZigbee";
import * as exposes from "../lib/exposes";
import * as m from "../lib/modernExtend";
import * as reporting from "../lib/reporting";
import type {DefinitionWithExtend, Fz, KeyValue} from "../lib/types";
import type {
Configure,
Definition,
DefinitionExposesFunction,
DefinitionWithExtend,
DummyDevice,
Expose,
Fz,
KeyValue,
ModernExtend,
Zh,
} from "../lib/types";
import * as utils from "../lib/utils";

const e = exposes.presets;

function conditionalPressure(): ModernExtend {
const base = m.pressure();

// Check whether any endpoint on the device has the msPressureMeasurement input cluster
function deviceHasPressureCluster(device: Zh.Device | DummyDevice): boolean {
if (utils.isDummyDevice(device)) return true; // docs generation: show it
return device.endpoints?.some((ep: Zh.Endpoint) => ep.supportsInputCluster("msPressureMeasurement"));
}

const exposeFn: DefinitionExposesFunction = (device: Zh.Device | DummyDevice, options: KeyValue): Expose[] => {
if (deviceHasPressureCluster(device)) {
// Resolve the original exposes from m.pressure()
const result: Expose[] = [];
for (const item of base.exposes ?? []) {
if (typeof item === "function") {
result.push(...item(device, options));
} else {
result.push(item);
}
}
return result;
}
return [];
};

return {
...base,
// Replace static exposes with a dynamic function that checks the cluster
exposes: [exposeFn],
// Wrap each configure so it only runs when the cluster is present
configure: (base.configure ?? []).map((configureFn): Configure => {
return async (device: Zh.Device, coordinatorEndpoint: Zh.Endpoint, definition: Definition) => {
if (deviceHasPressureCluster(device)) {
await configureFn(device, coordinatorEndpoint, definition);
}
};
}),
isModernExtend: true,
};
}

interface ThirdAcceleration {
attributes: {
coolDownTime: number;
Expand Down Expand Up @@ -1405,7 +1458,7 @@ export const definitions: DefinitionWithExtend[] = [
zigbeeModel: ["3RAP0149BZ"],
model: "3RAP0149BZ",
vendor: "Third Reality",
description: "Smart air pressure sensor",
description: "Smart Filter Sensor",
extend: [
m.battery(),
m.numeric({
Expand All @@ -1416,7 +1469,7 @@ export const definitions: DefinitionWithExtend[] = [
description: "Measure dirty level",
access: "STATE_GET",
}),
m.pressure(),
conditionalPressure(),
],
ota: true,
},
Expand Down