Utilisation d'un module: on/off + Energy meter + volatge et courant protection, Model : ZBN-DJ-63 sur AliExpress

Bonjour,

J’ai acheté ce produit ZBN-DJ-63 sur AliExpress:

image

Spécifications:
Nom: Disjoncteur
Matériel: PC
Voltage évalué: 230VAC
Tension d’opération: AC80V-400V (monophasé)
Fréquence évaluée: 50/60Hz
Courant électrique: (>A) 1-63A

Gammes de réglage:
Protection sous tension: 80V-210V réglable
Protection contre les surtensions: 120-300V réglable
Protection contre les surintensités: 1.0A-63A réglable
Temps de reconnexion (temps de retard): 10s-99s réglable
Surintensité et fuite: 1-30 de réduction réglable
Protection contre les fuites: 10-99mA réglable
Au-dessus de la température: 10-85 réglable
Temps de retard actuel: 1s-15s réglable
Perte de temps de retard actuel: 1s-15s réglable
Température: -30 ℃ à 70 ℃
Taille de l’article: 921972mm / 3.620.752.83in
Poids de l’article: 97g / 3.42 once
Taille du paquet: 942173mm / 3.700.830.87in
Poids du colis: 120g / 4.23 once

C’est un super petit produit ! :stuck_out_tongue:

Évidement si j’ouvre ce petit poste c’est qu’il est bien détecté par la passerelle ZigBee mais que ce module est tagé " non pris en charge" :unamused:

Est ce que vous avez des idées / pistes / une expérience avec ce petit bijou ???

:wink:

Es-tu sûr que ce disjoncteur est normalement pris en charge par Zigbee2Mqtt ?

Tu l’as lu quelque part ? Il y a certes des appareils du même type pris en charge, mais ce n’est peut être pas exactement le même modèle.

Je viens de trouver qu’il n’était pas encore pris en charge par Zigbee2MQTT.

Zut ! … Merci pour ta réponse, tu va m’éviter de perdre ma journée.

Je vais donc attendre, en espérant une prochaine « release » avec la prise en charge de ce joli joujou ! :cry:

PS: Le code que tu as donné pourrait il d’une façon ou d’une autre permettre l’utilisation partielle de ce produit ?

Oui tu dois pouvoir créer un converter externe (ou il existe peut être déjà) avec les liens mentionnés mais je ne vais pas pouvoir t’aider là-dessus. Cela risque d’être top compliqué.

C’est pas ici ??

Je passe directement dans le fichier de configuration quand j’ai besoin de le faire et non via l’interface graphique.

J’ai fait quelques recherches.

J’ai la version OS
image
dans:
/homeassistant/custom_components
j’ai créé les répertoires:
zigbee-herdsman-converters/devices
dans devices j’ai créé un fichier : tuya_zbn_dj_63.js

Dans ce fichier j’ai mis la configue récupérée :

