+ spotify / sensor nan / etc
This commit is contained in:
parent
99291a8026
commit
0ee13e202b
|
@ -110,6 +110,10 @@
|
|||
},
|
||||
{
|
||||
"entity": "script.amplifier_volume_down_10_times",
|
||||
"hold_action": {
|
||||
"action": "call-service",
|
||||
"service": "script.amplifier_volume_up_10_times"
|
||||
},
|
||||
"icon_height": "105px",
|
||||
"name": "Vol--",
|
||||
"show_name": false,
|
||||
|
@ -120,13 +124,23 @@
|
|||
"type": "entity-button"
|
||||
},
|
||||
{
|
||||
"entity": "script.amplifier_volume_up_10_times",
|
||||
"entity": "switch.amplifier_smart",
|
||||
"hold_action": {
|
||||
"action": "call-service",
|
||||
"service": "switch.turn_off",
|
||||
"service_data": {
|
||||
"entity_id": "switch.amplifier_power"
|
||||
}
|
||||
},
|
||||
"icon_height": "105px",
|
||||
"name": "Vol++",
|
||||
"name": "Trun on amplifier",
|
||||
"show_name": false,
|
||||
"tap_action": {
|
||||
"action": "call-service",
|
||||
"service": "script.amplifier_volume_up_10_times"
|
||||
"service": "switch.turn_on",
|
||||
"service_data": {
|
||||
"entity_id": "switch.amplifier_power"
|
||||
}
|
||||
},
|
||||
"type": "entity-button"
|
||||
}
|
||||
|
|
102
automations.yaml
102
automations.yaml
|
@ -80,8 +80,8 @@
|
|||
for: 00:15:00
|
||||
condition: []
|
||||
action:
|
||||
- entity_id: switch.water_pump
|
||||
service: switch.turn_off
|
||||
- entity_id: switch.water_pump
|
||||
service: switch.turn_off
|
||||
|
||||
# 每整点关一次水泵 避免漏关
|
||||
- id: auto_turn_off_pump_hourly
|
||||
|
@ -91,49 +91,61 @@
|
|||
minutes: 0
|
||||
condition: []
|
||||
action:
|
||||
- entity_id: switch.water_pump
|
||||
service: switch.turn_off
|
||||
- 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_on_purifier
|
||||
# alias: Auto turn on purifier
|
||||
# description: 根据空气状态自动开净化器
|
||||
# trigger:
|
||||
# platform: time_pattern
|
||||
# minutes: '/10'
|
||||
# condition:
|
||||
# condition: and
|
||||
# conditions:
|
||||
# - 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: 75
|
||||
# - condition: state
|
||||
# entity_id: switch.purifier
|
||||
# state: 'off'
|
||||
# action:
|
||||
# - entity_id: switch.purifier
|
||||
# service: switch.turn_on
|
||||
# - entity_id: switch.purifier
|
||||
# service: switch.turn_on
|
||||
# - 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_purifier
|
||||
# alias: Auto turn off purifier
|
||||
# description: 根据空气状态自动关净化器
|
||||
# trigger:
|
||||
# platform: time_pattern
|
||||
# minutes: '/10'
|
||||
# condition:
|
||||
# condition: and
|
||||
# conditions:
|
||||
# - 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: 75
|
||||
# - condition: state
|
||||
# entity_id: switch.purifier
|
||||
# state: 'on'
|
||||
# action:
|
||||
# - entity_id: switch.purifier
|
||||
# service: switch.turn_off
|
||||
# - entity_id: switch.purifier
|
||||
# service: switch.turn_off
|
||||
# - entity_id: switch.purifier
|
||||
# service: switch.turn_off
|
||||
|
||||
# 每整点关一次水泵 避免漏关
|
||||
- id: auto_turn_off_pump_hourly
|
||||
|
@ -164,7 +176,7 @@
|
|||
# avoid tirggering by mistake while sleeping
|
||||
- condition: time
|
||||
after: '08:00:00'
|
||||
before: '23:59:00'
|
||||
before: '22:00:00'
|
||||
action:
|
||||
- service: script.home_return
|
||||
|
||||
|
@ -184,5 +196,9 @@
|
|||
- condition: state
|
||||
entity_id: input_boolean.playing_sound
|
||||
state: 'off'
|
||||
# avoid tirggering by mistake while sleeping
|
||||
- condition: time
|
||||
after: '08:00:00'
|
||||
before: '22:00:00'
|
||||
action:
|
||||
- service: script.home_leave
|
||||
|
|
|
@ -126,7 +126,7 @@ device_tracker: # 设备跟踪器
|
|||
- platform: ping
|
||||
hosts:
|
||||
ping_iphonexr: 10.0.0.22
|
||||
consider_home: 600 # 判断离开所需的秒数
|
||||
consider_home: 900 # 判断离开所需的秒数
|
||||
|
||||
# 使用icloud追踪位置
|
||||
# 重启后在网页会提示登陆认证,按要求操作即可。
|
||||
|
@ -134,8 +134,8 @@ device_tracker: # 设备跟踪器
|
|||
icloud:
|
||||
- username: !secret icloud_username
|
||||
password: !secret icloud_password
|
||||
max_interval: 3 # 每隔3分钟取一次位置 即便是静止状态
|
||||
gps_accuracy_threshold: 100 # gps精度 默认500
|
||||
max_interval: 5 # 每隔5分钟取一次位置 即便是静止状态
|
||||
gps_accuracy_threshold: 300 # gps精度 默认500
|
||||
|
||||
remote: # 遥控器
|
||||
- platform: broadlink
|
||||
|
|
|
@ -101,6 +101,7 @@ theater_mode_on:
|
|||
# 关灯
|
||||
- service: switch.turn_off
|
||||
entity_id: group.light
|
||||
- delay: 00:00:10
|
||||
# 关电脑屏幕
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.monitor
|
||||
|
@ -156,11 +157,13 @@ home_return:
|
|||
entity_id:
|
||||
- switch.amplifier_smart # 开功放
|
||||
- switch.monitor # 开显示器
|
||||
- switch.aircon_smart
|
||||
- switch.purifier
|
||||
- service: shell_command.say_welcome_back # 欢迎问候
|
||||
- service: shell_command.send_volume_up # wakeup screen
|
||||
- service: shell_command.open_musicbee # 打开播放器
|
||||
- delay: 00:00:03
|
||||
- service: shell_command.send_next_track # 播放(远程电脑上已开启的播放器)
|
||||
- service: shell_command.open_music_player # 打开播放器
|
||||
- delay: 00:00:05
|
||||
- service: shell_command.send_space # 播放(远程电脑上已开启的播放器)
|
||||
|
||||
home_leave:
|
||||
alias: 'Leave Home'
|
||||
|
|
|
@ -13,8 +13,9 @@ send_play_pause: 'curl http://10.0.0.13:8836/api?key=playpause'
|
|||
send_previous_track: 'curl http://10.0.0.13:8836/api?key=prevtrack'
|
||||
send_next_track: 'curl http://10.0.0.13:8836/api?key=nexttrack'
|
||||
send_volume_up: 'curl http://10.0.0.13:8836/api?key=volumeup' # wakeup screen
|
||||
send_space: 'curl http://10.0.0.13:8836/api?key=space'
|
||||
|
||||
open_musicbee: 'curl http://10.0.0.13:8836/api?open=musicbee'
|
||||
open_music_player: 'curl http://10.0.0.13:8836/api?open=spotify'
|
||||
keep_awake_on: 'curl http://10.0.0.13:8836/api?run=keep_awake_on'
|
||||
keep_awake_off: 'curl http://10.0.0.13:8836/api?run=keep_awake_off'
|
||||
screen_off: 'curl http://10.0.0.13:8836/api?run=screen_off'
|
||||
|
|
|
@ -85,14 +85,15 @@
|
|||
# command_on: egC0AAkWCRYKFQkXCRYZBgkXCBcJFggXGQYZBxgGGQcJFhkHCRYIFwkWChYYBhkHCRUJFwnxCRYKFggXCRYIGBcHChYJFggXCRYZBxgHGAcZBgoVGQcJFggXCRYJFxkGGAcJFgkWCvAJFwkWCBcJFwkWGAcIGAgWCRcJFhkHFwcZBxgHCBcYBwkWCRcJFQoWGQcYBgoWCBcJ8QkWCRYKFgkWCRYZBgoWCBcJFgkXGAYZBxkGGAAF3AAAAAA=
|
||||
# command_off: egC0AAkWCRYKFQkXCRYZBgkXCBcJFggXGQYZBxgGGQcJFhkHCRYIFwkWChYYBhkHCRUJFwnxCRYKFggXCRYIGBcHChYJFggXCRYZBxgHGAcZBgoVGQcJFggXCRYJFxkGGAcJFgkWCvAJFwkWCBcJFwkWGAcIGAgWCRcJFhkHFwcZBxgHCBcYBwkWCRcJFQoWGQcYBgoWCBcJ8QkWCRYKFgkWCRYZBgoWCBcJFgkXGAYZBxkGGAAF3AAAAAA=
|
||||
|
||||
# RF Pump ==============================
|
||||
water_pump:
|
||||
friendly_name: Pump
|
||||
# RF Purifier ==============================
|
||||
purifier:
|
||||
friendly_name: Purifier
|
||||
command_on: sgc0AAoaChoLGhwJHAkKAAENHAgcCAoaCxoLGhwIHAgcCBwIChocCBwIHAgcCAoaHAgcCAoaCxkAAAAA
|
||||
command_off: shA0ABwIHAkKGhwIHAgcCBwIChocCRwJChoLGgsaChoKGgoaHAgLAAEPHAgcCAoaChoKGhwIHAgAAAAA
|
||||
|
||||
purifier:
|
||||
friendly_name: Purifier
|
||||
# RF Pump ==============================
|
||||
water_pump:
|
||||
friendly_name: Pump
|
||||
command_on: sgAEAR4KCh4KHgsdCx0fCR8JHgoeCh4KCh4KHgoeHwkLHQsdHwkLHgoeCh4eCh4KCh4eCgoAATUfCQofCh4KHgoeHgoeCh4KHgoeCQsdCx4KHh4KCh4KHh8JCh4KHgseHgkfCQsdHwkLAAE1HgoKHgoeCx0LHh4KHgkfCR4KHgoKHgsdCx4eCgoeCh4eCgoeCh4KHh4KHgoKHh4KCgABNh4JCx4KHgoeCh4eCh4KHgoeCh4KCh4KHgoeHwkKHgoeHwkKHgseCh4eCh4KCh4eCgoAATUeCgsdCx4KHgoeHgoeCh4KHgkfCQoeCx4KHh4KCh4LHR4KCx0LHQseHgoeCgoeHgkLAAXcAAAAAA==
|
||||
command_off: sgAEAR0KCh4KHwoeCh4eCh4KHgoeCh0KCx4KHgoeHgoKHgoeHgoLHgkfCh4KHh4KCh4eCgoAATYdCwoeCh4KHgoeHgoeCh4KHgoeCgoeCh4KHh4LCR8KHh4KCh4KHgoeCx4dCwkfHgkLAAE1HgoKHgseCh4KHh4KHgoeCR4LHQoKHgseCR8eCgoeCh4eCgoeCx4JHwoeHgoKHh4KCgABNh4KCR4LHgoeCh4fCR4KHgoeCh4KCh4KHgofHQoKHwkfHgoJHwoeCh4KHx4JCh8eCQoAATYeCgofCR8JHwkfHgoeCh0KHgoeCwkfCR8KHh4KCh4KHh4KCh4KHwkfCh4eCgoeHgoKAAXcAAAAAA==
|
||||
|
||||
|
|
|
@ -38,8 +38,10 @@
|
|||
{% else %}
|
||||
28
|
||||
{% endif %}
|
||||
hvac_mode: >
|
||||
{% if states('sensor.pudong_temperature') | float < 15 %}
|
||||
hvac_mode: > # 偶尔会有sensor取不到值的情况
|
||||
{% if states('sensor.pudong_temperature') == '' %}
|
||||
off
|
||||
{% elif states('sensor.pudong_temperature') | float < 15 %}
|
||||
heat
|
||||
{% elif states('sensor.pudong_temperature') | float > 20 %}
|
||||
cool
|
||||
|
|
Loading…
Reference in New Issue