本帖最后由 zraxx 于 2021-6-2 15:35 编辑
hass设备:N1 hass版本:Home Assistant 2021.4.6
插件名称:Passive BLE monitor integration (Xiaomi Mijia BLE MiBeacon monitor)
插件安装:通过hacs安装,hacs-集成-搜索ble,安装最新版本2.7.1
https://github.com/custom-components/ble_monitor
或者下载插件
ble_monitor-2.7.1.zip
(697.37 KB, 下载次数: 97)
,解压缩到目录custom_components
插件配置:在configuration.yaml 中增加如下代码
ble_monitor:
bt_interface: '43:45:C0:XX:XX:XX'
##n1蓝牙mac
discovery: True
active_scan: False
report_unknown: False
batt_entities: False
decimals: 1
period: 10
log_spikes: False
use_median: False
restore_state: False
devices:
- mac: 'A4:C1:38:XX:XX:XX'
name: '小房温湿度计'
encryption_key: '6a5b67911507f57047XXXXXXXXXXXXX' # 加密设备才需要bindkey 32位数字和字母组成(目前仅有LYWSD03MMC加密)
temperature_unit: C
decimals: 2
use_median: False
restore_state: default
- mac: '88:0F:10:80:XX:XX'
name: scales##体重秤1
- mac: 'A4:C1:38:79:XX:XX'
name: '客厅温湿度计'
encryption_key: 'dd9a5e66ca6890541bXXXXXXXXXXX'
temperature_unit: C
decimals: 2
use_median: False
restore_state: default
- mac: 'A4:C1:38:2A:XX:XX'
name: '衣帽间温湿度计'
encryption_key: '1f0b14ac1df46e863bXXXXXXXXXX'
temperature_unit: C
decimals: 2
use_median: False
restore_state: default
- mac: 'C4:7C:8D:65:XX:XX'
name: '花花草草监测仪'
- mac: 'E4:AA:EC:34:XX:XX'
name: '阳台门窗感应器2'
encryption_key: '3a52aa3cc2cd80f34e9XXXXXXXX'
增加称体重小爱音箱自动播报重量
- id: 981d90aa25a14c1db76c45fa5869ea82
alias: miscale
trigger:
- platform: state
entity_id: binary_sensor.ble_weight_removed_scales
from: 'on'
to: 'off'
for: '2'
condition: []
action:
- service: hello_miai.add2msgqueue
data:
wait_time: 4
miai_num: 0
message: 你的体重'{{states('sensor.ble_non_stabilized_weight_scales')}}'斤
mode: single
花花草草监测仪
门窗感应器2
体重秤
温湿度计2
|