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

 找回密码
 立即注册
查看: 8395|回复: 6

[求助] 求助大神,小米网关无法接入,求指导,谢谢~

[复制链接]

5

主题

24

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
77
HASS币
0
发表于 2018-4-9 14:57:49 | 显示全部楼层 |阅读模式
新手初学
用windows 10来安装了python和home assistant,现在用hass命令能正常启动HA,但无法添加小米网关。


configuration.yaml中设置如下:
xiaomi_aqara:
  gateways:
    - mac: 6403422da2bd
      key: 5ca8c1fa426c4df8





hass命令重新启动HA,但一直报错,求大神指导:

INFO:homeassistant.setup:Setting up xiaomi_aqara
ERROR:homeassistant.setup:Error during setup of component xiaomi_aqara
Traceback (most recent call last):
  File "d:\python\python37-32\lib\site-packages\homeassistant\setup.py", line 145, in _async_setup_component
    component.setup, hass, processed_config)
  File "d:\python\python37-32\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "d:\python\python37-32\lib\site-packages\homeassistant\components\xiaomi_aqara.py", line 123, in setup
    from xiaomi_gateway import XiaomiGatewayDiscovery
  File "d:\python\python37-32\lib\site-packages\pyxiaomigateway-0.9.0-py3.7.egg\xiaomi_gateway\__init__.py", line 9, in <module>
    from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
ModuleNotFoundError: No module named 'cryptography'
INFO:homeassistant.core:Bus:Handling <Event system_log_event[L]: timestamp=1523256331.8661985, level=ERROR, message=Error during setup of component xiaomi_aqara, exception=Traceback (most recent call last):
  File "d:\python\python37-32\lib\site-packages\homeassistant\setup.py", line 145, in _async_setup_component
    component.setup, hass, processed_config)
  File "d:\python\python37-32\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "d:\python\python37-32\lib\site-packages\homeassistant\components\xiaomi_aqara.py", line 123, in setup
    from xiaomi_gateway import XiaomiGatewayDiscovery
  File "d:\python\python37-32\lib\site-packages\pyxiaomigateway-0.9.0-py3.7.egg\xiaomi_gateway\__init__.py", line 9, in <module>
    from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
ModuleNotFoundError: No module named 'cryptography'
, source=d:\python\python37-32\lib\site-packages\homeassistant\setup.py>
INFO:homeassistant.core:Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following components and platforms could not be set up:

- [xiaomi-aqara](https://home-assistant.io/components/xiaomi_aqara/)

Please check your config., notification_id=invalid_config, service_call_id=99730416-2>
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following components and platforms could not be set up:

- [xiaomi-aqara](https://home-assistant.io/components/xiaomi_aqara/)

Please check your config. @ 2018-04-09T14:45:31.874222+08:00>>


尝试安装'cryptography',错误提示:

D:\Python\Python37-32\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
D:\Python\Python37-32\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
_configtest.c
_cffi_backend.c
d:\python\python37-32\include\pyconfig.h(59): fatal error C1083: 无法打开包括文件: “io.h”: No such file or directory
Traceback (most recent call last):
  File "D:\Python\Python37-32\lib\distutils\_msvccompiler.py", line 423, in compile
    self.spawn(args)
  File "D:\Python\Python37-32\lib\distutils\_msvccompiler.py", line 542, in spawn
    return super().spawn(cmd)
  File "D:\Python\Python37-32\lib\distutils\ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "D:\Python\Python37-32\lib\distutils\spawn.py", line 38, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
  File "D:\Python\Python37-32\lib\distutils\spawn.py", line 81, in _spawn_nt
    "command %r failed with exit status %d" % (cmd, rc))
distutils.errors.DistutilsExecError: command 'D:\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2


回复

使用道具 举报

18

主题

183

帖子

782

积分

高级会员

Rank: 4

积分
782
金钱
599
HASS币
0
发表于 2018-4-9 15:48:21 | 显示全部楼层
现在好像都不需要设置网关了  你启动ha  自动就会搜索到网关并添加下属设备
回复

使用道具 举报

5

主题

24

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
77
HASS币
0
 楼主| 发表于 2018-4-9 16:09:44 | 显示全部楼层
rexandlanny 发表于 2018-4-9 15:48
现在好像都不需要设置网关了  你启动ha  自动就会搜索到网关并添加下属设备 ...

我把configuration.yaml里面网关的信息都删掉了,然后启动ha,在命令提示符里面discovery自动找到了周边的小米网关,但是界面还是显示xiaomi_aqara是无效的配置。是因为有缓存嘛?


微信截图_20180409160831.png
回复

使用道具 举报

18

主题

183

帖子

782

积分

高级会员

Rank: 4

积分
782
金钱
599
HASS币
0
发表于 2018-4-9 17:00:02 来自手机 | 显示全部楼层
我倒是没有遇到这个问题  不过我也不太懂  你卸载ha  然后重装吧  把.homeassistant文件夹里面的都删除  试试  这是我这个脑子能想到的  见笑
回复

使用道具 举报

5

主题

24

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
77
HASS币
0
 楼主| 发表于 2018-4-9 17:03:04 | 显示全部楼层
rexandlanny 发表于 2018-4-9 17:00
我倒是没有遇到这个问题  不过我也不太懂  你卸载ha  然后重装吧  把.homeassistant文件夹里面的都删除  试 ...

我把.homeassistant文件夹都删掉了,然后它重新生成还是有,我在研究下,不行的话,明儿全部卸载干净了,重新安装好了
回复

使用道具 举报

10

主题

276

帖子

1192

积分

金牌会员

Rank: 6Rank: 6

积分
1192
金钱
916
HASS币
10
发表于 2018-4-9 17:09:56 | 显示全部楼层
mac和key的字母都大写试试
回复

使用道具 举报

5

主题

24

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
77
HASS币
0
 楼主| 发表于 2018-4-9 17:35:58 | 显示全部楼层
lmy8812 发表于 2018-4-9 17:09
mac和key的字母都大写试试

不行哦,还是一样的,
我看提示说没有这个模块:ModuleNotFoundError: No module named 'cryptography'
但是安装又报错
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-24 02:41 , Processed in 0.153557 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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