Skip to content
Open
Show file tree
Hide file tree
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
159 changes: 159 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3175,6 +3175,7 @@
],
"productId": [
"RH3001",
"TS0203",
"TS0203"
],
"endpoints": {
Expand Down Expand Up @@ -4767,6 +4768,164 @@
},
"settings": []
},
{
"id": "pir_mmwave_sensor",
"name": {
"en": "PIR MMWave Sensor"
},
"class": "sensor",
"platforms": [
"local"
],
"connectivity": [
"zigbee"
],
"capabilities": [
"alarm_motion",
"measure_battery",
"alarm_battery",
"measure_luminance"
],
"energy": {
"batteries": [
"CR2450"
]
},
"images": {
"large": "/drivers/pir_mmwave_sensor/assets/images/large.png",
"small": "/drivers/pir_mmwave_sensor/assets/images/small.png"
},
"zigbee": {
"manufacturerName": [
"_TZE200_y8jijhba"
],
"productId": [
"TS0601"
],
"endpoints": {
"1": {
"clusters": [
0,
1,
3,
1024,
1280,
61184
],
"bindings": [
1,
1024,
1280,
61184
]
}
},
"learnmode": {
"image": "/drivers/pir_mmwave_sensor/assets/icon.svg",
"instruction": {
"en": "Press the reset button for aprox 5 seconds until the LED blinks."
}
}
},
"settings": [
{
"type": "group",
"label": {
"en": "Motion Settings"
},
"children": [
{
"id": "fading_time",
"type": "number",
"label": {
"en": "Motion keep time"
},
"hint": {
"en": "How long motion stays active after detection (seconds)"
},
"value": 60,
"min": 0,
"max": 28800,
"units": {
"en": "seconds"
}
},
{
"id": "motion_detection_sensitivity",
"type": "number",
"label": {
"en": "Motion detection sensitivity"
},
"hint": {
"en": "Higher value = more sensitive (0-19)"
},
"value": 7,
"min": 0,
"max": 19
}
]
},
{
"type": "group",
"label": {
"en": "Light Settings"
},
"children": [
{
"id": "illuminance_interval",
"type": "number",
"label": {
"en": "Light sensing interval"
},
"hint": {
"en": "How often to update light level (minutes)"
},
"value": 5,
"min": 1,
"max": 720,
"units": {
"en": "minutes"
}
}
]
},
{
"type": "group",
"label": {
"en": "Device Settings"
},
"children": [
{
"id": "indicator",
"type": "checkbox",
"label": {
"en": "LED indicator"
},
"hint": {
"en": "Enable LED indicator light"
},
"value": true
},
{
"id": "batteryThreshold",
"type": "number",
"label": {
"en": "Battery alarm threshold"
},
"hint": {
"en": "Trigger low battery alarm at this percentage"
},
"value": 20,
"min": 5,
"max": 50,
"units": {
"en": "%"
}
}
]
}
]
},
{
"id": "pir_sensor_2",
"name": {
Expand Down
1 change: 1 addition & 0 deletions drivers/doorwindowsensor/driver.compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
],
"productId": [
"RH3001",
"TS0203",
"TS0203"
],
"endpoints": {
Expand Down
8 changes: 4 additions & 4 deletions drivers/motion_sensor_2/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class motion_sensor_2 extends ZigBeeDevice {
},{
endpointId: 1,
cluster: CLUSTER.ILLUMINANCE_MEASUREMENT,
attributeName: 'IlluminanceMeasured',
attributeName: 'measuredValue',
minInterval: 60, // Minimum interval (1 minute)
maxInterval: 3600, // Maximum interval (1 hour)
minChange: 10, // Report changes above 10 lux
Expand All @@ -49,7 +49,7 @@ class motion_sensor_2 extends ZigBeeDevice {

// measure_illuminance handler
zclNode.endpoints[1].clusters[CLUSTER.ILLUMINANCE_MEASUREMENT.NAME]
.on('attr.IlluminanceMeasured', this.onIlluminanceMeasuredAttributeReport.bind(this));
.on('attr.measuredValue', this.onIlluminanceMeasuredAttributeReport.bind(this));

// Tuya specific cluster handler
zclNode.endpoints[1].clusters.tuya.on("reporting", value => this.processResponse(value));
Expand All @@ -74,8 +74,8 @@ class motion_sensor_2 extends ZigBeeDevice {
// Handle illuminance attribute reports
onIlluminanceMeasuredAttributeReport(measuredValue) {
const luxValue = Math.round(Math.pow(10, ((measuredValue - 1) / 10000))); // Convert measured value to lux
this.log('measure_illuminance | Illuminance (lux):', luxValue);
this.setCapabilityValue('measure_illuminance', luxValue).catch(this.error);
this.log('measure_luminance | Illuminance (lux):', luxValue);
this.setCapabilityValue('measure_luminance', luxValue).catch(this.error);
}

// Process Tuya-specific data
Expand Down
49 changes: 49 additions & 0 deletions drivers/pir_mmwave_sensor/assets/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading