『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1475|回复: 3

[求助] 求大神写个三星密码锁zigbee模块的配置文件

[复制链接]

10

主题

198

帖子

1735

积分

金牌会员

Rank: 6Rank: 6

积分
1735
金钱
1537
HASS币
0
发表于 2021-11-6 20:17:07 | 显示全部楼层 |阅读模式
本帖最后由 sdhuaren 于 2021-11-7 12:08 编辑

HA软件环境 Hass OS 2021.10.6  + zigbee2mqtt 1.22.0三星密码锁:SHP-DP728 ;电池:1.5v * 4或8节 ;原锁开锁方式:机械钥匙/指纹/密码/磁卡/蓝牙
后来买了zigbee模块,配合使用的IoT网关实在是垃圾,发热不说,官方app“Samsung SDS Security Hub”死活无法连接到本地wifi,app store里都是类似的评论,只能弃用。
现打算将zigbee模块通过zigbee2mqtt接入HA,刚开始无法识别model ID,我在database里自定义了model ID(不知道这样对不对)后可以接收到模块发出的消息。
当前问题是状态反馈不及时(开关门状态不改变)、电量显示不准确、无法控制解锁;应该是要配置 fz和tz文件的,奈何不会任何语言,请大神帮忙写个配置文件或者指导一下。
希望能实现密码锁的实时状态反馈、电量百分比及控制解锁。


zigbee模块: 微信图片_20211019224435.jpg

设备界面:
z2m界面.PNG


database.db :
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b000be8b1a1","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,8,10,11,12,13,47,110,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":261,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"8":{"profId":260,"epId":8,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"10":{"profId":260,"epId":10,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"11":{"profId":260,"epId":11,"devId":1024,"inClusterList":[1281],"outClusterList":[1280,1282],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"12":{"profId":49246,"epId":12,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"13":{"profId":260,"epId":13,"devId":5,"inClusterList":[25],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"47":{"profId":260,"epId":47,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"110":{"profId":260,"epId":110,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"interviewCompleted":true,"meta":{},"lastSeen":null}
{"id":2,"type":"EndDevice","ieeeAddr":"0x00158d00023ea99d","nwkAddr":21620,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.sensor_motion","epList":[1],"endpoints":{"1":{"epId":1,"inClusterList":[],"outClusterList":[],"clusters":{"genBasic":{"attributes":{"65282":[{"elmType":16,"elmVal":1},{"elmType":33,"elmVal":3105},{"elmType":33,"elmVal":5032},{"elmType":36,"elmVal":[0,1]},{"elmType":33,"elmVal":13364},{"elmType":32,"elmVal":88}],"modelId":"lumi.sensor_motion","appVersion":11}},"msOccupancySensing":{"attributes":{"occupancy":1}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":11,"interviewCompleted":true,"meta":{},"lastSeen":1636197174793}
{"id":3,"type":"EndDevice","ieeeAddr":"0x000d6f000f836d9f","nwkAddr":47993,"manufId":3,"manufName":"SAMSUNG SDS","powerSource":"Battery","modelId":"SHS-ADT300","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":10,"inClusterList":[0,1,3,4,5,9,257],"outClusterList":[25],"clusters":{"closuresDoorLock":{"attributes":{"lockState":1}},"genPowerCfg":{"attributes":{"batteryVoltage":88}},"genBasic":{"attributes":{"manufacturerName":"SAMSUNG SDS","powerSource":3,"zclVersion":1,"appVersion":2,"stackVersion":83,"hwVersion":1}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":2,"stackVersion":83,"hwVersion":1,"zclVersion":1,"interviewCompleted":true,"meta":{},"lastSeen":1636196747017}

自定义配置 SHS-ADT300.js:
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 e = exposes.presets;
const ea = exposes.access;

const fzLocal = {
    Samsung_easycode_action: {
        cluster: 'closuresDoorLock',
        type: 'raw',
        convert: (model, msg, publish, options, meta) => {
            const lookup = {
                10: 'lock',
                14: 'inside_unlock',
                                2: 'unlock',
                                4: 'finger_unlock',
                3: 'rfid_unlock',
                0: 'keypad_unlock',
            };
                        const result = {};
            const value = lookup[msg.data[4]];
            if (value == 'lock') {
                return {action: value};
                                return {lock_state: locked};
                                return {state: LOCK};
            } else if (value == 'inside_unlock') {
                return {action: value};
                                return {lock_state: unlocked};
                                return {state: UNLOCK};
            } else {
                return {action: lookup[msg.data[3]]};
            }
        },
    },
        

        
}
const definition = {
    zigbeeModel: ['SHS-ADT300'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'SHP-DP728', // Vendor model number, look on the device for a model number
    vendor: 'SAMSUNG SDS', // Vendor of the device (only used for documentation and startup logging)
    description: 'Smart Lock', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    fromZigbee: [fzLocal.Samsung_easycode_action, fz.lock, fz.battery, fz.lock_operation_event], // fz.lock_programming_event, fz.lock_pin_code_response, fz.lock_user_status_response,
    toZigbee: [tz.lock, tz.pincode_lock, tz.lock_userstatus], // Should be empty, unless device can be controlled (e.g. lights, switches).
    meta: {battery: {voltageToPercentage: '3V_2100'}},
    exposes: [e.lock(), e.battery(), e.pincode()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
};
configure: async (device, coordinatorEndpoint, logger) => {
// Device advertises itself as Router but is an EndDevice
device.type = 'EndDevice';
device.save();
},

module.exports = definition;



Logs:
debug 2021-11-06 07:05:12: Received Zigbee message from 'DOORLOCK', type 'raw', cluster 'closuresDoorLock', data '{"data":[9,127,32,2,14,255,255,0,195,50,134,97],"type":"Buffer"}' from endpoint 1 with groupID 0
info  2021-11-06 07:05:12: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"inside_unlock","battery":100,"linkquality":94,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 07:05:12: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"","battery":100,"linkquality":94,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 07:05:12: MQTT publish: topic 'zigbee2mqtt/DOORLOCK/action', payload 'inside_unlock'
debug 2021-11-06 07:05:18: Received Zigbee message from 'DOORLOCK', type 'raw', cluster 'closuresDoorLock', data '{"data":[9,0,32,2,10,255,255,0,202,50,134,97],"type":"Buffer"}' from endpoint 1 with groupID 0
info  2021-11-06 07:05:18: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"lock","battery":100,"linkquality":110,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 07:05:18: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"","battery":100,"linkquality":110,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 07:05:18: MQTT publish: topic 'zigbee2mqtt/DOORLOCK/action', payload 'lock'
debug 2021-11-06 07:06:12: Received Zigbee message from 'DOORLOCK', type 'attributeReport', cluster 'closuresDoorLock', data '{"lockState":1}' from endpoint 1 with groupID 0
info  2021-11-06 07:06:12: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"battery":100,"linkquality":110,"lock_state":"locked","state":"LOCK","voltage":8800}'

debug 2021-11-06 07:33:52: Received Zigbee message from 'DOORLOCK', type 'attributeReport', cluster 'closuresDoorLock', data '{"lockState":1}' from endpoint 1 with groupID 0
info  2021-11-06 07:33:52: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"battery":100,"linkquality":107,"lock_state":"locked","state":"LOCK","voltage":8800}'

debug 2021-11-06 16:37:45: Received Zigbee message from 'DOORLOCK', type 'raw', cluster 'closuresDoorLock', data '{"data":[9,23,32,3,2,1,0,0,246,184,134,97],"type":"Buffer"}' from endpoint 1 with groupID 0
info  2021-11-06 16:37:45: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"rfid_unlock","battery":100,"linkquality":118,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 16:37:45: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"","battery":100,"linkquality":118,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 16:37:45: MQTT publish: topic 'zigbee2mqtt/DOORLOCK/action', payload 'rfid_unlock'

debug 2021-11-06 16:37:52: Received Zigbee message from 'DOORLOCK', type 'raw', cluster 'closuresDoorLock', data '{"data":[9,24,32,2,10,255,255,0,254,184,134,97],"type":"Buffer"}' from endpoint 1 with groupID 0
info  2021-11-06 16:37:52: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"lock","battery":100,"linkquality":110,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 16:37:52: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"","battery":100,"linkquality":110,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 16:37:52: MQTT publish: topic 'zigbee2mqtt/DOORLOCK/action', payload 'lock'

debug 2021-11-06 16:47:23: Received Zigbee message from 'DOORLOCK', type 'attributeReport', cluster 'closuresDoorLock', data '{"lockState":1}' from endpoint 1 with groupID 0
info  2021-11-06 16:47:23: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"battery":100,"linkquality":102,"lock_state":"locked","state":"LOCK","voltage":8800}'

debug 2021-11-06 17:15:03: Received Zigbee message from 'DOORLOCK', type 'attributeReport', cluster 'closuresDoorLock', data '{"lockState":1}' from endpoint 1 with groupID 0
info  2021-11-06 17:15:03: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"battery":100,"linkquality":102,"lock_state":"locked","state":"LOCK","voltage":8800}'

debug 2021-11-06 19:00:51: Received Zigbee message from 'DOORLOCK', type 'raw', cluster 'closuresDoorLock', data '{"data":[9,31,32,2,14,255,255,0,129,218,134,97],"type":"Buffer"}' from endpoint 1 with groupID 0
info  2021-11-06 19:00:51: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"inside_unlock","battery":100,"linkquality":76,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 19:00:51: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"","battery":100,"linkquality":76,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 19:00:51: MQTT publish: topic 'zigbee2mqtt/DOORLOCK/action', payload 'inside_unlock'
debug 2021-11-06 19:00:58: Received Zigbee message from 'DOORLOCK', type 'raw', cluster 'closuresDoorLock', data '{"data":[9,32,32,2,10,255,255,0,136,218,134,97],"type":"Buffer"}' from endpoint 1 with groupID 0
info  2021-11-06 19:00:58: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"lock","battery":100,"linkquality":105,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 19:00:58: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"action":"","battery":100,"linkquality":105,"lock_state":"locked","state":"LOCK","voltage":8800}'
info  2021-11-06 19:00:58: MQTT publish: topic 'zigbee2mqtt/DOORLOCK/action', payload 'lock'
debug 2021-11-06 19:03:07: Saving state to file /config/zigbee2mqtt/state.json
debug 2021-11-06 19:05:47: Received Zigbee message from 'DOORLOCK', type 'attributeReport', cluster 'closuresDoorLock', data '{"lockState":1}' from endpoint 1 with groupID 0
info  2021-11-06 19:05:47: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"battery":100,"linkquality":107,"lock_state":"locked","state":"LOCK","voltage":8800}'

