Bonjour à tous.
Aprés avoir cherché pendant un bon moment et à défaut de solution plug and play je me suis lancé sur sa:
Sur les commentaires il y a un imprim ecran de l’interface zigbee2mqtt alors je me suis dit je tante.
Connection facile mais bien sur matériel non reconnu.
Je suis parti a la recherche de la réalisation de convertisseur et là j’étais un peu dans le mur jusqu’a ce que je tombe sur:
Et là cadeau:
You’ll need to add an external converter to Z2M:
Create a file named "TZE200.js" and put it in the same directory as your Z2M configuration.yml file
Use the text below as the content for TZE200.js
Add TZE200.js on the external converters tab to Z2M's settings
Restart Z2M
TZE200.js contents:
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 {} = require("zigbee-herdsman-converters/lib/modernExtend");
const e = exposes.presets;
const ea = exposes.access;
const tuya = require("zigbee-herdsman-converters/lib/tuya");
const utils = require("zigbee-herdsman-converters/lib/utils");
const dp = {
instalationHeight: 19,
liquidDepthMax: 21,
maxSet: 7,
miniSet: 8,
};
const tzdatapoints = {
key: [
"installation_height",
"liquid_depth_max",
"max_set",
"mini_set",
],
convertSet: async (entity, key, value, meta) => {
switch (key) {
case "installation_height": {
await tuya.sendDataPointValue(entity, dp.instalationHeight, value);
break;
}
case "liquid_depth_max": {
await tuya.sendDataPointValue(entity, dp.liquidDepthMax, value);
break;
}
case "max_set": {
await tuya.sendDataPointValue(entity, dp.maxSet, value);
break;
}
case "mini_set": {
await tuya.sendDataPointValue(entity, dp.miniSet, value);
break;
}
}
},
};
const definition = {
// Since a lot of TuYa devices use the same modelID, but use different datapoints
// it's 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_lvkk0hdg",
},
],
model: "TS0601_tlc2206zb",
vendor: "TuYa",
whiteLabel: [
{
vendor: "EPTTECH",
model: "TLC2206-ZB",
},
],
description: "EPTTECH Tank Level Monitor Zigbee",
fromZigbee: [tuya.fz.datapoints],
// toZigbee: [tuya.tz.datapoints],
toZigbee: [tzdatapoints],
onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
configure: tuya.configureMagicPacket,
exposes: [
// Here you should put all functionality that your device exposes
e
.numeric("liquid_level_percent", ea.STATE)
.withUnit("%")
.withDescription("Liquid level percentage"),
e
.numeric("liquid_depth", ea.STATE)
.withUnit("m")
.withDescription("Liquid Depth"),
e
.enum("liquid_state", ea.STATE, ["low", "normal", "high"])
.withDescription("Liquid State"),
e
.numeric("installation_height", ea.STATE_SET)
.withUnit("mm")
.withDescription("Height from sensor to tank bottom")
.withValueMin(100)
.withValueMax(3000)
.withValueStep(1),
e
.numeric("mini_set", ea.STATE_SET)
.withUnit("%")
.withDescription("Liquid minimal percentage")
.withValueMin(0)
.withValueMax(100)
.withValueStep(1),
e
.numeric("max_set", ea.STATE_SET)
.withUnit("%")
.withDescription("Liquid max percentage")
.withValueMin(0)
.withValueMax(100)
.withValueStep(1),
e
.numeric("liquid_depth_max", ea.STATE_SET)
.withUnit("mm")
.withDescription("Height from sensor to liquid level")
.withValueMin(100)
.withValueMax(2000)
.withValueStep(1),
],
meta: {
// All datapoints go in here
tuyaDatapoints: [
[22, "liquid_level_percent", tuya.valueConverter.raw],
[2, "liquid_depth", tuya.valueConverter.divideBy100],
[
1,
"liquid_state",
tuya.valueConverterBasic.lookup({ low: 1, normal: 0, high: 2 }),
],
[19, "installation_height", tuya.valueConverter.raw],
[7, "max_set", tuya.valueConverter.raw],
[8, "mini_set", tuya.valueConverter.raw],
[21, "liquid_depth_max", tuya.valueConverter.raw],
],
},
extend: [
// A preferred new way of extending functionality.
],
};
module.exports = definition;
Avec sa la magie opère:
Et coté Jeedom ca donne:
Dans les détails:
Réglage du point bas jusqu’a 2 m
Réglage du point au mini 10cm
réglage d’une alerte en point bas
reglage d’une alerte en point haut
De mon coté je compte utiliser ce truc pour le niveau d’eau de ma piscine.
D’origine c’est prévu pour le niveau de hauteur d’eau dans les citernes.
En espérant que ca vous serve.
Et si jamais vous avez vos entrées chez Zigbee2mqtt ??? vous pouvez leur souffler d’intégrer ce convertisseur ?
Jeedomez vous bien