+ purifier / monitor
This commit is contained in:
parent
b41a6523af
commit
99291a8026
|
@ -79,33 +79,21 @@
|
|||
{
|
||||
"cards": [
|
||||
{
|
||||
"entity": "script.media_previous",
|
||||
"entity": "switch.theater_mode",
|
||||
"icon_height": "105px",
|
||||
"show_name": false,
|
||||
"tap_action": {
|
||||
"action": "call-service",
|
||||
"service": "script.media_previous"
|
||||
},
|
||||
"type": "entity-button"
|
||||
},
|
||||
{
|
||||
"entity": "script.media_play_pause",
|
||||
"entity": "switch.purifier",
|
||||
"icon_height": "105px",
|
||||
"show_name": false,
|
||||
"tap_action": {
|
||||
"action": "call-service",
|
||||
"service": "script.media_play_pause"
|
||||
},
|
||||
"type": "entity-button"
|
||||
},
|
||||
{
|
||||
"entity": "script.media_next",
|
||||
"entity": "switch.monitor",
|
||||
"icon_height": "105px",
|
||||
"show_name": false,
|
||||
"tap_action": {
|
||||
"action": "call-service",
|
||||
"service": "script.media_next"
|
||||
},
|
||||
"type": "entity-button"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -94,6 +94,58 @@
|
|||
- entity_id: switch.water_pump
|
||||
service: switch.turn_off
|
||||
|
||||
# 监听空气污染状态
|
||||
- id: auto_turn_on_purifier
|
||||
alias: Auto turn on purifier
|
||||
description: 根据空气状态自动开净化器
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/10'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.at_home
|
||||
state: 'on'
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.waqi_pudong_monitoring_station_shanghai_shang_hai_pu_dong_jian_ce_zhan
|
||||
above: 100
|
||||
- condition: state
|
||||
entity_id: switch.purifier
|
||||
state: 'off'
|
||||
action:
|
||||
- entity_id: switch.purifier
|
||||
service: switch.turn_on
|
||||
|
||||
- id: auto_turn_off_purifier
|
||||
alias: Auto turn off purifier
|
||||
description: 根据空气状态自动关净化器
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/10'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.at_home
|
||||
state: 'on'
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.waqi_pudong_monitoring_station_shanghai_shang_hai_pu_dong_jian_ce_zhan
|
||||
below: 100
|
||||
- condition: state
|
||||
entity_id: switch.purifier
|
||||
state: 'on'
|
||||
action:
|
||||
- entity_id: switch.purifier
|
||||
service: switch.turn_off
|
||||
|
||||
# 每整点关一次水泵 避免漏关
|
||||
- id: auto_turn_off_pump_hourly
|
||||
alias: Auto turn off pump hourly
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: 0
|
||||
condition: []
|
||||
action:
|
||||
- entity_id: switch.water_pump
|
||||
service: switch.turn_off
|
||||
|
||||
# ===== test below
|
||||
|
||||
# 精确的到家时间 person.erimus 作为开关
|
||||
|
@ -109,6 +161,10 @@
|
|||
- condition: state
|
||||
entity_id: input_boolean.at_home
|
||||
state: 'off'
|
||||
# avoid tirggering by mistake while sleeping
|
||||
- condition: time
|
||||
after: '08:00:00'
|
||||
before: '23:59:00'
|
||||
action:
|
||||
- service: script.home_return
|
||||
|
||||
|
|
|
@ -41,6 +41,10 @@ switch.light_3:
|
|||
|
||||
switch.water_pump:
|
||||
icon: 'mdi:water-pump'
|
||||
switch.purifier:
|
||||
icon: 'mdi:air-purifier'
|
||||
switch.monitor:
|
||||
icon: 'mdi:monitor'
|
||||
|
||||
script.amplifier_volume_up_10_times:
|
||||
icon: 'mdi:volume-plus'
|
||||
|
|
|
@ -24,6 +24,8 @@ less_used_switches:
|
|||
- light.light_2
|
||||
- switch.light_3
|
||||
- switch.water_pump
|
||||
- switch.purifier
|
||||
- switch.monitor
|
||||
- switch.at_home
|
||||
|
||||
# amplifier:
|
||||
|
|
12
homekit.yaml
12
homekit.yaml
|
@ -36,8 +36,6 @@ filter:
|
|||
# - switch.screen
|
||||
|
||||
# Theater mode
|
||||
# - script.theater_mode_on
|
||||
# - script.theater_mode_off
|
||||
- switch.theater_mode
|
||||
|
||||
# Leave or return home
|
||||
|
@ -51,9 +49,17 @@ filter:
|
|||
# Climate
|
||||
- climate.hitachi_ac
|
||||
|
||||
# Purifier
|
||||
- switch.purifier
|
||||
|
||||
# Monitor
|
||||
- switch.monitor
|
||||
|
||||
# exclude_entities: # 要排除的
|
||||
# - remote.broadlink
|
||||
|
||||
# 合法图标仅 faucet/outlet/shower/sprinkler/valve
|
||||
# https://www.home-assistant.io/integrations/homekit/
|
||||
entity_config:
|
||||
switch.water_pump: # 显示为水龙头的图标
|
||||
type: valve # homekit icon (faucet/outlet/shower/sprinkler/valve)
|
||||
type: faucet
|
||||
|
|
|
@ -120,7 +120,7 @@ HA 说是入门比较简单,但其实许多教程都说得比较含糊笼统
|
|||
按 `win+r`,然后粘贴前面这段,进入该目录。
|
||||
+ 其它看这里 [Configuring Home Assistant - Home Assistant]( https://www.home-assistant.io/docs/configuration/)
|
||||
|
||||
- 下载好的依赖文件在 `./deps` 目录,我是 195M 。但你现在还没填配置文件,应该会比这个小。如果网络不好卡太久,可以考虑全局梯子。
|
||||
- 下载好的依赖文件在 `./deps` 目录,我是 195M(仅供参考,升级后会变化的) 。但你现在还没填配置文件,应该会比这个小。如果网络不好卡太久,可以考虑全局梯子。
|
||||
|
||||
- 如果不幸在这一步就遇到问题,可以试试:
|
||||
+ 删掉 `deps` 目录
|
||||
|
@ -131,7 +131,7 @@ HA 说是入门比较简单,但其实许多教程都说得比较含糊笼统
|
|||
我的是 `http://10.0.0.12:8123`。
|
||||
然后可能会要求你新建一个用户,照办就是了。
|
||||
|
||||
- 先关闭 HA 的服务,直接在命令行按下 `ctrl+Z` 好了。
|
||||
- 先关闭 HA 的服务,直接在命令行按下 `ctrl+C` 好了。
|
||||
|
||||
### Step 3. 下载配置文件范例
|
||||
|
||||
|
@ -347,3 +347,4 @@ HA 说是入门比较简单,但其实许多教程都说得比较含糊笼统
|
|||
# memo
|
||||
|
||||
- `/local/` in yaml or resources equals the real path `/www/`.
|
||||
- [Erimus-Koo/Extract_BroadLink_learned_codes_from_iOS_App: 博联 RM Pro+ 最简单学码方式](https://github.com/Erimus-Koo/Extract_BroadLink_learned_codes_from_iOS_App) 博联的射频学习好像是一个坑,有射频设备的看这里。
|
||||
|
|
16
scripts.yaml
16
scripts.yaml
|
@ -101,6 +101,9 @@ theater_mode_on:
|
|||
# 关灯
|
||||
- service: switch.turn_off
|
||||
entity_id: group.light
|
||||
# 关电脑屏幕
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.monitor
|
||||
|
||||
theater_mode_off:
|
||||
alias: 'Theater Mode OFF'
|
||||
|
@ -121,7 +124,10 @@ theater_mode_off:
|
|||
- service_template: > # 太阳落山的话开灯
|
||||
switch.turn_{% if is_state('sun.sun','below_horizon') %}on{% else %}off{% endif %}
|
||||
entity_id:
|
||||
- switch.light_2_smart
|
||||
- switch.light_3_smart
|
||||
# 开电脑屏幕
|
||||
- service: switch.turn_on
|
||||
entity_id: switch.monitor
|
||||
# 收起幕布 不灵敏多按几次
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.screen
|
||||
|
@ -146,8 +152,10 @@ home_return:
|
|||
entity_id:
|
||||
- switch.light_2_smart
|
||||
- switch.light_3_smart
|
||||
- service: switch.turn_on # 开功放
|
||||
entity_id: switch.amplifier_smart
|
||||
- service: switch.turn_on
|
||||
entity_id:
|
||||
- switch.amplifier_smart # 开功放
|
||||
- switch.monitor # 开显示器
|
||||
- service: shell_command.say_welcome_back # 欢迎问候
|
||||
- service: shell_command.send_volume_up # wakeup screen
|
||||
- service: shell_command.open_musicbee # 打开播放器
|
||||
|
@ -162,8 +170,10 @@ home_leave:
|
|||
- service: shell_command.say_welcome_leave # 欢迎问候
|
||||
- service: switch.turn_off
|
||||
entity_id:
|
||||
- switch.monitor
|
||||
- switch.amplifier_smart
|
||||
- switch.water_pump
|
||||
- switch.aircon_smart
|
||||
- switch.purifier
|
||||
- group.light
|
||||
- service: shell_command.screen_off # 息屏
|
||||
|
|
|
@ -91,6 +91,16 @@
|
|||
command_on: sgc0AAoaChoLGhwJHAkKAAENHAgcCAoaCxoLGhwIHAgcCBwIChocCBwIHAgcCAoaHAgcCAoaCxkAAAAA
|
||||
command_off: shA0ABwIHAkKGhwIHAgcCBwIChocCRwJChoLGgsaChoKGgoaHAgLAAEPHAgcCAoaChoKGhwIHAgAAAAA
|
||||
|
||||
purifier:
|
||||
friendly_name: Purifier
|
||||
command_on: sgAEAR4KCh4KHgsdCx0fCR8JHgoeCh4KCh4KHgoeHwkLHQsdHwkLHgoeCh4eCh4KCh4eCgoAATUfCQofCh4KHgoeHgoeCh4KHgoeCQsdCx4KHh4KCh4KHh8JCh4KHgseHgkfCQsdHwkLAAE1HgoKHgoeCx0LHh4KHgkfCR4KHgoKHgsdCx4eCgoeCh4eCgoeCh4KHh4KHgoKHh4KCgABNh4JCx4KHgoeCh4eCh4KHgoeCh4KCh4KHgoeHwkKHgoeHwkKHgseCh4eCh4KCh4eCgoAATUeCgsdCx4KHgoeHgoeCh4KHgkfCQoeCx4KHh4KCh4LHR4KCx0LHQseHgoeCgoeHgkLAAXcAAAAAA==
|
||||
command_off: sgAEAR0KCh4KHwoeCh4eCh4KHgoeCh0KCx4KHgoeHgoKHgoeHgoLHgkfCh4KHh4KCh4eCgoAATYdCwoeCh4KHgoeHgoeCh4KHgoeCgoeCh4KHh4LCR8KHh4KCh4KHgoeCx4dCwkfHgkLAAE1HgoKHgseCh4KHh4KHgoeCR4LHQoKHgseCR8eCgoeCh4eCgoeCx4JHwoeHgoKHh4KCgABNh4KCR4LHgoeCh4fCR4KHgoeCh4KCh4KHgofHQoKHwkfHgoJHwoeCh4KHx4JCh8eCQoAATYeCgofCR8JHwkfHgoeCh0KHgoeCwkfCR8KHh4KCh4KHh4KCh4KHwkfCh4eCgoeHgoKAAXcAAAAAA==
|
||||
|
||||
monitor:
|
||||
friendly_name: Monitor
|
||||
command_on: sgY0AAkcCRwaCgkcCRwaChoLCRwJHAkcGgsaCxsKCRwJHBsKGgsJHBoKCRwJHAkcCRwaCgkAAQ4AAAAA
|
||||
command_off: sgA+AQACcwADZwgcCBwZCggcCBwaChkKCBwIHAgcGQoaCxkKCBwIGxoKGgoIHBkKCRsIHAgcGgkJGwgAAQ4IHAgbGgoIHAgcGQoaCggcCBwIGxoKGgoZCwgbCBwaChkLCBwZCggcCBwIGxoKCBwIAAENCBwIHBkKCBwIHBkLGQoIHAgcCBwZChoKGgoIHAgbGgoaCggcGgoIGwgcCBwZCgkbCAABDggcCBsaCggcCBsaChoKCBwIHAgcGQoaChoJCBwIHBoKGQoIHBoKCBwIGwgcGgoIHAgAAQ0IHAgcGgkJGwgcGgoZCggcCBwIHBkKGgoaCggcCBsaChoKCBwZCwgbCBwIHBkKCRsIAAEPCBwIHBkKCRsIHBoKGgkJGwgcCBwZCxkKGgoIHAgcGQoaCggcGQsIGwkbCBwaCggbCQAF3AAAAAAAAAAAAAA=
|
||||
|
||||
# RF Screen ==============================
|
||||
screen:
|
||||
friendly_name: Screen
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# https://community.home-assistant.io/t/make-scripts-as-toggle-switch
|
||||
theater_mode:
|
||||
friendly_name: Theater Mode
|
||||
icon_template: mdi:movie-open
|
||||
icon_template: mdi:theater
|
||||
value_template: "{{ is_state('input_boolean.theater_mode', 'on') }}"
|
||||
turn_on:
|
||||
- service: script.theater_mode_on
|
||||
|
@ -34,17 +34,17 @@
|
|||
{% if states('sensor.pudong_temperature') | float < 15 %}
|
||||
30
|
||||
{% elif states('sensor.pudong_temperature') | float > 20 %}
|
||||
30
|
||||
28
|
||||
{% else %}
|
||||
27
|
||||
28
|
||||
{% endif %}
|
||||
hvac_mode: >
|
||||
{% if states('sensor.pudong_temperature') | float < 15 %}
|
||||
heat
|
||||
{% elif states('sensor.pudong_temperature') | float > 20 %}
|
||||
dry
|
||||
cool
|
||||
{% else %}
|
||||
fan_only
|
||||
dry
|
||||
{% endif %}
|
||||
turn_off:
|
||||
- service: climate.turn_off
|
||||
|
|
Loading…
Reference in New Issue