Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New device Nous E9
// Название: NOUS
// Модель: E9 (Gas Sensor)
// modelID: TS0601
// manufacturerName: _TZE204_qvxrkeif
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
fingerprint: tuya.fingerprint("TS0601", ["_TZE204_qvxrkeif"]),
model: "E9",
vendor: "NOUS",
description: "Zigbee gas sensor",
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
e.binary('gas', ea.STATE, 'ON', 'OFF').withDescription('Gas detection state (ON = Gas detected)'), // DP 1
e.binary('preheat', ea.STATE, 'ON', 'OFF').withDescription('Sensor is preheating'), // DP 10
e.binary('fault_alarm', ea.STATE, 'ON', 'OFF').withDescription('Sensor fault detected'), // DP 11
e.numeric('lifecycle', ea.STATE).withUnit('%').withDescription('Sensor life remaining'), // DP 12
],
meta: {
tuyaDatapoints: [
[1, 'gas', tuya.valueConverter.trueFalse0],
[10, 'preheat', tuya.valueConverter.trueFalse0],
[11, 'fault_alarm', tuya.valueConverter.trueFalse1],
[12, 'lifecycle', tuya.valueConverter.raw],
],
},
};
module.exports = definition;