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

 找回密码
 立即注册
查看: 1725|回复: 5

[经验分享] 华为&豪恩安防三件套通过z2b接入HA

[复制链接]

13

主题

128

帖子

817

积分

高级会员

Rank: 4

积分
817
金钱
689
HASS币
0
发表于 2024-1-2 17:51:46 | 显示全部楼层 |阅读模式
1704185730180.jpg 环境:
虚拟机HAOS
Z2B-加载项方式
EMQX-加载项方式
MQTT集成
小米多模网关2(最新版本)
hacs→xiaomiGW3(最新版)工作在z2b模式。在ZHA模式可以添加但是上报的消息不对也没有实体(期待大佬解决)
豪恩&华为套装(网关通过WiFi报给华为这个搞不了,子设备均可以在HA工作。期待有大佬搞定网关)
1704186114449.jpg
1#
人体传感器直接长按重置z2b即可以发现,人体传感器仅上报有人消息,所以一旦触发有人就会一直是有人的状态(上报间隔大约1分钟,暂时不晓得怎么更改),没有无人的消息上报(可能为了省电),我自己的土方法HA自动化→无人后1分钟向该设备的MQTT主题发送一个false来使HA的状态产生变化如下图:
1704186975545.jpg
2#
温度传感器直接傻瓜配对即可,不知道为什么有感叹号,但是读数是正常的。上报规则大约是温度变化在1摄氏度左右即上报。湿度未知。
1704187588435.jpg
3#
门窗传感器依然是傻瓜配对,但是配置完后是不支持的,从图片可以看出正常支持的是HO-09ZB,但是华为版的是HO-10ZB。按照论坛内的z2b转换一下就可以了,由于需要图片设备型号我是按照错误添加的。如果不需要图片可以填写实际的真实型号或者自己想办法拉取真实图片。
1704188533308.jpg

#################################################################################################################################################################################################
至于稳定性和联动性我没有测试,网关下还有一个汇泰龙的门锁没有测试,害怕翻车进不来家里而且也不安全。
回复

使用道具 举报

17

主题

800

帖子

5736

积分

论坛元老

Rank: 8Rank: 8

积分
5736
金钱
4931
HASS币
0
发表于 2024-1-2 21:01:19 | 显示全部楼层
针对只上报有人的设备,Z2M里可以设置超时时间,强制回到无人,不需要给MQTT发消息~
回复

使用道具 举报

0

主题

12

帖子

160

积分

注册会员

Rank: 2

积分
160
金钱
148
HASS币
0
发表于 2024-4-15 11:31:12 | 显示全部楼层
[{"id":"2d9a5054a8fae4f1","type":"server-state-changed","z":"0641284abaf75ea3","name":"入门人体1分钟","server":"c49cccbd.da52d","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.ru_men_ren_ti_chuan_gan_qi_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"1","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":420,"wires":[["31528cbfe2472044"],[]]},{"id":"09eee90635f05a95","type":"mqtt out","z":"0641284abaf75ea3","name":"","topic":"zigbee2mqtt/入门人体传感器","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"78dee5ef52e1c97a","x":540,"y":400,"wires":[]},{"id":"31528cbfe2472044","type":"change","z":"0641284abaf75ea3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"occupancy":false}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":360,"wires":[["09eee90635f05a95"]]},{"id":"edcc90667994cf2f","type":"inject","z":"0641284abaf75ea3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":320,"wires":[["31528cbfe2472044"]]},{"id":"c49cccbd.da52d","type":"server","name":"Home Assistant","addon":true},{"id":"78dee5ef52e1c97a","type":"mqtt-broker","name":"localhost","broker":"192.168.2.211","port":"1883","clientid":"nodered","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]



nodered 的代码,
等大佬改js吧,实在
回复

使用道具 举报

0

主题

12

帖子

160

积分

注册会员

Rank: 2

积分
160
金钱
148
HASS币
0
发表于 2024-5-13 16:22:48 | 显示全部楼层
sirakawa 发表于 2024-1-2 21:01
针对只上报有人的设备,Z2M里可以设置超时时间,强制回到无人,不需要给MQTT发消息~ ...

https://www.zigbee2mqtt.io/guide ... ance-considerations

请教下大佬是通过 device-availability设置吗?

我设置timeout一分钟后,设置为设备不存在。
可能还可以通过  # false = {"state":"online"} / {"state":"offline"}
把unavaliable设置为off,
不过~算了,意义不大
回复

使用道具 举报

17

主题

800

帖子

5736

积分

论坛元老

Rank: 8Rank: 8

积分
5736
金钱
4931
HASS币
0
发表于 2024-5-16 21:26:45 | 显示全部楼层
试试这个
occupancy_timeout: Time in seconds after which occupancy is cleared after detecting it (default 90 seconds). The value must be a number with a minimum value of 0

回复

使用道具 举报

19

主题

417

帖子

2467

积分

金牌会员

Rank: 6Rank: 6

积分
2467
金钱
2045
HASS币
20
发表于 2024-5-16 21:32:37 | 显示全部楼层
很早就支持了
                屏幕截图_16-5-2024_213152_192.168.50.140.jpeg
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 02:47 , Processed in 0.101041 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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