[External Converter]: TS0601 from _TZE28C1000000_geabeatp
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.7k
- Forks
- 2k
- Avg merge
- 18h 55m
- Merged PRs (30d)
- 35
Description
Link
https://www.aliexpress.com/item/1005012846160209.html
Database entry
{"id":115,"type":"Router","ieeeAddr":"0xa4c1389798baa10e","nwkAddr":44782,"manufId":4417,"manufName":"_TZE28C1000000_geabeatp","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,57344,60160,60672,4,5,3,61184],"outClusterList":[10,25],"clusters":{"genBasic":{"attributes":{"65503":"\u0000\u0000\u0000\u0000\f","65507":"sdk:3.0.18;cfg:0.0.0;ker:0.0.20;","65508":0,"65533":2,"65534":0,"manufacturerName":"_TZE28C1000000_geabeatp","zclVersion":3,"appVersion":99,"modelId":"TS0601","powerSource":1}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":99,"stackVersion":1,"hwVersion":1,"dateCode":"�\u000e\u0000\f\u0000\u0002P\u0014","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":"0.0.0"},"lastSeen":1787382484955}
Zigbee2MQTT version
2.13.0 (unknown)
External converter
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;
// Custom converter for Phase A raw data (DP 6) based on Tuya API specification
const phaseAConverter = {
to: (v) => v,
from: (value) => {
if (!value) return {};
const buf = Buffer.isBuffer(value) ? value : Buffer.from(value);
if (buf.length < 17) return {};
return {
voltage: buf.readUInt16BE(2) / 10, // Voltage (0.1V)
current: buf.readUIntBE(4, 3) / 1000, // Current (0.001A)
power: buf.readUIntBE(7, 3), // Active Power (1W)
power_factor: buf.readUInt8(16) / 100, // Power Factor (0.01)
};
},
};
// Custom converter to handle power-on behavior enum without relying on newer tuyaEnum versions
const powerOnBehaviorConverter = {
to: (v) => ({'off': 0, 'on': 1, 'memory': 2}[v] ?? 0),
from: (v) => ({0: 'off', 1: 'on', 2: 'memory'}[v] ?? 'off'),
};
const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE28C1000000_geabeatp',
},
],
model: 'JGQW01-63',
vendor: 'Tuya',
description: 'DIN Rail Smart Circuit Breaker & Energy Meter',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
// Magic packet is often required for stable operation of Tuya MCUs
configure: tuya.configureMagicPacket,
exposes: [
e.switch().setAccess('state', ea.STATE_SET),
e.energy(),
e.voltage(),
e.current(),
e.power(),
e.power_factor(),
e.numeric('supply_frequency', ea.STATE).withUnit('Hz').withDescription('Supply frequency'),
e.temperature(),
// Device Settings
e.enum('power_on_behavior', ea.ALL, ['off', 'on', 'memory']).withDescription('Power-on behavior'),
e.binary('lcd_switch', ea.ALL, true, false).withDescription('LCD display switch'),
e.numeric('power_on_delay', ea.ALL).withUnit('s').withDescription('Power-on delay time').withValueMin(0).withValueMax(999999),
e.numeric('over_vol_recovery_time', ea.ALL).withUnit('s').withDescription('Over/under voltage recovery time'),
// Prepayment and Reset Features
e.binary('prepayment_switch', ea.ALL, true, false).withDescription('Prepayment mode switch'),
e.numeric('balance_energy', ea.STATE).withUnit('kWh').withDescription('Remaining available energy'),
e.numeric('energy_charge', ea.ALL).withUnit('kWh').withDescription('Energy recharge amount').withValueMin(0).withValueMax(9999.99),
e.binary('clear_energy', ea.SET, true, false).withDescription('Clear accumulated energy (Trigger)'),
e.binary('factory_reset', ea.SET, true, false).withDescription('Factory reset (Trigger)'),
],
meta: {
tuyaDatapoints: [
[16, 'state', tuya.valueConverter.onOff],
[1, 'energy', tuya.valueConverter.divideBy100],
[6, null, phaseAConverter],
[11, 'prepayment_switch', tuya.valueConverter.raw],
[12, 'clear_energy', tuya.valueConverter.raw],
[13, 'balance_energy', tuya.valueConverter.divideBy100],
[14, 'energy_charge', tuya.valueConverter.divideBy100],
[32, 'supply_frequency', tuya.valueConverter.divideBy100],
[34, 'factory_reset', tuya.valueConverter.raw],
[47, 'temperature', tuya.valueConverter.divideBy10],
[61, 'power_on_behavior', powerOnBehaviorConverter],
[101, 'lcd_switch', tuya.valueConverter.raw],
[102, 'over_vol_recovery_time', tuya.valueConverter.raw],
[104, 'power_on_delay', tuya.valueConverter.raw],
],
},
};
module.exports = definition;
What does/doesn't work with the external definition?
I bought this device here: https://www.aliexpress.com/item/1005012846160209.html
Everything works, except that it takes a very long time to receive data, and I can't fix it (I don't have the knowledge).
Notes
software_build_id: undefined
date_code: �P
endpoints:
{"1":{"clusters":{"input":["genBasic","57344","60160","60672","genGroups","genScenes","genIdentify","manuSpecificTuya"],"output":["genTime","genOta"]}},"242":{"clusters":{"input":[],"output":["greenPower"]}}}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied external JavaScript definition, especially its Tuya datapoint mappings and configure function, and compare those with the device database entry for TS0601/_TZE28C1000000_geabeatp. Determine why reported data is delayed and verify that the device publishes its exposed readings promptly and consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 48/100