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

 找回密码
 立即注册
查看: 8067|回复: 10

[求助] 新人 - 小米接入homeassistant

[复制链接]

1

主题

15

帖子

77

积分

注册会员

Rank: 2

积分
77
金钱
62
HASS币
0
发表于 2018-12-19 12:04:06 | 显示全部楼层 |阅读模式
新人第一次用白群暉 - docker 試接淨化機無作用,求解大神!
001.png

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 0
  longitude: 0
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: UTC
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Sensors
sensor:
  # Weather prediction
  - platform: yr

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

# Example configuration.yaml entry
sensor:
  - platform: xiaomi_miio
    name: Xiaomi Air Quality Monitor
    host: 192.168.8.162
    token: f06b67cxzxxxxxxxxxxxxxxxx2e52

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml



Home Assistant  故障碼
Platform xiaomi_miio not ready yet. Retrying in 60 seconds.
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午12:03 helpers/entity_platform.py (WARNING)
Unable to discover a device at address 192.168.8.162
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午12:03 components/sensor/xiaomi_miio.py (ERROR)
Setup failed for xiaomi_aqara: Component failed to initialize.
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午12:03 setup.py (ERROR)
No gateway discovered
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午12:03 components/xiaomi_aqara.py (ERROR)
Platform xiaomi_miio not ready yet. Retrying in 30 seconds.
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午12:02 helpers/entity_platform.py (WARNING)
Unable to discover a device at address 192.168.8.162
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午12:02 components/sensor/xiaomi_miio.py (ERROR)




回复

使用道具 举报

27

主题

1292

帖子

5873

积分

元老级技术达人

积分
5873
金钱
4556
HASS币
100
发表于 2018-12-19 16:07:01 | 显示全部楼层
路由器上ip绑定了吗,192.168.8.162 设备ip是不是换了所以发现不了
回复

使用道具 举报

1

主题

15

帖子

77

积分

注册会员

Rank: 2

积分
77
金钱
62
HASS币
0
 楼主| 发表于 2018-12-19 17:11:02 | 显示全部楼层
25989406 发表于 2018-12-19 16:07
路由器上ip绑定了吗,192.168.8.162 设备ip是不是换了所以发现不了

感謝大神,更換ip後Xiaomi Air Quality Monitor跑出來了 ! 感謝

回复

使用道具 举报

27

主题

1292

帖子

5873

积分

元老级技术达人

积分
5873
金钱
4556
HASS币
100
发表于 2018-12-19 18:45:03 | 显示全部楼层
howard6869 发表于 2018-12-19 17:11
感謝大神,更換ip後Xiaomi Air Quality Monitor跑出來了 ! 感謝

wifi设备的ip需要在路由器里自己绑定下,要不然会经常变的
回复

使用道具 举报

1

主题

15

帖子

77

积分

注册会员

Rank: 2

积分
77
金钱
62
HASS币
0
 楼主| 发表于 2018-12-19 21:13:09 | 显示全部楼层
25989406 发表于 2018-12-19 18:45
wifi设备的ip需要在路由器里自己绑定下,要不然会经常变的

感謝25989406大 !
現在加 小米網關狀況又不同,請教是那裡文法錯誤,感謝 !
homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 0
  longitude: 0
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: UTC
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Sensors
sensor:
  # Weather prediction
  - platform: yr

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

# You can leave MAC empty if you only have one gateway.
xiaomi_aqara:
  discovery_retry: 5
  gateways:
    - key: 63BxxxxxA037489F


group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml






Home Assistant  故障碼

Setup failed for xiaomi_aqara: Component failed to initialize.
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午9:08 setup.py (ERROR)
No gateway discovered
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午9:08 components/xiaomi_aqara.py (ERROR)
Setup of xiaomi_aqara is taking over 10 seconds.
[color=var(--paper-item-body-secondary-color, var(--secondary-text-color))]下午9:07 util/async_.py (WARNING)

回复

使用道具 举报

4

主题

100

帖子

818

积分

高级会员

Rank: 4

积分
818
金钱
718
HASS币
0
发表于 2018-12-19 22:07:47 | 显示全部楼层
howard6869 发表于 2018-12-19 21:13
感謝25989406大 !
現在加 小米網關狀況又不同,請教是那裡文法錯誤,感謝 !
homeassistant:

