美文网首页
homeassistant使用havcs接入天猫精灵

homeassistant使用havcs接入天猫精灵

作者: 一只特例独行de猪 | 来源:发表于2020-03-27 01:17 被阅读0次

HA版本:0.83.3
插件:https://github.com/cnk700i/havcs
参考资料:
证书相关:https://www.jianshu.com/p/c57716540d62
https://bbs.hassbian.com/thread-4758-1-1.html
https://bbs.hassbian.com/thread-6291-1-1.html
https://ljr.im/articles/plugin-smart-speaker-connected-to-home-assistant-integration-plus/
使用1.2.自建技能方式接入天猫精灵,HA版本是0.83.3,如果遇到token问题,可以尝试删除.storage下面的auth文件
配置样例:

# {HA配置目录}/configuration.yaml               
http:
  api_password:*********
  ssl_certificate: /home/pi/.homeassistant/ssl/ssl.pem

# {HA配置目录}/configuration.yaml                 
havcs:
  platform:                               # 音箱平台服务网关,至少启用一个
    - aligenie                            # 天猫精灵
    # - dueros                              # 小度
    # - jdwhale                             # 叮咚
  http:
    ha_url: https://home.g.zhuxiaobo.cf:444        # HA所在主机/容器IP地址,不设置则默认识别
    expire_in_hours: 24                   # token超时时间,单位小时,不设置则默认24h

# {HA配置目录}/hacvs.yaml               
# 一个设备配置样例, 注意根据下面天猫精灵最重要的三个参数的链接去选取
switch.dc1_s2:
  havcs_device_name: 热水壶
  havcs_device_type: kettle
  havcs_zone: 主卧

天猫精灵最重要的三个参数:

  1. zone:仅支持特定的区域,如客厅、餐厅等,详细看这里:https://open.bot.tmall.com/oauth/api/placelist
  2. deviceName:设备名称也只支持特定的,否则可以显示但它听不懂可能不能控制,https://open.bot.tmall.com/oauth/api/aliaslist
  3. deviceType:必须从文档中候选:http://doc-bot.tmall.com/docs/doc.htm?treeId=393&articleId=108271&docType=1
image.png

相关文章

网友评论

      本文标题:homeassistant使用havcs接入天猫精灵

      本文链接:https://www.haomeiwen.com/subject/pnrkuhtx.html