Suite a l’achat de Smart Air Box
j’ai du suivre la procédure d’intégration de zigbee2mqtt pour que ce produit soit reconnu.
à faire :
créer dans le même dossier que configuration.yaml
un fichier SEA802-Zigbee.js
contenu du fichier :
edit swap du dp 2 et 22
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 {
calibrateAndPrecisionRoundOptions,
} = require("zigbee-herdsman-converters/lib/utils");
const reporting = require("zigbee-herdsman-converters/lib/reporting");
const extend = require("zigbee-herdsman-converters/lib/extend");
const tuya = require("zigbee-herdsman-converters/lib/tuya");
const e = exposes.presets;
const ea = exposes.access;
const definition = {
// Since a lot of Tuya devices use the same modelID, but use different data points
// it's usually necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
// The model ID from: Device with modelID 'TS0601' is not supported
// You may need to add \u0000 at the end of the name in some cases
modelID: "TS0601",
// The manufacturer name from: Device with modelID 'TS0601' is not supported.
// manufacturerName: "_TZE200_8ygsuhe1",
manufacturerName: "_TZE200_ryfmq5rl",
},
],
model: "SEA802-Zigbee",
vendor: "Tuya",
description: "Smart air box",
supports: "temperature, humidity",
fromZigbee: [
fz.ignore_basic_report,
{
cluster: "manuSpecificTuya",
type: [
"commandSetDataResponse",
"commandGetData",
"commandActiveStatusReport",
],
convert: (model, msg, publish, options, meta) => {
const dp = msg.data.dp;
const value = tuya.getDataValue(msg.data.datatype, msg.data.data);
switch (dp) {
case 22:
return { co2: value };
case 18:
return {
temperature: calibrateAndPrecisionRoundOptions(
value / 10.0,
options,
"temperature"
),
};
case 19:
return {
humidity: calibrateAndPrecisionRoundOptions(
value / 10.0,
options,
"humidity"
),
};
case 21:
return { hcho: value };
case 2:
return { voc: value };
default:
meta.logger.warn(`zigbee-herdsman-converters:SaswellThermostat: NOT RECOGNIZED DP #${dp} with data ${JSON.stringify(msg.data)} => (${value})`);
}
return null;
},
},
],
toZigbee: [
//tz.tuya_data_point_test, // Another debug converter
],
onEvent: tuya.setTime, // Add this if you are getting no converter for 'commandSetTimeRequest'
/* meta: {
configureKey: 1,
}, */
/* configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await bind(endpoint, coordinatorEndpoint, ["genBasic"]);
}, */
exposes: [e.temperature(), e.humidity(), e.co2(), e.voc(), e.hcho()],
};
module.exports = definition;
Verifiez bien le nom du constructeur dans la ligne
manufacturerName: "_TZE200_ryfmq5rl",
(j’ai du la mettre en phase avec qui était en debug)
Une fois fait allez dans setting onglet External Converters
cliquez sur +
ajouter le nom de votre fichier js ici SEA802-Zigbee.js
puis SUBMIT
Redémarrez
setting tools restart zigbee2mqtt
Voila
Have a fun
Bon Dimanche