Open sprut[bot] opened 11 months ago
Endpoint смог раздобыть / расписать все, в порядке очередности (0000_Custom - служебный пустой) А вот init не знаю как описать для работы шаблона
`
{
"manufacturer": "EARUELETRIC",
"model": "TS0601",
"manufacturerId": "_TZE200_rks0sgb7",
"modelId": "TS0601",
"catalogId": 0,
"date": "10.12.2023",
"status": "Test",
"init": [
{
"tuya": "[{\"code\":\"power_total\",\"defaultValue\":\"0\",\"canTrigger\":true,\"iconname\":\"icon-Ele\",\"type\":\"obj\",\"executable\":false,\"mode\":\"ro\",\"defaultRecommend\":false,\"name\":\"当前电流\",\"property\":{\"unit\":\"W\",\"min\":0,\"max\":100000,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":01,\"editPermission\":false},{\"code\":\"cur_power\",\"defaultValue\":\"0\",\"canTrigger\":true,\"iconname\":\"icon-dp_tool\",\"type\":\"obj\",\"executable\":false,\"mode\":\"ro\",\"defaultRecommend\":false,\"name\":\"当前功率\",\"property\":{\"unit\":\"W\",\"min\":0,\"max\":200000,\"scale\":1,\"step\":1,\"type\":\"value\"},\"id\":19,\"editPermission\":false},{\"code\":\"cur_voltage\",\"defaultValue\":\"0\",\"canTrigger\":true,\"iconname\":\"icon-a_function_turbo\",\"type\":\"obj\",\"executable\":false,\"mode\":\"ro\",\"defaultRecommend\":false,\"name\":\"当前电压\",\"property\":{\"unit\":\"V\",\"min\":0,\"max\":5000,\"scale\":1,\"step\":1,\"type\":\"value\"},\"id\":20,\"editPermission\":false},{\"code\":\"voltage_coe\",\"defaultValue\":\"\",\"canTrigger\":false,\"iconname\":\"icon-dp_1\",\"type\":\"obj\",\"executable\":false,\"mode\":\"ro\",\"defaultRecommend\":false,\"name\":\"电压校准系数\",\"property\":{\"min\":0,\"max\":1000000,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":22,\"editPermission\":false},{\"code\":\"electric_coe\",\"defaultValue\":\"\",\"canTrigger\":false,\"iconname\":\"icon-dp_2\",\"type\":\"obj\",\"executable\":false,\"mode\":\"ro\",\"defaultRecommend\":false,\"name\":\"电流校准系数\",\"property\":{\"min\":0,\"max\":1000000,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":23,\"editPermission\":false},{\"code\":\"power_coe\",\"defaultValue\":\"\",\"canTrigger\":false,\"iconname\":\"icon-dp_3\",\"type\":\"obj\",\"executable\":false,\"mode\":\"ro\",\"defaultRecommend\":false,\"name\":\"功率校准系数\",\"property\":{\"min\":0,\"max\":1000000,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":24,\"editPermission\":false},{\"code\":\"electricity_coe\",\"defaultValue\":\"\",\"canTrigger\":false,\"iconname\":\"icon-dp_3\",\"type\":\"obj\",\"executable\":false,\"mode\":\"ro\",\"defaultRecommend\":false,\"name\":\"电量校准系数\",\"property\":{\"min\":0,\"max\":1000000,\"scale\":0,\"step\":1,\"type\":\"value\"},\"id\":25,\"editPermission\":false},{\"code\":\"electric_add\",\"defaultValue\":\"0\",\"canTrigger\":true,\"type\":\"obj\",\"executable\":true,\"mode\":\"rw\",\"defaultRecommend\":false,\"name\":\"电量\",\"property\":{\"unit\":\"kW·h\",\"min\":0,\"max\":50000,\"scale\":3,\"step\":100,\"type\":\"value\"},\"id\":101,\"editPermission\":false}]"
}
],
"services": [
{
"type": "C_WattMeter",
"characteristics": [
{
"type": "C_Watt",
"Name": "Power Total",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0009_Custom",
"scale": 1
}
}
]
},
{
"type": "C_AmpereMeter",
"characteristics": [
{
"type": "C_Ampere",
"Name": "Current Total",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0069_Custom",
"scale": 0.001
}
}
]
},
{
"type": "C_VoltMeter",
"characteristics": [
{
"type": "C_Volt",
"Name": "Voltage AC",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "006A_Custom",
"scale": 0.1
}
}
]
},
{
"type": "C_FrequencyMeter",
"characteristics": [
{
"type": "C_Frequency",
"Name": "Frequency AC",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0071_Custom",
"scale": 1
}
}
]
},
{
"type": "C_KiloWattHourMeter",
"characteristics": [
{
"type": "C_KiloWattHour",
"Name": "Consumption Total",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0001_Custom",
"scale": 0.01
}
}
]
},
{
"type": "C_KiloWattHourMeter",
"characteristics": [
{
"type": "C_KiloWattHour",
"Name": "Consumption Revese Total",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0002_Custom",
"scale": 0.01
}
}
]
},
{
"type": "C_WattMeter",
"characteristics": [
{
"type": "C_Watt",
"Name": "Power 1",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "006C_Custom",
"scale": 1
}
}
]
},
{
"type": "C_AmpereMeter",
"characteristics": [
{
"type": "C_Ampere",
"Name": "Current 1",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "006B_Custom",
"scale": 0.001
}
}
]
},
{
"type": "C_PowerFactorMeter",
"characteristics": [
{
"type": "C_PowerFactor",
"Name": "Power factor 1",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "006D_Custom",
"scale": 1
}
}
]
},
{
"type": "C_KiloWattHourMeter",
"characteristics": [
{
"type": "C_KiloWattHour",
"Name": "Consumption 1",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0065_Custom",
"scale": 0.01
}
}
]
},
{
"type": "C_KiloWattHourMeter",
"characteristics": [
{
"type": "C_KiloWattHour",
"Name": "Consumption Revese 1",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0066_Custom",
"scale": 0.01
}
}
]
},
{
"type": "C_WattMeter",
"characteristics": [
{
"type": "C_Watt",
"Name": "Power 2",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "006F_Custom",
"scale": 1
}
}
]
},
{
"type": "C_AmpereMeter",
"characteristics": [
{
"type": "C_Ampere",
"Name": "Current 2",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "006E_Custom",
"scale": 0.001
}
}
]
},
{
"type": "C_PowerFactorMeter",
"characteristics": [
{
"type": "C_PowerFactor",
"Name": "Power factor 2",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0070_Custom",
"scale": 1
}
}
]
},
{
"type": "C_KiloWattHourMeter",
"characteristics": [
{
"type": "C_KiloWattHour",
"Name": "Consumption 2",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0067_Custom",
"scale": 0.01
}
}
]
},
{
"type": "C_KiloWattHourMeter",
"characteristics": [
{
"type": "C_KiloWattHour",
"Name": "Consumption Revese 2",
"link": {
"endpoint": 1,
"cluster": "EF00_ManufacturerSpecific",
"attribute": "0068_Custom",
"scale": 0.01
}
}
]
}
]
}
`
z2m работающий конвертор для устройства:
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 tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const e = exposes.presets;
const ea = exposes.access;
const {Buffer} = require('buffer');
const valueConverter = {
divideBy10: tuya.valueConverterBasic.divideBy(10),
divideBy100: tuya.valueConverterBasic.divideBy(100),
divideBy1000: tuya.valueConverterBasic.divideBy(1000),
};
const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE200_rks0sgb7',
},
],
model: 'TS0601_Bidirectional_Energy_Meter_with_80A_Current_Clamp',
vendor: 'TuYa',
description: 'Bidirectional Energy Meter with 80A Current Clamp',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime,
configure: tuya.configureMagicPacket,
whiteLabel: [ tuya.whitelabel('TuYa', 'PJ-1203A', 'Bidirectional Energy Meter with 80A Current Clamp', ['_TZE200_rks0sgb7']), ],
// whiteLabel: [{vendor: 'EARU', model: 'PC311-Z-TY'}],
exposes: [ //only report data
exposes.numeric('frequency_ac', ea.STATE).withUnit('Hz').withDescription('Frequency'),
exposes.numeric('power_A', ea.STATE).withUnit('W').withDescription('Power A'),
exposes.numeric('power_B', ea.STATE).withUnit('W').withDescription('Power B'),
exposes.numeric('total_power', ea.STATE).withUnit('W').withDescription('Total power'),
exposes.numeric('voltage', ea.STATE).withUnit('V').withDescription('Voltage'),
exposes.numeric('current_A', ea.STATE).withUnit('A').withDescription('Current A'),
exposes.numeric('current_B', ea.STATE).withUnit('A').withDescription('Current B'),
exposes.numeric('total_current', ea.STATE).withUnit('A').withDescription('Total Current'),
exposes.numeric('power_factor_A', ea.STATE).withUnit('%').withDescription('Power factor A'),
exposes.numeric('power_factor_B', ea.STATE).withUnit('%').withDescription('Power factor B'),
exposes.numeric('consumption_reverse_A', ea.STATE).withUnit('kWh').withDescription('Consumption reverse A'),
exposes.numeric('consumption_reverse_B', ea.STATE).withUnit('kWh').withDescription('Consumption reverse B'),
exposes.numeric('total_consumption_reverse', ea.STATE).withUnit('kWh').withDescription('Total Consumption reverse'),
exposes.numeric('consumption_A', ea.STATE).withUnit('kWh').withDescription('Consumption A'),
exposes.numeric('consumption_B', ea.STATE).withUnit('kWh').withDescription('Consumption B'),
exposes.numeric('total_consumption', ea.STATE).withUnit('kWh').withDescription('Total Consumption'),
],
meta:{
tuyaDatapoints: [//only report data
[113, 'frequency_ac', tuya.valueConverter.raw],
[108, 'power_A', tuya.valueConverter.raw],
[111, 'power_B', tuya.valueConverter.raw],
[9, 'total_power', tuya.valueConverter.raw],
[106, 'voltage', tuya.valueConverter.divideBy10],
[107, 'current_A', tuya.valueConverter.divideBy1000],
[110, 'current_B', tuya.valueConverter.divideBy1000],
[105, 'total_current', tuya.valueConverter.divideBy1000],
[109, 'power_factor_A', tuya.valueConverter.raw],
[112, 'power_factor_B', tuya.valueConverter.raw],
[102, 'consumption_reverse_A', tuya.valueConverter.divideBy100],
[104, 'consumption_reverse_B', tuya.valueConverter.divideBy100],
[2, 'total_consumption_reverse', tuya.valueConverter.divideBy100],
[101, 'consumption_A', tuya.valueConverter.divideBy100],
[103, 'consumption_B', tuya.valueConverter.divideBy100],
[1, 'total_consumption' , tuya.valueConverter.divideBy100],
],
},
};
module.exports = definition;
Детальная информация
Address: 385CFBFFFE9388DF/57C8Structure
Binding table
Group membership
Associated devices
Neighbor table
Routing table
Node Descriptor
Power Descriptor
OTA info
Mode: TUYA_MODE_1
Last update: Fri Dec 08 21:00:35 EET 2023
Дополнительно
Telegram: @owlbawl
визуально полный аналог этого https://sprut.ai/catalog/item/tuya-smart-life-zigbee-schetchik-energii-80a
Только 2 канала измерения
Где приобрели? https://www.aliexpress.com/item/1005005923525604.html?spm=a2g0o.order_list.order_list_main.66.60dc1802etM4Ap