视频教程:

1.首先解析域名smartplugconnect.phicomm.com到你的Home Assistant 服务器。
——————————————————————————————
2.下载一个DC1网络配置工具安卓版本
DC1网络配置工具
——————————————————————————————
3.点此下载插件
再把附件放到.homeassistant/custom_components/下
—————————————————————————————-
4.配置文件增加如下配置(一个DC1插排):

switch:
  - platform: phicomm_dc1
    name: dc1
    ip: "192.168.2.116"   #修改此处为你的DC1 插排IP地址
    ports: {'1':'dc1_s1','2':'dc1_s2','3':'dc1_s3'}
  - platform: template
    switches:
      dc1_template:
        friendly_name: 总开关
        value_template: "{{ is_state('switch.dc1', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1
      dc1_s1_template:
        friendly_name: 插座1
        value_template: "{{ is_state('switch.dc1_s1', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_s1
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_s1
      dc1_s2_template:
        friendly_name: 插座2
        value_template: "{{ is_state('switch.dc1_s2', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_s2
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_s2
      dc1_s3_template:
        friendly_name: 插座3
        value_template: "{{ is_state('switch.dc1_s3', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_s3
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_s3
sensor:
  - platform: template
    sensors:
      dc1_v:
        friendly_name: 当前电压
        value_template: "{{ states.switch.dc1.attributes.v }}"
        unit_of_measurement: V
      dc1_p:
        friendly_name: 当前功率
        value_template: "{{ states.switch.dc1.attributes.p }}"
        unit_of_measurement: W
      # dc1_totale:
      #   friendly_name: 累计用电
      #   value_template: "{{ states.switch.dc1.attributes.totalelect }}"
      #   unit_of_measurement: 度
group:
  dc1:
    name: 工作区DC1排插
    view: no
    entities:
      - sensor.dc1_v
      - sensor.dc1_p
      #- sensor.dc1_totale
      - switch.dc1_template
      - switch.dc1_s1_template
      - switch.dc1_s2_template
      - switch.dc1_s3_template

homeassistant:
customize:
# Add an entry for each entity that you want to overwrite.
switch.dc1:
hidden: true
switch.dc1_s1:
hidden: true
switch.dc1_s2:
hidden: true
switch.dc1_s3:
hidden: true

配置文件增加如下配置(两个DC1插排):

switch:
  - platform: phicomm_dc1
    name: dc1
    ip: "192.168.2.116"  #修改此处为你的DC1 插排IP地址
    ports: {'1':'dc1_s1','2':'dc1_s2','3':'dc1_s3'}
  - platform: phicomm_dc1
    name: dc1_2
    ip: "192.168.2.122"  #修改此处为你的DC1 插排IP地址
    ports: {'1':'dc1_2_s1','2':'dc1_2_s2','3':'dc1_2_s3'}
  - platform: template
    switches:
      dc1_template:
        friendly_name: 总开关
        value_template: "{{ is_state('switch.dc1', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1
      dc1_s1_template:
        friendly_name: 插座1
        value_template: "{{ is_state('switch.dc1_s1', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_s1
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_s1
      dc1_s2_template:
        friendly_name: 插座2
        value_template: "{{ is_state('switch.dc1_s2', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_s2
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_s2
      dc1_s3_template:
        friendly_name: 插座3
        value_template: "{{ is_state('switch.dc1_s3', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_s3
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_s3
	   
      dc1_2_template:
        friendly_name: 总开关
        value_template: "{{ is_state('switch.dc1', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1
      dc1_2_s1_template:
        friendly_name: 插座3
        value_template: "{{ is_state('switch.dc1_s1', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_2_s1
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_2_s1
      dc1_2_s2_template:
        friendly_name: 插座4
        value_template: "{{ is_state('switch.dc1_s2', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_2_s2
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_2_s2
      dc1_2_s3_template:
        friendly_name: 插座5
        value_template: "{{ is_state('switch.dc1_s3', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.dc1_2_s3
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.dc1_2_s3
sensor:
  - platform: template
    sensors:
      dc1_v:
        friendly_name: 当前电压
        value_template: "{{ states.switch.dc1.attributes.v }}"
        unit_of_measurement: V
      dc1_p:
        friendly_name: 当前功率
        value_template: "{{ states.switch.dc1.attributes.p }}"
        unit_of_measurement: W
      dc1_2_v:
        friendly_name: 当前电压
        value_template: "{{ states.switch.dc1_2.attributes.v }}"
        unit_of_measurement: V
      dc1_2_p:
        friendly_name: 当前功率
        value_template: "{{ states.switch.dc1_2.attributes.p }}"
        unit_of_measurement: W
      # dc1_totale:
      #   friendly_name: 累计用电
      #   value_template: "{{ states.switch.dc1.attributes.totalelect }}"
      #   unit_of_measurement: 度
group:
  dc1:
    name: 工作区DC1排插
    view: no
    entities:
      - sensor.dc1_v
      - sensor.dc1_p
      #- sensor.dc1_totale
      - switch.dc1_template
      - switch.dc1_s1_template
      - switch.dc1_s2_template
      - switch.dc1_s3_template
  dc1_2:
    name: DC1排插2
    view: no
    entities:
      - sensor.dc1_2_v
      - sensor.dc1_2_p
      #- sensor.dc1_totale
      - switch.dc1_2_template
      - switch.dc1_2_s1_template
      - switch.dc1_2_s2_template
      - switch.dc1_2_s3_template
homeassistant:        
  customize:
    # Add an entry for each entity that you want to overwrite.
    switch.dc1:
      hidden: true
    switch.dc1_s1:
      hidden: true
    switch.dc1_s2:
      hidden: true
    switch.dc1_s3:
      hidden: true

7 对 “斐讯DC1 插排接入Home Assistant (0.93版本)”的想法;

  1. 按照你的教程看了几遍了,我用手机APP配置了DC1。灯也变了,但是,我怎么知道DC1的IP地址呢?视频没有交代,请多指教,谢谢!

    1. 你可以从路由器上看到DC1的IP地址,路由器的DHCP池里可以看到,如果不确定是哪个地址,你可以ping配合插拔电源来测试是不是这个地址。

      1. 地址池了找到了PHICOMM_9E16F0,然后按照你的步骤试了,还是不行,还有一个问题,这个版本有packages文件夹吗,版本太多,而且很多教程,搞晕了。我的是0.93版本。

  2. 请问配置多个传感器后homeassistant首页只显示当前配置的插座,之前的温湿度传感器不见了怎么找回来?

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据