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

 找回密码
 立即注册
查看: 4628|回复: 0

[已解决] 已解决

[复制链接]

11

主题

53

帖子

325

积分

论坛分享达人

积分
325
金钱
262
HASS币
70
发表于 2020-7-18 19:03:14 | 显示全部楼层 |阅读模式
本帖最后由 zhanghy 于 2020-7-18 19:12 编辑

蓝牙网关加入homeassitant失败,设备都是正常工作的,但是ha怎样才能加入设备呢

我的zigbee2mqtt配置

homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost'
  user: pi
  password: flyetoak
serial:
  port: /dev/ttyACM0
advanced:
  network_key:
    - 173
    - 237
    - 202
    - 116
    - 94
    - 249
    - 153
    - 164
    - 72
    - 19
    - 75
    - 128
    - 249
    - 238
    - 110
    - 19
devices:
  '0x00158d00026b57aa':
    friendly_name: '0x00158d00026b57aa'

我的mqtt.conf

port 1883
listener 1884
protocol websockets
allow_anonymous false
# 认证配置
password_file /etc/mosquitto/pwfile
# 权限配置
acl_file /etc/mosquitto/aclfile

aclfile

user pi
topic zigbee2mqtt
topic lwt_topic
topic homeassistant

user root
topic zigbee2mqtt
topic lwt_topic
topic homeassistant

我的homeassistant配置

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

homeassistant:
  # Location required to calculate the time the sun rises and sets
  latitude: !secret latitude_home
  longitude: !secret longitude_home
  #elevation: 322
  # Name of the location where Home Assistant is running
  #name: Home
  # C for Celcius, F for Fahrenheit
  #temperature_unit: C
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Asia/Shanghai
  #unit_system: imperial
  customize: !include customize.yaml
  customize_glob: !include customize_glob.yaml

# Text to speech
tts:
  - platform: google_translate

media_player:
  - platform: vlc
  #- platform: mpd
  #  host: localhost
  - platform: ha_cloud_music
    api_url: 'http://localhost:3000'
    sidebar_title: 云音乐
    sidebar_icon: mdi:music
    show_mode: fullscreen
    uid: 
    user: ''
    passwowrd: ''
    tts_before_message: '主人:'
    tts_after_message: ''
    tts_mode: 4
    is_voice: true
    is_notify: true
    is_debug: true

ha_sidebar:
  sidebar_title: 侧边栏管理
  sidebar_icon: mdi:xbox-controller-menu

ha_baidu_map:
  name: 百度地图
  icon: mdi:map-marker-radius
  ak: 

ha_ble_home:
  'person.zhanghy': '90:F0:52:94:3D:4F'

mqtt:
  discovery: true
  broker: localhost
  port: 1883
  username: pi
  password: mqtt
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'
sensor:
  - platform: mqtt
    name: MiButtonBattery
    state_topic: "zigbee2mqtt/0x00158d00026b57aa"  #替换你自己设备ID,并删掉这句注释。
    value_template: "{{ value_json.battery }}"
    unit_of_measurement: "%"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_available: "online"
    payload_not_available: "offline"
    qos: 0
    device_class: battery
    unique_id: "MiButtonBattery"
  - platform: mqtt
    name: MiButtonSignal
    state_topic: "zigbee2mqtt/0x00158d00026b57aa"  #替换你自己设备ID,并删掉这句注释。
    value_template: "{{ value_json.linkquality }}"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_available: "online"
    payload_not_available: "offline"
    qos: 0
    device_class: signal_strength
    unique_id: "MiButtonSignal"
  - platform: mqtt
    name: MiButton
    state_topic: "zigbee2mqtt/0x00158d00026b57aa"  #替换你自己设备ID,并删掉这句注释。
    value_template: "{{ value_json.click }}"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_available: "online"
    payload_not_available: "offline"
    unique_id: "MiButton"


tttt.png
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-28 18:00 , Processed in 0.060815 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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