本帖最后由 jyz_0501 于 2018-2-1 22:48 编辑
30号了,更新先不想弄其他的了 先把现在接入的东西做个整理吧~~先上图看看有什么了
可以看出一个是太阳,
一个是小米路由器的device_tracker
5个小米的门磁传感器
1个红外传感器
1个网关灯
6个鸿雁MP1插排
2个TC2开关
和大量联网设备
那么先编辑这几个吧Group群组和Customize自定义
首先完成群组的规划,那么就把联网设备 定义为联网设备group,其他设备按房间来划分,太阳就定义为户外环境吧
--户外环境
--联网设备
--客厅
--主卧
--次卧
--书房
--餐厅
environment:
#顶格写group名
name: 户外环境
#group在ha中的名称,可以是中文
view: no
#view是表示是否作为HA顶部的分组标签
entities:
#entities下面写的是组内列表;
- sun.sun
最后代码:
Environment:
name: 户外环境
view: no
entities:
- sun.sun
#======房间=======
rooms_view: # 这是整个房间的设置
name: 房间 # 显示名称
view: yes # 是否分页 即在页头显示
entities: # ROOM 分页下的组
- group.Entrance #玄关
- group.LivingRoom #客厅
- group.BedRoom1 #主卧
- group.Study #书房
- group.DinnerRoom #餐厅
- group.CookRoom #厨房
- group.BedRoom2 #次卧
LivingRoom:
name: 客厅
view: no
icon: mdi:sofa
entities:
- sensor.broadlink_sensor_temperature
- binary_sensor.door_window_sensor_158d000200b418
- device_tracker.hisense_tv
- switch.livingroom_s1
- switch.livingroom_s2
- switch.livingroom_s3
- switch.livingroom_s4
- switch.livingroom_s5
- switch.livingroom_s6
- switch.livingroom_s7
- switch.livingroom_s8
- switch.livingroom_light1
- switch.livingroom_light2
- switch.livingroom_light_all
# Entrance:
# name: 玄关
# view: no
# icon: mdi:home-variant
# entities:
# # - sensor.broadlink_sensor_temperature
DinnerRoom:
name: 餐厅
view: no
icon: mdi:glass-tulip
entities:
- binary_sensor.door_window_sensor_158d0001e5ead9
- switch.dinnerroom_s1
- switch.dinnerroom_s2
- switch.dinnerroom_s3
- switch.dinnerroom_s4
# CookRoom:
# name: 厨房
# view: no
# icon: mdi:pot
# entities:
# - sensor.broadlink_sensor_temperature
BedRoom1:
name: 主卧
view: no
icon: mdi:hotel
entities:
# - sensor.broadlink_sensor_temperature
- sensor.illumination_7811dcb22478
- binary_sensor.motion_sensor_158d0001d571d5
- binary_sensor.door_window_sensor_158d0001c2dea6
- light.gateway_light_7811dcb22478
- switch.bedroom_light1
- switch.bedroom_light2
- switch.bedroom_light_all
- switch.bedroom_s1
- switch.bedroom_s2
- switch.bedroom_s3
- switch.bedroom_s4
BedRoom2:
name: 次卧
view: no
icon: mdi:hotel
entities:
# - sensor.broadlink_sensor_temperature
- binary_sensor.door_window_sensor_158d0001c2dd75
- switch.bedroom_s5
- switch.bedroom_s6
- switch.bedroom_s7
- switch.bedroom_s8
Study:
name: 书房
view: no
icon: mdi:book-plus
entities:
- binary_sensor.door_window_sensor_158d000200b541
- switch.study_light
- switch.study_s1
- switch.study_s2
- switch.study_s3
- switch.study_s4
#======联网设备=======
device:
name: 联网设备
#组名
view: no
#是否显示为顶部选项卡。
control: hidden
#是否设置为隐藏。真值hidden
entities:
#要分组的实体列表。
- device_tracker.raspberrypi
- device_tracker.broadlink_rmpro
- device_tracker.broadlink_rmmini
- device_tracker.broadlink_s1
- device_tracker.midea_livingroomac
- device_tracker.midea_waterheater
- device_tracker.samsung_pc
- device_tracker.superz_computer
- device_tracker.hassbian
- device_tracker.hisensetv
- device_tracker.tcl_camera
- device_tracker.broadlink_mp1_bedroom1
- device_tracker.broadlink_mp1_bedroom2
- device_tracker.broadlink_mp1_dinnerroom
- device_tracker.broadlink_mp1_livingroom
- device_tracker.broadlink_mp1_livingroom2
- device_tracker.broadlink_mp1_study
- device_tracker.light_2
- device_tracker.garage_camara
- device_tracker.robot
- device_tracker.tmallgenius
- device_tracker.tmallgenius2
- device_tracker.tmallgenius3
- device_tracker.airdetectorm1
- device_tracker.mi_acpartner
- device_tracker.mi_gateway
- device_tracker.mi_wifiamplifier
- device_tracker.wifi
- device_tracker.tl710n
- device_tracker.midea_bedroomac
这样的话分组已经分完了,但是全是字母的,我们要做中文的(进一步就要做自定义图标和图标变色以及电量显示),先做中文吧
第一步:在config文件夹下的customize.yaml文件中将各个设备、传感器、开关等的加进去,格式如下:
device_tracker.broadlink_rmpro:
#这个是设备的entity id
friendly_name: 博联RMPro
#此处是自定义的名字(昵称)
homebridge_name: 博联RMPro
#这是在HB中的名字
icon: mdi:unity
#这是自定义图标
hidden: false
#是否在HA中隐藏
homebridge_hidden: false
#是否在HB中隐藏
那么我们形成了这个些:
sensor.illumination_7811dcb2......:
friendly_name: 主卧照度
homebridge_name: 主卧照度
binary_sensor.door_window_sensor_158d0001......:
friendly_name: 主卧门
homebridge_name: 主卧门
binary_sensor.door_window_sensor_158d0001......:
friendly_name: 次卧门
homebridge_name: 次卧门
binary_sensor.door_window_sensor_158d0001......:
friendly_name: 厨房推拉门
homebridge_name: 厨房推拉门
binary_sensor.door_window_sensor_158d0002......:
friendly_name: 书房门
homebridge_name: 书房门
binary_sensor.door_window_sensor_158d0002......:
friendly_name: 入户门
homebridge_name: 入户门
binary_sensor.motion_sensor_158d0001......:
friendly_name: 客厅人体传感器
homebridge_name: 客厅人体传感器
#------开关自定义------
light.gateway_light_7811dcb22478:
friendly_name: 网关灯
homebridge_name: 网关灯
# cover.garage_door:
# friendly_name: 车库门
# icon: mdi:garage
# icon: mdi:garage-open
switch.tv_power:
homebridge_name: 电视开关
icon: mdi:power
friendly_name: 电视开关
switch.DinnerRoom_s1:
homebridge_name: 餐厅插孔1
friendly_name: 餐厅插孔1
icon: mdi:power-socket
switch.DinnerRoom_s2:
homebridge_name: 餐厅插孔2
friendly_name: 餐厅插孔2
icon: mdi:power-socket
switch.DinnerRoom_s3:
homebridge_name: 餐厅插孔3
friendly_name: 餐厅插孔3
icon: mdi:power-socket
switch.DinnerRoom_s4:
homebridge_name: 餐厅插孔4
friendly_name: 餐厅插孔4
icon: mdi:power-socket
switch.Study_s1:
homebridge_name: 小米路由器
friendly_name: 小米路由器
icon: mdi:power-socket
switch.Study_s2:
homebridge_name: 台式机电源
friendly_name: 台式机电源
icon: mdi:power-socket
switch.Study_s3:
homebridge_name: 显示器电源
friendly_name: 显示器电源
icon: mdi:power-socket
switch.Study_s4:
homebridge_name: 远程开机模块
friendly_name: 远程开机模块
icon: mdi:power-socket
switch.LivingRoom_s1:
homebridge_name: 小方摄像头
friendly_name: 小方摄像头
icon: mdi:power-socket
switch.LivingRoom_s2:
homebridge_name: 沙发插孔2
friendly_name: 沙发插孔2
icon: mdi:power-socket
switch.LivingRoom_s3:
homebridge_name: 沙发插孔3
friendly_name: 沙发插孔3
icon: mdi:power-socket
switch.LivingRoom_s4:
homebridge_name: 沙发插孔4
friendly_name: 沙发插孔4
icon: mdi:power-socket
switch.LivingRoom_s5:
homebridge_name: 电视开关
friendly_name: 电视开关
icon: mdi:power-socket
switch.LivingRoom_s6:
homebridge_name: 热水壶
friendly_name: 热水壶
icon: mdi:power-socket
switch.LivingRoom_s7:
homebridge_name: 博联RM
friendly_name: 博联RM
icon: mdi:power-socket
switch.LivingRoom_s8:
homebridge_name: 天猫精灵1
friendly_name: 天猫精灵1
icon: mdi:power-socket
switch.BedRoom_s1:
homebridge_name: 主卧插孔1
friendly_name: 主卧插孔1
icon: mdi:power-socket
switch.BedRoom_s2:
homebridge_name: 主卧插孔2
friendly_name: 主卧插孔2
icon: mdi:power-socket
switch.BedRoom_s3:
homebridge_name: 主卧插孔3
friendly_name: 主卧插孔3
icon: mdi:power-socket
switch.BedRoom_s4:
homebridge_name: 主卧插孔4
friendly_name: 主卧插孔4
icon: mdi:power-socket
switch.BedRoom_s5:
homebridge_name: 次卧插孔1
friendly_name: 次卧插孔1
icon: mdi:power-socket
switch.BedRoom_s6:
homebridge_name: 次卧插孔2
friendly_name: 次卧插孔2
icon: mdi:power-socket
switch.BedRoom_s7:
homebridge_name: 次卧插孔3
friendly_name: 次卧插孔3
icon: mdi:power-socket
switch.BedRoom_s8:
homebridge_name: 次卧插孔4
friendly_name: 次卧插孔4
icon: mdi:power-socket
switch.study_light:
friendly_name: 书房灯
switch.bedroom_light1:
friendly_name: 主卧灯
switch.bedroom_light2:
friendly_name: 主卫灯
switch.bedroom_light_all:
friendly_name: 主卧灯全开
device_tracker.broadlink_rmpro:
friendly_name: 博联RMPro
homebridge_name: 博联RMPro
icon: mdi:unity
device_tracker.broadlink_s1:
friendly_name: 博联安防S1
icon: mdi:alarm-light
device_tracker.broadlink_mp1_bedroom1:
friendly_name: 主卧插排
icon: mdi:power-plug
device_tracker.broadlink_mp1_bedroom2:
friendly_name: 次卧插排
icon: mdi:power-plug
device_tracker.broadlink_mp1_dinnerroom:
friendly_name: 餐厅插排
icon: mdi:power-plug
device_tracker.broadlink_mp1_livingroom:
friendly_name: 客厅插排
icon: mdi:power-plug
device_tracker.broadlink_mp1_livingroom2:
friendly_name: 客厅(电视柜)插排
icon: mdi:power-plug
device_tracker.broadlink_mp1_study:
friendly_name: 书房插排
icon: mdi:power-plug
device_tracker.ipad_air:
friendly_name: iPad air
icon: mdi:tablet-ipad
device_tracker.iphone_6s:
friendly_name: iPhone 6s
icon: mdi:cellphone-iphone
# hidden: true
# device_tracker.huawei:
# friendly_name: 爸爸的手机
# icon: mdi:tablet-android
device_tracker.midea_bedroomac:
friendly_name: 主卧空调
icon: mdi:air-conditioner
device_tracker.midea_livingroomac:
friendly_name: 客厅空调
icon: mdi:air-conditioner
device_tracker.midea_waterheater:
friendly_name: 热水器
icon: mdi:oil-temperature
device_tracker.samsung_pc:
friendly_name: 三星笔记本
icon: mdi:laptop
device_tracker.superz_computer:
friendly_name: 我的电脑
icon: mdi:monitor
device_tracker.hisensetv:
friendly_name: 海信电视
icon: mdi:television
device_tracker.iphone4:
friendly_name: iPhone_4
icon: mdi:cellphone-iphone
device_tracker.tmallgenius:
friendly_name: 天猫精灵(主卧)
device_tracker.robot:
friendly_name: 扫地机器人
device_tracker.garage_camara:
friendly_name: 小蚁摄像头
device_tracker.lemax:
friendly_name: LeMax
icon: mdi:tablet-android
device_tracker.b4effac0435e:
friendly_name: LeS3
icon: mdi:tablet-android
device_tracker.le_s3:
friendly_name: LeS3
icon: mdi:tablet-android
device_tracker.00db70......:
friendly_name: AppleWatch3
icon: mdi:watch
|