感谢大神提供插件插件基于pykonkeio,项目地址如下:
https://github.com/jedmeng/homeassistant-konke/tree/master
本人修改最新版格式支持HA 最新版本(目前0.103)
仓库地址:https://github.com/5high/homeassistant-konke

使用HACS安装视频教程如下:


https://youtu.be/9tENCjOabNE

支持的控客设备列表如下:

switch 智能插座

- K1(Smart Plug K) [k1]
- K2 [k2]
- K2 Pro [k2]
- Mini K [minik]
- Mini Pro [minik]

light 智能灯泡

- RGB Light [klight]
- CCT Light [kbulb]

power strip 智能插排

- power strip with 4 socket and 3 usb [micmul]
- power strip with 3 socket and 4 usb [mul]

remote 红外遥控或射频遥控

- K2 with IR module or RF module [k2]
- MiniK Pro [minik]

Install 安装方法

HACS 添加仓库地址:https://github.com/5high/homeassistant-konke
搜索:控客小K 并安装,安装后重启。

config 配置文件示例

小K插座或者插排:
switch:
  - platform: konke
    name: switch_1
    model: k2
    host: 192.168.0.101
  - platform: konke
    name: switch_2
    model: minik
    host: 192.168.0.102
  - platform: konke
    name: power strip
    model: mic
    host: 192.168.0.111 配置变量: - name (string)(Optional)The display name of the device. - host (string)(Required)The host/IP address of the device. - device (string)(Required)Model String(string in square brackets) of equipment.

小K灯泡

light:
  - platform: konke
    name: bedroom light
    model: klight
    host: 192.168.0.121
  - platform: konke
    name: kitchen light
    model: kbulb
    host: 192.168.0.122 配置变量: - name (string)(Optional)The display name of the device. - host (string)(Required)The host/IP address of the device. - device (string)(Required)Model String(string in square brackets) of equipment.

小K遥控器包括红外和射频

remote:
  - platform: konke
    name: rf remote
    model: k2
    host: 192.168.0.101
    hidden: true
    type: rf
  - platform: konke
    name: ir remote
    model: minik
    host: 192.168.0.102
    hidden: false
    type: ir 配置变量: - name (string)(Optional)The display name of the device - host (string)(Required)The host/IP address of the device. - device (string)(Required)Model String(string in square brackets) of equipment. - hidden (bool)(Optional, default true)Whether to hide the equipment in the dashboard. - type (string)(Required)Remote control type: ir or rf

遥控使用方法

控客的遥控器是不支持直接输入遥控编码的,只能通过学习添加遥控器。

添加遥控:
进入service界面,选择remote.koneke_ir_learn_command或remote.koneke_rf_learn_command。

{
  "entity_id": "【设备的entity_id】",
  "slot": 【命令id,取值范围1000-99999】,
  "timeout": 【超时时长,默认10s】
}

注意solt参数是int格式,周围不能带引号,否则命令会不生效。
学习后会在主界面显示通知信息,提示学习的成功或者失败。

使用遥控:
调用remote.send_command这个service,data:

{
  "entity_id": "【设备的entity_id】",
  "command": "【遥控类型ir或rf】_【命令id,取值范围1000-99999】",
  "num_repeats": 【发送次数,默认1】,
  "delay_secs": 【两次发射间的延时,默认0.4s】
}
remote:
  - platform: konke
    host: 【设备IP】
    name: 【设备显示的名称,可不填】
    model: 【设备型号,见上面对型号的定义】
    hidden: 【是否显示这个设备,默认False,建议False】
    type:【遥控类型,红外ir,射频rf】

16 对 “Home Assistant 安装控客插件 konke插件,控制小K设备。”的想法;

  1. Home Assistant 0.103.6,已经添加仓库的konke文件夹到custom_components目录
    在configuration.yaml添加小K智能灯:

    light:
    – platform: konke
    name: bedroom light
    model: klight
    host: 192.168.0.121

    重启服务一直提示“Platform error light.konke – Integration ‘konke’ not found.”,请问哪里需要配置吗,谢谢。

  2. 和一楼一样无法使用配置检查提示Platform error switch.konke – Integration ‘konke’ not found.
    尝试hacs方式安装,添加地址后显示 未知 的源,没有刷新出可以下载小k的插件,搜索小K无可用插件

  3. 添加仓库https://github.com/5high/homeassistant-konke。添加上后显示未知,没有载入插件库,也无法搜索到小k插件。我是T1刷的ha最新版

      1. 你好,HAC方式安装成功了,各控客小K都能开关。可是遇到如下几个问题:
        1.红外只能设置一个,两个红外遥控同时配置的话 就会在添加实体那边出现错乱比如卧室的却识别成客厅的小k 然后另一个不显示,期间各种修改配置或者删除都只能用一个,我是minik_pro和k2带红外的插件。配置如下:求解
        remote:
        – platform: konke
        name: 客厅遥控K2
        model: k2
        host: 192.168.2.108
        hidden: true
        type: ir
        – platform: konke
        name: 卧室遥控minik
        model: minik
        host: 192.168.2.192
        hidden: true
        type: ir

  4. 你好经过反复测试,就是有bug啊,是不是一个局域网下无法兼容2个小k红外,我随便是2个minik_pro或者一个k2_pro一个minik_pro都是只能显示一个红外,单独使用又都能使用的,我是斐讯T1 hassio搭建的ha,版本是0.105.5,请看下是不是有bug还是其他说明问题,谢谢

  5. 你好,经过我反复测试开机日志提示这个错误,提示重名了,实际上根本没有重名,问了群里都无解,插座是可以多个,就是红外只能一个~~请帮忙解决,谢谢!
    Traceback (most recent call last):
    File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 415, in _async_add_entity
    raise HomeAssistantError(msg)
    homeassistant.exceptions.HomeAssistantError: Entity id already exists: remote.keting_minik. Platform konke does not generate unique IDs

  6. 大神你好,我把控客miniK通过HACS接入后,只能从实体中看到开关,设备中看不到。这样就不好用自动化来控制了。请问是我设置的问题,还是大家都有这个问题。有没有什么解决办法,曲线的也行啊。谢谢您的回答。

回复 xiaowangzi 取消回复