試試把日誌啟用一下:
logger:
  default: error
   logs:
    xiaomi_gateway: debug
    homeassistant.components.xiaomi_aqara: debug

然後把homeassistant.log裡面的記錄貼上來看看.
另外貼UI上的信息時建議先貼到記事簿再轉貼過來, 不然會有無關的源碼跑出來會蠻煩的.
回复

使用道具 举报

1

主题

15

帖子

77

积分

注册会员

Rank: 2

积分
77
金钱
62
HASS币
0
 楼主| 发表于 2018-12-19 23:37:54 | 显示全部楼层
抚音 发表于 2018-12-19 22:07
試試把日誌啟用一下:[code]logger:
  default: error
   logs:

大大,日誌如下,不知是否有誤 ?


2018-12-19 13:07:48 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds.
2018-12-19 13:08:03 ERROR (SyncWorker_6) [homeassistant.components.xiaomi_aqara] No gateway discovered
2018-12-19 13:08:03 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Component failed to initialize.
2018-12-19 14:07:38 ERROR (MainThread) [homeassistant.components.updater] Got unexpected response: None
回复

使用道具 举报

4

主题

100

帖子

818

积分

高级会员

Rank: 4

积分
818
金钱
718
HASS币
0
发表于 2018-12-20 10:31:05 | 显示全部楼层
howard6869 发表于 2018-12-19 23:37
大大,日誌如下,不知是否有誤 ?

日誌顯示HA並沒有偵測到你的小米網關, 你用的是哪一款? 目前支援的只有這三款小米網關產品:
Xiaomi Mijia Gateway (lumi.gateway.v2, lumi.gateway.v3)
Aqara Air Conditioning Companion (lumi.acpartner.v3)

如果是這三款, 試試指定一下IP和MAC:
xiaomi_aqara:
  gateways:
    - mac: xxxxxxxxxxxx
      key: xxxxxxxxxxxxxxxx
      host: 192.168.8.x

還是不行的話把全部log啟用了再抓上來看:
logger:
  default: debug
回复

使用道具 举报

1

主题

15

帖子

77

积分

注册会员

Rank: 2

积分
77
金钱
62
HASS币
0
 楼主| 发表于 2018-12-22 05:23:28 | 显示全部楼层
抚音 发表于 2018-12-20 10:31
日誌顯示HA並沒有偵測到你的小米網關, 你用的是哪一款? 目前支援的只有這三款小米網關產品:
Xiaomi Mijia  ...

抚音大 : 感謝,小米網關控制顯示出來.

目前增加第2個小米網關與log啟用. 無顯示結果,請教頁面是那設定錯誤, 感謝

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 0
  longitude: 0
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: UTC
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Sensors
sensor:
  # Weather prediction
  - platform: yr

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

# 12 characters MAC can be obtained from the gateway.
xiaomi_aqara:
  gateways:
    - mac: 34XXXX69ca
      key: 63XXXXXXXXXX
      host: 192.168.8.111

xiaomi_aqara:
  gateways:
    - mac: f0XXXX438c
      key: 12XXXXXXXX418C
      host: 192.168.8.112

logger:
   default: debug

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml


1.png
回复

使用道具 举报

4

主题

100

帖子

818

积分

高级会员

Rank: 4

积分
818
金钱
718
HASS币
0
发表于 2018-12-22 15:25:49 | 显示全部楼层
howard6869 发表于 2018-12-22 05:23
抚音大 : 感謝,小米網關控制顯示出來.

目前增加第2個小米網關與log啟用. 無顯示結果,請教頁面是那設定錯 ...

HA的configuration.yaml檔中,中每個分類(domain)只可出現一次,多個小米網關應按以下方式設置:
xiaomi_aqara:
  gateways:
    - mac: xxxxxxxxxxxx
      key: xxxxxxxxxxxxxxxx
    - mac: xxxxxxxxxxxx
      key: xxxxxxxxxxxxxxxx

可參考:
https://www.home-assistant.io/components/xiaomi_aqara/
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-24 05:21 , Processed in 0.179481 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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