sprut / Hub

Sprut.Hub
174 stars 12 forks source link

ZigBee - _TZE200_rks0sgb7 - TS0601 #2786

Open sprut[bot] opened 11 months ago

sprut[bot] commented 11 months ago
Название Значение
Производитель _TZE200_rks0sgb7
Модель TS0601
Прошивка 67
WEB Build 1.4.15
API Build 1.9.9 (11367)
Детальная информация Address: 385CFBFFFE9388DF/57C8

Structure
  • Endpoint 1 (SMART_PLUG)
    • Input
      • 0000_Basic
        • 0000_ZCLVersion: 3 [UNSIGNED_8_BIT_INTEGER]
        • 0001_ApplicationVersion: 67 [UNSIGNED_8_BIT_INTEGER]
        • 0002_StackVersion: 0 [UNSIGNED_8_BIT_INTEGER]
        • 0003_HWVersion: 1 [UNSIGNED_8_BIT_INTEGER]
        • 0004_ManufacturerName: _TZE200_rks0sgb7 [CHARACTER_STRING]
        • 0005_ModelIdentifier: TS0601 [CHARACTER_STRING]
        • 0006_DateCode: [CHARACTER_STRING]
        • 0007_PowerSource: 1 [ENUMERATION_8_BIT]
        • FFDE_Custom: 19 [UNSIGNED_8_BIT_INTEGER]
        • FFE2_Custom: 31 [UNSIGNED_8_BIT_INTEGER]
        • FFE4_Custom: 1 [UNSIGNED_8_BIT_INTEGER]
        • FFFD_Custom: 2 [UNSIGNED_16_BIT_INTEGER]
        • FFFE_Custom: 0 [ENUMERATION_8_BIT]
      • EF00_ManufacturerSpecific
        • 0000_Custom: 0 [UNSIGNED_8_BIT_INTEGER]
        • 0001_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0002_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0009_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0065_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0066_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0067_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0068_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0069_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 006A_Custom: 2333 [TUYA_32_BIT_INTEGER]
        • 006B_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 006C_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 006D_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 006E_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 006F_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0070_Custom: 0 [TUYA_32_BIT_INTEGER]
        • 0071_Custom: 50 [TUYA_32_BIT_INTEGER]
      • 0004_Groups
        • 0000_NameSupport: 0 [BITMAP_8_BIT]
        • FFFD_Custom: 2 [UNSIGNED_16_BIT_INTEGER]
      • 0005_Scenes
        • 0000_SceneCount: 0 [UNSIGNED_8_BIT_INTEGER]
        • 0001_CurrentScene: 0 [UNSIGNED_8_BIT_INTEGER]
        • 0002_CurrentGroup: 0 [UNSIGNED_16_BIT_INTEGER]
        • 0003_SceneValid: false [BOOLEAN]
        • 0004_NameSupport: 0 [BITMAP_8_BIT]
        • FFFD_Custom: 2 [UNSIGNED_16_BIT_INTEGER]
      • FF66_ManufacturerSpecific
        • 0000_Custom: 0 [UNSIGNED_16_BIT_INTEGER]
        • FFFD_Custom: 2 [UNSIGNED_16_BIT_INTEGER]
    • Output
      • 0019_OtaUpgrade
        • 0000_UpgradeServerID: FFFFFFFFFFFFFFFF [IEEE_ADDRESS]
        • 0001_FileOffset: -1 [UNSIGNED_32_BIT_INTEGER]
        • 0006_ImageUpgradeStatus: 0 [ENUMERATION_8_BIT]
        • FFFD_Custom: 3 [UNSIGNED_16_BIT_INTEGER]
      • 000A_Time
        • FFFD_Custom: 1 [UNSIGNED_16_BIT_INTEGER]


Binding table

Group membership

Associated devices

Neighbor table

Routing table

Node Descriptor
Aps Flags0
Frequency Bands[FREQ_2400_MHZ]
Server Capabilities[]
Buffer Size82
Incoming Transfer Size82
Logical TypeRouter
Mac Capabilities[FULL_FUNCTION_DEVICE, MAINS_POWER, RECEIVER_ON_WHEN_IDLE]
Manufacturer Code0x1002 (4098)
Out Going Transfer Size82
Stack Compliance22

Power Descriptor
Current Power ModeRECEIVER_ON_IDLE
Available Power Sources[MAINS]
Current Power SourceMAINS
Power LevelFULL

OTA info
Image type0x1602 (5634)
File version0x00000043 (67)
Manufacturer code0x1002 (4098)

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

OwlBawl commented 11 months ago

Его аналог https://www.zigbee2mqtt.io/devices/PJ-1203A.html

OwlBawl commented 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 } } ] } ] }

`

OwlBawl commented 1 month ago

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;