//Device type Router
//Zigbee Model - TS0601
//Zigbee Manufacturer - _TZE204_lb0fsvba

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 = {
    // Identifies the device using fingerprint instead of zigbeeModel for Tuya devices
    fingerprint: [
        {
            modelID: 'TS0601',
            manufacturerName: '_TZE204_lb0fsvba',
        },
    ],
    model: 'ZBN-DJ-63',
    vendor: 'Tuya',
    description: 'Tuya Zigbee Smart Circuit Breaker with energy monitoring and protection settings',
    fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, tuya.fz.datapoints],
    toZigbee: [tz.on_off, tz.electrical_measurement, tz.metering, tuya.tz.datapoints],
    exposes: [
        e.switch().setAccess('state', ea.ALL).withDescription('Switch the circuit breaker on/off'),
        e.energy().withAccess(ea.STATE).withDescription('Energy usage in kWh'),
        e.power().withAccess(ea.STATE).withDescription('Power usage in W'),
        e.voltage().withAccess(ea.STATE).withDescription('Voltage in V'),
        e.current().withAccess(ea.STATE).withDescription('Current in A'),

        exposes.enum('fault', ea.STATE, ['clear', 'over_current', 'over_power', 'over_voltage', 'under_voltage', 'leakage'])
            .withDescription('Fault status (clear = no faults)'),

        exposes.numeric('temperature_threshold', ea.ALL)
            .withUnit('°C')
            .withDescription('Temperature threshold for triggering protection')
            .withValueMin(10)
            .withValueMax(85),

        exposes.numeric('power_threshold', ea.ALL)
            .withUnit('W')
            .withDescription('Power threshold for triggering protection')
            .withValueMin(0)
            .withValueMax(9999),

        exposes.numeric('over_voltage_threshold', ea.ALL)
            .withUnit('V')
            .withDescription('Over voltage threshold for protection')
            .withValueMin(120)
            .withValueMax(300),

        exposes.numeric('under_voltage_threshold', ea.ALL)
            .withUnit('V')
            .withDescription('Under voltage threshold for protection')
            .withValueMin(80)
            .withValueMax(210),

        exposes.numeric('over_current_threshold', ea.ALL)
            .withUnit('A')
            .withDescription('Over current threshold for protection')
            .withValueMin(1)
            .withValueMax(63),

        exposes.numeric('leakage_current_threshold', ea.ALL)
            .withUnit('mA')
            .withDescription('Leakage current threshold for protection')
            .withValueMin(10)
            .withValueMax(99),

        exposes.binary('power_outage_memory', ea.ALL, 'ON', 'OFF')
            .withDescription('Retain state after power outage (ON - remembers last state)'),

        exposes.enum('indicator_mode', ea.ALL, ['off', 'normal', 'inverse'])
            .withDescription('LED indicator mode'),
    ],
    meta: {
        tuyaDatapoints: [
            [1, 'energy', tuya.valueConverter.divideBy100],
            [6, null, tuya.valueConverter.phaseVariant2], // Handles voltage, current, power
            [10, 'fault', tuya.valueConverterBasic.lookup({
                'clear': 0,
                'over_current': 1,
                'over_power': 2,
                'over_voltage': 4,
                'under_voltage': 9,
                'leakage': 10,
            })],
            [17, 'temperature_threshold', tuya.valueConverter.raw],
            [18, 'meter_id', tuya.valueConverter.raw],
            [19, 'power_threshold', tuya.valueConverter.divideBy10],
            [20, 'clear_fault', tuya.valueConverter.onOff],
            [21, 'leakage_current_threshold', tuya.valueConverter.divideBy100],
            [22, 'indicator_mode', tuya.valueConverterBasic.lookup({
                'off': 0,
                'normal': 1,
                'inverse': 2,
            })],
            [23, 'power_outage_memory', tuya.valueConverter.onOff],
        ],
    },
};

module.exports = definition;

J’ai restarté zigbee2mqtt
Mais ca n’a pas marché, il n’y a toujours pas de resultat.

A ce stade j’ai besoin d’aide :thinking:

PS: J’ai aussi testé cette config : ( peut etre n’ai-je pas mis la conf au bon endroit !??)

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require("zigbee-herdsman-converters/lib/tuya");