debug 2021-11-06 19:33:27: Received Zigbee message from 'DOORLOCK', type 'attributeReport', cluster 'closuresDoorLock', data '{"lockState":1}' from endpoint 1 with groupID 0
info  2021-11-06 19:33:27: MQTT publish: topic 'zigbee2mqtt/DOORLOCK', payload '{"battery":100,"linkquality":107,"lock_state":"locked","state":"LOCK","voltage":8800}'

我对数据的初步分析如下:
1.PNG









回复

使用道具 举报

11

主题

242

帖子

1897

积分

论坛技术达人

积分
1897
金钱
1645
HASS币
40
发表于 2021-11-7 10:57:57 | 显示全部楼层
三星的不是支持网络开锁么,抓包分析一下,node-red上弄一个mqtt-lock就好了
回复

使用道具 举报

3

主题

53

帖子

291

积分

中级会员

Rank: 3Rank: 3

积分
291
金钱
238
HASS币
0
发表于 2022-10-27 18:32:08 | 显示全部楼层
解决了吗,同求接入教程啊
回复

使用道具 举报

3

主题

23

帖子

134

积分

注册会员

Rank: 2

积分
134
金钱
111
HASS币
0
发表于 2023-5-7 22:04:55 | 显示全部楼层
解决了吗?求教程,接受收费
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-3-29 06:29 , Processed in 0.069401 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表