-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathconfiguration.yaml
187 lines (156 loc) · 5.9 KB
/
configuration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
homeassistant:
# Name of the location where Home Assistant is running
name: Home 402
# Location required to calculate the time the sun rises and sets
latitude: !secret home_latitude # 关于!secret开头的部分,请先读readme。
longitude: !secret home_longitude
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: !secret home_elevation
# metric for Metric, imperial for Imperial
unit_system: metric # 单位(公制)
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Asia/Shanghai # 时区
# Customization file
customize: !include customize.yaml # 关于!include开头的部分,请先读readme。
# https://www.home-assistant.io/docs/configuration/splitting_configuration/
auth_providers:
- type: trusted_networks
trusted_networks:
- 10.0.0.20/30
- ::1
allow_bypass_login: true
- type: homeassistant
zeroconf:
group: !include groups.yaml # 分组
automation: !include automations.yaml # 自动化
script: !include scripts.yaml # 脚本/批处理命令
switch: !include_dir_merge_list switches # 开关/含博联遥控器命令码
homekit: !include homekit.yaml # 管理homekit出现的项目
# iOS App 需要的部件
default_config:
# mobile_app:
# discovery: # Discover some devices automatically
ios: # advanced notifications like actionable notifications and categories
# cloud: # securely connecting to your Home Assistant via Nabu Casa
# Show links to resources in log and frontend
# introduction:
# Enables the frontend
frontend:
themes: !include_dir_merge_named themes # 主题
# Enables configuration UI
config: # 在前端显示配置菜单
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
# updater:
# Optional, allows Home Assistant developers to focus on popular components.
# include_used_components: true
# Allows you to issue voice commands from the frontend in enabled browsers
# conversation:
# Enables support for tracking state changes over time
history:
# View all events in a logbook
logbook:
# https://developers.home-assistant.io/docs/api/rest
api:
# Enables a map showing the location of tracked devices
map:
system_health:
# zone常用来判断到达或离开一个地点
# https://www.home-assistant.io/integrations/zone/
zone:
- name: Home
latitude: !secret home_latitude
longitude: !secret home_longitude
radius: 100
icon: mdi:home
# https://www.home-assistant.io/integrations/person/
person:
- name: Erimus
id: erimus
user_id: !secret home_assistant_user_id
device_trackers:
- device_tracker.erimuss_iphonexr
- device_tracker.ping_iphonexr
# Track the sun 日出/日落/等
sun:
# Sensors 感应器
# https://www.home-assistant.io/integrations/sensor/
sensor: !include sensor.yaml
# weather: # 天气预报/用不上就先
# - platform: darksky
# api_key: !secret darksky_token
# mode: daily
# Text to speech
# tts: !include tts.yaml
# media_player: !include media_player.yaml
# 顾名思义 就是命令行
shell_command: !include shell_command.yaml
# binary_sensor:
# - platform: ping
# host: 10.0.0.22
# count: 2
# scan_interval: 10
# https://www.home-assistant.io/integrations/device_tracker/
device_tracker: # 设备跟踪器
# 使用ping确认手机是否接入局域网
- platform: ping
hosts:
ping_iphonexr: 10.0.0.22
consider_home: 900 # 判断离开所需的秒数
# 使用icloud追踪位置
# 重启后在网页会提示登陆认证,按要求操作即可。
# https://www.home-assistant.io/integrations/icloud/
icloud:
- username: !secret icloud_username
password: !secret icloud_password
max_interval: 5 # 每隔5分钟取一次位置 即便是静止状态
gps_accuracy_threshold: 300 # gps精度 默认500
remote: # 遥控器
- platform: broadlink
host: 10.0.0.30
mac: !secret broadlink_mac
smartir: # 博联空调面板插件
climate: # https://github.com/smartHomeHub/SmartIR/blob/master/docs/CLIMATE.md
- platform: smartir
name: Aircon Hitachi
unique_id: hitachi_ac
device_code: 1085 # 设备码 见上方链接
controller_data: 10.0.0.30
temperature_sensor: sensor.aircon_temperature
# humidity_sensor: sensor.humidity
power_sensor: input_boolean.aircon
# https://github.com/peterbuga/HASS-sonoff-ewelink 这个有问题
# 需要手动安装 pip install websocket-client
# SSL证书问题 https://timonweb.com/tutorials/fixing-certificate_verify_failed-error-when-trying-requests_html-out-on-mac/
# 最终用的这个 https://github.com/AlexxIT/SonoffLAN
sonoff: # 易微联
username: !secret ewelink_username
password: !secret ewelink_password
api_region: us # 根据自己注册的账号所在地区填写
# ================================================== 状态记录器
input_boolean:
theater_mode: # 用来记录剧场模式的状态
# home_return_fuzzy: # 用来记录iphone是否即将到家
at_home: # 用来记录【在家】开关的状态
initial: true
playing_sound: # if windows PC playing sound
# ================================================== HomeKit适配
# 这里重复分组只是为了在homekit自动识别为灯泡,否则会识别为开关,要手动改图标。
# https://www.home-assistant.io/integrations/homekit/
# 看其中的 Supported Components
light:
- platform: switch
name: Light 1
entity_id: switch.light_1_smart
- platform: switch # 这里等于做一个alias 用light2替代sonoff原本的id
name: Light 2
# entity_id: switch.light_2
entity_id: switch.sonoff_1000d557a0
- platform: switch
name: Light 3
entity_id: switch.light_3_smart