const definition = {

    fingerprint: tuya.fingerprint('TS0601', ['_TZE204_lb0fsvba']),
    model: 'TS0601_din_2',
    vendor: 'TuYa',
    description: 'Zigbee DIN energy meter',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    configure: tuya.configureMagicPacket,
    whiteLabel: [{vendor: 'XOCA', model: 'DAC2161C'}],
    exposes: [tuya.exposes.switch(), e.energy(), e.power(), e.voltage(), e.current(),
        exposes.enum('fault', ea.STATE, ['clear', 'over_current_threshold', 'over_power_threshold',
            'over_voltage threshold', 'wrong_frequency_threshold']).withDescription('Fault status of the device (clear = nothing)'),
        exposes.enum('threshold_1', ea.STATE, ['not_set', 'over_current_threshold', 'over_voltage_threshold'])
            .withDescription('State of threshold_1'),
        exposes.binary('threshold_1_protection', ea.STATE_SET, 'ON', 'OFF')
            .withDescription('OFF - alarm only, ON - relay will be off when threshold reached'),
        exposes.numeric('threshold_1_value', ea.STATE_SET)
            .withDescription('Can be in Volt or Ampere depending on threshold setting. Setup the value on the device'),
        exposes.enum('threshold_2', ea.STATE, ['not_set', 'over_current_threshold', 'over_voltage_threshold'])
            .withDescription('State of threshold_2'),
        exposes.binary('threshold_2_protection', ea.STATE, 'ON', 'OFF')
            .withDescription('OFF - alarm only, ON - relay will be off when threshold reached'),
        exposes.numeric('threshold_2_value', ea.STATE)
            .withDescription('Setup value on the device'),
		exposes.numeric('reverse_energy', ea.STATE).withUnit('kWh')
            .withDescription('Reverse Energy Total'),
		exposes.numeric('temperature', ea.STATE).withUnit('°C')
            .withDescription('Temperature'),
        exposes.binary('clear_fault', ea.STATE_SET, 'ON', 'OFF')
            .withDescription('Turn ON to clear last the fault'),
        exposes.text('meter_id', ea.STATE).withDescription('Meter ID (ID of device)'),
    ],
    meta: {
        tuyaDatapoints: [
            [1, 'energy', tuya.valueConverter.divideBy100],
            [3, null, null], // Monthly, but sends data only after request
            [4, null, null], // Dayly, but sends data only after request
            [6, null, tuya.valueConverter.phaseVariant2], // voltage and current
            [9, 'fault', tuya.valueConverterBasic.lookup({'clear': 0, 'over_current_threshold': 1,
                'over_power_threshold': 2, 'over_voltage_threshold': 4, 'wrong_frequency_threshold': 8})],
            [11, null, null], // Frozen - strange function, in native app - nothing is clear
            [16, 'state', tuya.valueConverter.onOff],
            [17, null, tuya.valueConverter.threshold], // It's settable, but can't write converter
            [103, 'temperature', tuya.valueConverter.raw],
            [20, 'clear_fault', tuya.valueConverter.onOff], // Clear fault
            [13, null, null], // Balance energy
            [110, 'reverse_energy', tuya.valueConverter.divideBy100], // Reverse Energy Total
            [23, null, null], // Forward Energy T3 - don't know what this
            [24, null, null], // Forward Energy T4 - don't know what this
        ],
    },

};

module.exports = definition;

Faut vraiment etre joueur pour mettre ces « petits bijoux » chinois noname, en plus connectés, dans son tableau elec…

Ca a l’aire bien propre et c’est CE !

C’est connecté sur du zigbee … donc bon …

Salut
Désolé je passe mon tour pour la partie zigbee mais sur la partie sécurité, j’espère juste que tu ne l’as pas mis en lieu et place d’un disjoncteur existant mais bien derrière un disjoncteur.

Oui je met soit un diff 30mA en amont, soit un diff 30mA + disjoncteur 10A classique , pour deja faire des tests!

Mais bon pour le moment ca marche pas alors …

1 « J'aime »

Petit tuto , comment je l’ai fait fonctionner ! :slight_smile:

Création du fichier des « External definitions »
ici : /homeassistant/zigbee2mqtt/tuya_zbn_dj_63.js

contenu du fichier :

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require("zigbee-herdsman-converters/lib/tuya");

