Skip to content

Instantly share code, notes, and snippets.

@Koenkk
Last active April 14, 2023 10:20
Show Gist options
  • Save Koenkk/86ea747a683752fd6ff9390abf9fda55 to your computer and use it in GitHub Desktop.
Save Koenkk/86ea747a683752fd6ff9390abf9fda55 to your computer and use it in GitHub Desktop.
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 reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
fingerprint: tuya.fingerprint('TS0601', ['_TZE200_yojqa8xn']),
model: 'TS0601_gas_sensor',
vendor: 'TuYa',
description: 'Gas sensor',
fromZigbee: [tuya.fzDataPoints],
toZigbee: [tuya.tzDataPoints],
configure: tuya.configureMagicPacket,
exposes: [e.gas()],
meta: {
tuyaDatapoints: [
[1, 'gas', tuya.valueConverter.true0ElseFalse],
[2, 'detected_gas', tuya.valueConverter.raw],
[6, 'alarm_ringtone', tuya.valueConverter.raw],
[7, 'alarm_time', tuya.valueConverter.raw],
[8, 'auto_detect', tuya.valueConverter.raw],
[9, 'auto_detect_result', tuya.valueConverter.raw],
[11, 'preheat', tuya.valueConverter.raw],
],
},
};
module.exports = definition;
@Koenkk
Copy link
Author

Koenkk commented Dec 2, 2022

I've created the pr, please check the comments: Koenkk/zigbee-herdsman-converters#5065

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment