热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Addingadevicethatreports"unknown"modelandmanufacturer

Apologiesifthisisthewrongplacetopublishthisquestion!Iboughtatemp/hu

Apologies if this is the wrong place to publish this question!

I bought a temp/humidity sensor off ebay that looks exactly like this device:
https://www.zigbee2mqtt.io/devices/TS0201.html

.. but it is not.

It is displaying unknown/undefined make/model in the logs and Z2MA.

zigbee2mqtt | Zigbee2MQTT:debug 2020-11-27 04:02:43: Received Zigbee message from 'sensor_climate_display_dining', type 'attributeReport', cluster 'msTemperatureMeasurement', data '{"measuredValue":2780}' from endpoint 1 with groupID 0
zigbee2mqtt | Zigbee2MQTT:warn 2020-11-27 04:02:43: Received message from unsupported device with Zigbee model 'undefined'
zigbee2mqtt | Zigbee2MQTT:warn 2020-11-27 04:02:43: Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html.
zigbee2mqtt | Zigbee2MQTT:debug 2020-11-27 04:02:44: Received Zigbee message from 'sensor_climate_display_dining', type 'attributeReport', cluster 'msRelativeHumidity', data '{"measuredValue":7730}' from endpoint 1 with groupID 0
zigbee2mqtt | Zigbee2MQTT:warn 2020-11-27 04:02:44: Received message from unsupported device with Zigbee model 'undefined'
zigbee2mqtt | Zigbee2MQTT:warn 2020-11-27 04:02:44: Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html._
zigbee2mqtt | Zigbee2MQTT:debug 2020-11-27 04:02:45: Received Zigbee message from 'Received Zigbee message from 'sensor_climate_display_dining', type 'attributeReport', cluster 'genPowerCfg', data '{"batteryPercentageRemaining":200,"batteryVoltage":32}' from endpoint 1 with groupID 0

It seems like it already has the required converters in fromZigbee.js:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
temperature: {

    cluster: 'msTemperatureMeasurement',

    type: ['attributeReport', 'readResponse'],

    convert: (model, msg, publish, options, meta) => {

        const temperature = parseFloat(msg.data['measuredValue']) / 100.0;

        const property = postfixWithEndpointName('temperature', msg, model);

        return {[property]: calibrateAndPrecisionRoundOptions(temperature, options, 'temperature')};

    },

},



humidity: {

    cluster: 'msRelativeHumidity',

    type: ['attributeReport', 'readResponse'],

    convert: (model, msg, publish, options, meta) => {

        const humidity = parseFloat(msg.data['measuredValue']) / 100.0;



        // https://github.com/Koenkk/zigbee2mqtt/issues/798

        // Sometimes the sensor publishes non-realistic vales, it should only publish message

        // in the 0 - 100 range, don't produce messages beyond these values.

        if (humidity >&#061; 0 && humidity <&#061; 100) {

            return {humidity: calibrateAndPrecisionRoundOptions(humidity, options, &#039;humidity&#039;)};

        }

    },

},



battery: {

    cluster: &#039;genPowerCfg&#039;,

    type: [&#039;attributeReport&#039;, &#039;readResponse&#039;],

    convert: (model, msg, publish, options, meta) &#061;> {

        const payload &#061; {};

        if (msg.data.hasOwnProperty(&#039;batteryPercentageRemaining&#039;)) {

            // Some devices do not comply to the ZCL and report a

            // batteryPercentageRemaining of 100 when the battery is full (should be 200).

            const dontDividePercentage &#061; model.meta && model.meta.battery && model.meta.battery.dontDividePercentage;

            let percentage &#061; msg.data[&#039;batteryPercentageRemaining&#039;];

            percentage &#061; dontDividePercentage ? percentage : percentage / 2;

            payload.battery &#061; precisionRound(percentage, 2);

        }

I'm not sure of the way forward to fix this, by either creating an model/vendor "undefined" in devices.js cloned off the existing TuYa device (which seems a bit of a crude hack):

1
2
3
4
5
6
7
8
    zigbeeModel: [&#039;TS0201&#039;],

    model: &#039;TS0201&#039;,

    vendor: &#039;TuYa&#039;,

    description: &#039;Temperature & humidity sensor with display&#039;,

    fromZigbee: [fz.battery, fz.temperature, fz.humidity],

    toZigbee: [],

    exposes: [e.battery(), e.temperature(), e.humidity()],

},

Or is there a way I can deal with it using a Manual Home Assistant configuration? Or is there some configuration override I can do in Z2M to force the device to present as another known existing model in Z2M?

Thanks in advance for any help.

Cheers,
Azza

该提问来源于开源项目:Koenkk/zigbee2mqtt

You're a bloody champion !!!

It works !!

Thanks Koen !

image

Passes correctly through to Home Assistant too !
image

Thanks again Koen.

Cheers,
Aaron


推荐阅读
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • 电话号码的字母组合解题思路和代码示例
    本文介绍了力扣题目《电话号码的字母组合》的解题思路和代码示例。通过使用哈希表和递归求解的方法,可以将给定的电话号码转换为对应的字母组合。详细的解题思路和代码示例可以帮助读者更好地理解和实现该题目。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • 本文讨论了使用差分约束系统求解House Man跳跃问题的思路与方法。给定一组不同高度,要求从最低点跳跃到最高点,每次跳跃的距离不超过D,并且不能改变给定的顺序。通过建立差分约束系统,将问题转化为图的建立和查询距离的问题。文章详细介绍了建立约束条件的方法,并使用SPFA算法判环并输出结果。同时还讨论了建边方向和跳跃顺序的关系。 ... [详细]
  • 本文介绍了P1651题目的描述和要求,以及计算能搭建的塔的最大高度的方法。通过动态规划和状压技术,将问题转化为求解差值的问题,并定义了相应的状态。最终得出了计算最大高度的解法。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 本文由编程笔记#小编为大家整理,主要介绍了logistic回归(线性和非线性)相关的知识,包括线性logistic回归的代码和数据集的分布情况。希望对你有一定的参考价值。 ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文介绍了一种划分和计数油田地块的方法。根据给定的条件,通过遍历和DFS算法,将符合条件的地块标记为不符合条件的地块,并进行计数。同时,还介绍了如何判断点是否在给定范围内的方法。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • 本文介绍了UVALive6575题目Odd and Even Zeroes的解法,使用了数位dp和找规律的方法。阶乘的定义和性质被介绍,并给出了一些例子。其中,部分阶乘的尾零个数为奇数,部分为偶数。 ... [详细]
  • Linux环境变量函数getenv、putenv、setenv和unsetenv详解
    本文详细解释了Linux中的环境变量函数getenv、putenv、setenv和unsetenv的用法和功能。通过使用这些函数,可以获取、设置和删除环境变量的值。同时给出了相应的函数原型、参数说明和返回值。通过示例代码演示了如何使用getenv函数获取环境变量的值,并打印出来。 ... [详细]
author-avatar
hhha老窝_349
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有