-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS0601 PIR Sensor (_TZE200_gjldowol) #8661
base: master
Are you sure you want to change the base?
Changes from all commits
e39fc77
fd035a9
ec0384c
294ee24
cfb7430
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import * as exposes from '../lib/exposes'; | ||
import * as tuya from '../lib/tuya'; | ||
import {Definition} from '../lib/types'; | ||
|
||
const e = exposes.presets; | ||
const ea = exposes.access; | ||
|
||
const definition: Definition = { | ||
fingerprint: [ | ||
{ | ||
modelID: 'TS0601', | ||
manufacturerName: '_TZE200_gjldowol', | ||
}, | ||
], | ||
zigbeeModel: ['TS0601'], | ||
model: 'TS0601_pir_sensor', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any other model number written on the device or product page? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your follow-up. During the Zigbee2MQTT detection process, the following information is returned: const definition = {
zigbeeModel: ['TS0601'],
model: 'TS0601',
vendor: '_TZE200_gjldowol',
description: 'Automatically generated definition',
extend: [],
meta: {},
};
module.exports = definition; However, the model information printed on the device packaging and user manual differs:
This discrepancy makes it difficult to ensure accurate integration with Zigbee2MQTT. Could this be due to vendor-specific modifications to the firmware or a generic implementation for TS0601-based devices? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use |
||
vendor: '_TZE200_gjldowol', | ||
description: 'Luminance motion sensor', | ||
fromZigbee: [tuya.fz.datapoints], | ||
toZigbee: [tuya.tz.datapoints], | ||
onEvent: tuya.onEventSetTime, | ||
configure: tuya.configureMagicPacket, | ||
exposes: [ | ||
e.occupancy(), | ||
e.illuminance().withUnit('lx'), | ||
e.battery(), | ||
e | ||
.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high']) | ||
.withDescription('PIR sensor sensitivity (refresh and update only while active)'), | ||
e | ||
.numeric('keep_time', ea.STATE_SET) | ||
.withValueMin(5) | ||
.withValueMax(3600) | ||
.withValueStep(1) | ||
.withUnit('seconds') | ||
.withDescription('PIR keep time in seconds (refresh and update only while active)'), | ||
e | ||
.numeric('illuminance_interval', ea.STATE_SET) | ||
.withValueMin(1) | ||
.withValueMax(720) | ||
.withValueStep(1) | ||
.withUnit('minutes') | ||
.withDescription('Brightness acquisition interval (refresh and update only while active)'), | ||
], | ||
meta: { | ||
tuyaDatapoints: [ | ||
[1, 'occupancy', tuya.valueConverterBasic.lookup({pir: true, none: false})], | ||
[4, 'battery', tuya.valueConverter.raw], | ||
[9, 'sensitivity', tuya.valueConverterBasic.lookup({low: tuya.enum(0), medium: tuya.enum(1), high: tuya.enum(2)})], | ||
[12, 'illuminance', tuya.valueConverter.raw], | ||
[101, 'illuminance_interval', tuya.valueConverter.raw], | ||
[102, 'keep_time', tuya.valueConverter.raw], | ||
], | ||
}, | ||
}; | ||
|
||
export default definition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this into
tuya.ts
and remove this file.