Koenkk / Koenkk/zigbee2mqtt

[External Converter]: TS0803 from _TZ30801000000_ykzalb63

Open
#33,049 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

external converter
Dominant language
TypeScript
Stars
15.7k
Forks
2k
Avg merge
18h 55m
Merged PRs (30d)
35

Description

Link

https://qr.1688.com/s/PvIOfYOy?spm=5176.28103460.0.0.241029886yuWVi

Database entry

Unable to extract database entry. IEEE: 0xa4c138ba6b54c932, nwkAddr: 57131, model: TS0803, manufacturerName: _TZ30801000000_ykzalb63

Zigbee2MQTT version

2.13.0 (unknown)

External converter
// 外部转换器专用代码
// 注意:在 external_converters 中,fz, tz, exposes, reporting 等变量通常由 Zigbee2MQTT 自动注入全局作用域。

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 e = exposes.presets;
const ea = exposes.access;

const definition = {
    // 1. 指纹匹配:精确匹配你截图中的设备信息
    fingerprint: [
        { modelID: 'TS0803', manufacturerName: '_TZ30801000000_ykzalb63' }
    ],
    
    // 2. 基础定义
    model: 'TS0803',
    vendor: 'TuYa', // 统一归类为 TuYa 以便管理
    description: '插卡取电开关 (Card Switch)',
    
    // 3. 功能实现:直接引用通用的开关逻辑 (on_off)
    // 这相当于你参考代码中的 m.onOff(),但在外部转换器中这样写最稳定
    fromZigbee: [fz.on_off],
    toZigbee: [tz.on_off],
    
    // 4. 暴露给 HA 的功能点
    exposes: [
        e.switch()
    ],

    // 5. 配置元数据 (关键步骤:优化 HA 显示)
    meta: {
        // 告诉 HA 这是一个“插座”或“开关”,而不是灯
        // 这样在 HA 仪表盘里会显示为开关图标,而不是灯泡图标
        publishDuplicateTransaction: false 
    },
    
    // 6. 配置图标 (可选)
    // 如果你希望它在 HA 里显示为“卡片”图标,可以在 HA 前端自定义,
    // 或者在这里尝试通过 meta 传递(部分版本支持)
};

module.exports = definition;
What does/doesn't work with the external definition?

Basic on/off control works. Energy monitoring status is unknown as no specific clusters were identified in the initial pairing.

Notes

software_build_id: undefined
date_code: ``
endpoints:

{"1":{"clusters":{"input":["genBasic","57344","60160","60672","genIdentify","genGroups","genScenes","genOnOff"],"output":["genTime","genOta"]}},"242":{"clusters":{"input":[],"output":["greenPower"]}}}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied external converter and the reported endpoint cluster list for model TS0803. Compare this definition with existing device support and verify the device's on/off behavior; done should provide repository support matching the working external converter and clarify whether energy monitoring is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.