const definition = {

    fingerprint: tuya.fingerprint('TS0601', ['_TZE204_lb0fsvba']),
    model: 'ZBN-DJ-63',
    vendor: 'NoName',
    description: 'Zigbee DIN energy meter',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    configure: tuya.configureMagicPacket,
    whiteLabel: [{vendor: 'XOCA', model: 'DAC2161C'}],
    exposes: [tuya.exposes.switch(), e.energy(), e.power(), e.voltage(), e.current(),
        exposes.enum('fault', ea.STATE, ['clear', 'over_current_threshold', 'over_power_threshold',
            'over_voltage threshold', 'wrong_frequency_threshold']).withDescription('Fault status of the device (clear = nothing)'),
        exposes.enum('threshold_1', ea.STATE, ['not_set', 'over_current_threshold', 'over_voltage_threshold'])
            .withDescription('State of threshold_1'),
        exposes.binary('threshold_1_protection', ea.STATE_SET, 'ON', 'OFF')
            .withDescription('OFF - alarm only, ON - relay will be off when threshold reached'),
        exposes.numeric('threshold_1_value', ea.STATE_SET)
            .withDescription('Can be in Volt or Ampere depending on threshold setting. Setup the value on the device'),
        exposes.enum('threshold_2', ea.STATE, ['not_set', 'over_current_threshold', 'over_voltage_threshold'])
            .withDescription('State of threshold_2'),
        exposes.binary('threshold_2_protection', ea.STATE, 'ON', 'OFF')
            .withDescription('OFF - alarm only, ON - relay will be off when threshold reached'),
        exposes.numeric('threshold_2_value', ea.STATE)
            .withDescription('Setup value on the device'),
		exposes.numeric('reverse_energy', ea.STATE).withUnit('kWh')
            .withDescription('Reverse Energy Total'),
		exposes.numeric('temperature', ea.STATE).withUnit('°C')
            .withDescription('Temperature'),
        exposes.binary('clear_fault', ea.STATE_SET, 'ON', 'OFF')
            .withDescription('Turn ON to clear last the fault'),
        exposes.text('meter_id', ea.STATE).withDescription('Meter ID (ID of device)'),
    ],
    meta: {
        tuyaDatapoints: [
            [1, 'energy', tuya.valueConverter.divideBy100],
            [3, null, null], // Monthly, but sends data only after request
            [4, null, null], // Dayly, but sends data only after request
            [6, null, tuya.valueConverter.phaseVariant2], // voltage and current
            [9, 'fault', tuya.valueConverterBasic.lookup({'clear': 0, 'over_current_threshold': 1,
                'over_power_threshold': 2, 'over_voltage_threshold': 4, 'wrong_frequency_threshold': 8})],
            [11, null, null], // Frozen - strange function, in native app - nothing is clear
            [16, 'state', tuya.valueConverter.onOff],
            [17, null, tuya.valueConverter.threshold], // It's settable, but can't write converter
            [103, 'temperature', tuya.valueConverter.raw],
            [20, 'clear_fault', tuya.valueConverter.onOff], // Clear fault
            [13, null, null], // Balance energy
            [110, 'reverse_energy', tuya.valueConverter.divideBy100], // Reverse Energy Total
            [23, null, null], // Forward Energy T3 - don't know what this
            [24, null, null], // Forward Energy T4 - don't know what this
        ],
    },

};

module.exports = definition;

Ajout dans le fichier de config de ZegBee2MQTT:
ici : /homeassistant/zigbee2mqtt/configuration.yaml
On lui donne le nom du fichier a charger + passage des logs en mode Debug (Si besoin)

advanced:
  network_key:
    - 98
...........
...........
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
  log_level: debug
external_converters:
  - tuya_zbn_dj_63.js
mqtt:
  base_topic: zigbee2mqtt

Enfin restart de ZegBee2Mqtt
image

Résultat:

image

Voila, il y possiblement des fonctions qui ne marchent pas ou absentes , mais en attendant d’avoir une solution 100% officielle. Ça fonctionne pour tester et utiliser le joujou :blush:

Les protections de fonctionnent pas, j’arrive pas a envoyer des valeurs « push ».
L’interrupteur fonctionne ainsi que la consomation est le compteur Kw/h.

Merci aux membres pour leur aide :+1:

1 « J'aime »

Oui c’est exactement cela qu’il fallait faire comme décrit dans la documentation. :+1:

Ba j’ai encore compris d’autres trucs :-), mais pas assez pour fixer les problèmes :thinking:

UPDATE

Pour ceux qui liraient ce post, j’aimerais dire que j’ai retourné mon ZBN-DJ-63.
C’était trop la galère ça marche pas convenablement avec Home Assistant. Les bidouilles ne servent à rien car des paramètre sont inaccessibles et bloquent le fonctionnement.

Donc si vous ne voulez pas perdre votre temps, je vous fais part du remplacement de ce « device » par le TONGOU TO-Q-SY2-163JZT (18€39) qui s’installe en 1 minute et qui est pris en charge a 100%. (tip top)

image

Il a tout ce qu’il faut, de plus la puissance de disjonction est variable et contrairement a l’autre modèle, ici « tout » est intégré « dans » le boitier.

Chose que j’avais oublié de préciser au sujet du ZBN-DJ-63 (prix : 19€39) c’est que la ferrite qui capte le courant est « externe », c’était quand même du gros bricolage « made in china ».

Voila pour le petit reporting … :wink:

2 « J'aime »

Bonjour, nouvel arrivé sur le forum, je débute aussi dans HA, mais auparavant j’utilisais mes sensors et actuateurs sur TUYA? j’ai comme toi un besoin de mesuré une puissance qui vient de mon réseau photovoltaïque, et donc qui est « négative » par rapport a ma consomation de la maison. je voudrais savoir si le TONGOU TO-Q-SY2-163JZT que tu as branché suporte cette puissance négative (en gros, mon réseau maison est sur la partie « in » , et le solaire sur la partie out du module. Merci