Add Tongou TOWSMR1 _TZE204_kobbcyum
terzo33 opened this issue · 2 comments
terzo33 commented
terzo33 commented
terzo33 commented
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 = {
// 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: '_TZE204_kobbcyum',
},
],
model: 'TOWSMR1',
vendor: 'Tongou',
description: 'Smart circuit breaker',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
configure: tuya.configureMagicPacket,
exposes: [tuya.exposes.switch(), e.energy(), e.temperature(), 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, 'ON', 'OFF')
.withDescription('OFF - alarm only, ON - relay will be off when threshold reached'),
exposes.numeric('threshold_1_value', ea.STATE)
.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.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
[10, '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
[18, 'meter_id', tuya.valueConverter.raw],
[20, 'clear_fault', tuya.valueConverter.onOff], // Clear fault
[21, null, null], // Forward Energy T1 - don't know what this
[22, null, null], // Forward Energy T2 - don't know what this
[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;
with this configuration it partially works, i.e. some sensors are missing and those that work are updated every 5/10 minutes
the missing sensors are:
Temperature threshold
Temperature breaker
Power threshold
Power breaker
Over current threshold
Over current breaker
Over voltage threshold
Over voltage breaker
Under voltage threshold
Under voltage breaker
Power outage memory
Indicator mode