Skip to content

Commit

Permalink
Refine for 2024.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonsm committed Jul 6, 2024
1 parent cb2f053 commit fda4949
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 120 deletions.
4 changes: 2 additions & 2 deletions automations/disabled/air.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
entity_id: sensor.ke_ting_er_yang_hua_tan
above: 800
action:
- service: zhimsg.ke_ting_yin_xiang
- service: zhimsg.guo_dao_xiao_ai
data:
message: 外面空气很好,可以打开门窗

Expand All @@ -42,7 +42,7 @@
after: '06:00'
before: '23:00'
action:
- service: zhimsg.ke_ting_yin_xiang
- service: zhimsg.guo_dao_xiao_ai
data_template:
message: '客厅PM2.5为{{ states("sensor.can_ting_kong_qi_zhi_liang") }},空气不好。{% if is_state("binary_sensor.door_window_sensor_158d0001f3d2d1", "on") or is_state("binary_sensor.door_window_sensor_158d0003cf4735", "on") or is_state("binary_sensor.door_window_sensor_158d000228a52b", "on") %}请关好{% if is_state("binary_sensor.door_window_sensor_158d0001f3d2d1", "on") %}厨房门、{% endif %}{% if is_state("binary_sensor.door_window_sensor_158d0003cf4735", "on") %}洗手间门、{% endif %}{% if is_state("binary_sensor.door_window_sensor_158d000228a52b", "on") %}阳台门{% endif %}{% endif %}'
- delay: 600
Expand Down
18 changes: 9 additions & 9 deletions automations/disabled/cube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# entity_id: binary_sensor.cube_158d0002a66db1
# action_type: flip90
# action:
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: 魔方翻转九十度

Expand All @@ -35,7 +35,7 @@
# entity_id: binary_sensor.cube_158d0002a66db1
# action_type: flip180
# action:
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: 魔方翻转一百八十度

Expand All @@ -47,7 +47,7 @@
# entity_id: binary_sensor.cube_158d0002a66db1
# action_type: move
# action:
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: 魔方移动

Expand All @@ -59,7 +59,7 @@
# entity_id: binary_sensor.cube_158d0002a66db1
# action_type: tap_twice
# action:
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: '阳台PM2.5为{{ states("sensor.yang_tai_kong_qi_zhi_liang") }},餐厅PM2.5为{{ states("sensor.can_ting_kong_qi_zhi_liang") }},主卧PM2.5为{{ states("sensor.zhu_wo_kong_qi_zhi_liang") }}。客厅二氧化碳浓度为{{ states("sensor.ke_ting_er_yang_hua_tan") }},主卧二氧化碳浓度为{{ states("sensor.zhu_wo_er_yang_hua_tan") }},儿童房二氧化碳浓度为{{ states("sensor.er_tong_fang_er_yang_hua_tan") }}'

Expand All @@ -71,7 +71,7 @@
# entity_id: binary_sensor.cube_158d0002a66db1
# action_type: swing
# action:
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: 魔方摇摆

Expand All @@ -83,7 +83,7 @@
# entity_id: binary_sensor.cube_158d0002a66db1
# action_type: alert
# action:
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: 魔方警告

Expand All @@ -95,7 +95,7 @@
# entity_id: binary_sensor.cube_158d0002a66db1
# action_type: free_fall
# action:
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: 魔方下落

Expand All @@ -116,7 +116,7 @@
# entity_id: automation.guo_dao_deng_wan_shang_kai
# - service: automation.toggle
# entity_id: automation.guo_dao_bei_jing_deng_gan_ying
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: '过道灯自动感应功能已{% if is_state("automation.guo_dao_bei_jing_deng_gan_ying", "on") %}启用{% else %}暂停,所有灯光将在10秒后关闭{% endif %}'
# - delay: '00:00:10'
Expand All @@ -140,7 +140,7 @@
# entity_id: automation.guo_dao_deng_wan_shang_kai
# - service: automation.turn_on
# entity_id: automation.guo_dao_bei_jing_deng_gan_ying
# - service: zhimsg.ke_ting_yin_xiang
# - service: zhimsg.guo_dao_xiao_ai
# data_template:
# message: 过道灯自动感应功能已重新启用
# - delay: '00:00:10'
Expand Down
2 changes: 1 addition & 1 deletion automations/disabled/door.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
after: '06:00'
before: '23:00'
action:
- service: zhimsg.ke_ting_yin_xiang
- service: zhimsg.guo_dao_xiao_ai
data_template:
message: '阳台PM2.5为{% set PM25 = states("sensor.yang_tai_kong_qi_zhi_liang") | int %}{{ PM25 }},{% if PM25 < 20 %}空气很好{% elif PM25 < 40 %}空气不错{% elif PM25 < 60 %}空气一般{% elif PM25 < 80 %}空气不好,请关好阳台门{% else %}空气污染,请关好阳台门和其它门窗{% endif %}'
- delay: 120
Expand Down
2 changes: 1 addition & 1 deletion automations/disabled/projector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
entity_id: binary_sensor.switch_158d00083a4207
click_type: long_click_press
action:
- service: zhimsg.ke_ting_yin_xiang
- service: zhimsg.guo_dao_xiao_ai
data_template:
message: '正在{% if is_state("media_player.shu_fang_tou_ying_yi", "on") %}关闭{% else %}打开{% endif %}投影仪'
- service: media_player.toggle
Expand Down
4 changes: 2 additions & 2 deletions automations/disabled/sleeping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
data:
entity_id: fan.zhu_wo_xin_feng_ji
oscillating: false
- service: zhimsg.ke_ting_yin_xiang
- service: zhimsg.guo_dao_xiao_ai
data:
message: 音量30

Expand Down Expand Up @@ -78,7 +78,7 @@
data:
entity_id: fan.zhu_wo_xin_feng_ji
oscillating: true
- service: zhimsg.ke_ting_yin_xiang
- service: zhimsg.guo_dao_xiao_ai
data:
message: 音量70
- service: fan.set_preset_mode
Expand Down
16 changes: 8 additions & 8 deletions automations/temperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
- service: zhiact.actuate
data:
sensor_id: sensor.zhu_wo_wen_du
sensor_values: [29, 29.1]
alt_sensor_values: [29.5, 29.6]
sensor_values: [28, 28.5]
alt_sensor_values: [28.5, 29]
# sensor_id: climate.zhu_wo_kong_diao
# sensor_attr: current_temperature
# sensor_values: [29, 30, 31, 32, 33]
Expand Down Expand Up @@ -130,8 +130,8 @@
- service: zhiact.actuate
data:
sensor_id: sensor.er_tong_fang_wen_du
sensor_values: [23.6, 23.7, 23.8, 23.9, 24]
alt_sensor_values: [24.3, 24.5, 25, 25.5, 26]
sensor_values: [22.5, 23, 23.5, 24, 24.5]
alt_sensor_values: [24, 24.5, 25, 25.5, 26]
# sensor_id: climate.er_tong_fang_kong_diao
# sensor_attr: current_temperature
# sensor_values: [29, 30, 31, 32, 33]
Expand Down Expand Up @@ -205,7 +205,7 @@
- service: zhiact.actuate
data:
sensor_id: fan.er_tong_fang_feng_shan
sensor_attr: temperature
sensor_attr: temp_dec
sensor_values: [24, 25, 28, 31]
alt_sensor_values: [25, 27, 32, 34]
alt_time_range: [1, 8]
Expand All @@ -229,9 +229,9 @@
- service: zhiact.actuate
data:
sensor_id: sensor.zhu_wo_wen_du
sensor_values: [24, 26, 29, 30]
alt_sensor_values: [25, 27, 30, 32]
sensor_values: [24, 26, 29, 30, 32]
alt_sensor_values: [25, 27, 30, 32, 34]
alt_time_range: [1, 8]
entity_id: fan.zhu_wo_feng_shan
entity_attr: preset_mode
entity_values: [档位1, 档位2, 档位3, 档位4]
entity_values: [1档, 2档, 3档, 4档, 5档]
90 changes: 41 additions & 49 deletions configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,36 +73,6 @@ recorder:
- input_select
- input_boolean

# modbus:
# - type: rtuovertcp
# host: 192.168.1.60
# port: 8899
# switches:
# - name: 餐厅空调
# address: 1
# command_on: 1
# command_off: 0
# write_type: coil
# - name: 客厅空调
# address: 2
# command_on: 1
# command_off: 0
# write_type: coil
# - name: 主卧空调
# address: 3
# command_on: 1
# command_off: 0
# write_type: coil
# - name: 儿童房空调
# address: 4
# command_on: 1
# command_off: 0
# write_type: coil

zhimi:
username: !secret zhimi_username
password: !secret zhimi_password

device_tracker:
- platform: ping
scan_interval: 120
Expand Down Expand Up @@ -133,9 +103,27 @@ person:
id: ayi
device_trackers: device_tracker.ayishouji

weather:
- platform: zhicaiyun
name: 天气
zhimi:
username: !secret zhimi_username
password: !secret zhimi_password

modbus:
- type: rtuovertcp
host: 192.168.1.60
port: 8899
switches:
# - name: 餐厅空调开关
# address: 5
# verify:
# - name: 客厅空调开关
# address: 9
# verify:
- name: 主卧空调开关
address: 13
# verify:
# - name: 儿童房空调开关
# address: 17
# verify:

climate:
- platform: zhisaswell
Expand All @@ -146,15 +134,15 @@ climate:
name: 主卧地暖
host: 192.168.1.57
device: 10382435CC059F72
# - platform: zhimodbus
# name: [餐厅空调, 客厅空调, 主卧空调, 儿童房空调]
# fan_mode: { registers: [6, 10, 14, 18] }
# fan_modes: { 自动: 0, 一档: 1, 二档: 2, 三档: 3, 四档: 4, 五档: 5 }
# hvac_mode: { registers: [5, 9, 13, 17] }
# hvac_modes: { 'off': 0, cool: 1, heat: 2, dry: 3, fan_only: 4 }
# hvac_off: { registers: [1, 2, 3, 4], register_type: coil }
# target_temperature: { registers: [4, 8, 12, 16] }
# temperature: { registers: [3, 6, 9, 12], register_type: input, scale: 0.1 }
- platform: zhimodbus
name: [餐厅空调, 客厅空调, 主卧空调, 儿童房空调]
fan_mode: { registers: [6, 10, 14, 18] }
fan_modes: { 自动: 0, 一档: 1, 二档: 2, 三档: 3, 四档: 4, 五档: 5 }
hvac_mode: { registers: [5, 9, 13, 17] }
hvac_modes: { 'off': 0, cool: 1, heat: 2, dry: 3, fan_only: 4 }
hvac_off: { registers: [1, 2, 3, 4], register_type: coil }
target_temperature: { registers: [4, 8, 12, 16] }
temperature: { registers: [3, 6, 9, 12], register_type: input, scale: 0.1 }
# - platform: zhiremote
# name: 书房空调
# sender: remote.shu_fang_yao_kong
Expand Down Expand Up @@ -199,6 +187,10 @@ vacuum:
# host: SaoDiJi
# token: !secret vacuum_token

weather:
- platform: zhicaiyun
name: 天气

zhiact:

zhimsg:
Expand All @@ -207,15 +199,15 @@ zhimsg:
token: !secret dingbot_token
secret: !secret dingbot_secret
- platform: miai
name: 客厅音箱
name: 过道小爱
did: 380205692
model: x08c
- platform: miai
name: 次卧音箱
name: 次卧小爱
did: 89463074
model: lx01
- platform: miai
name: 儿童房音箱
name: 儿童房小爱
did: 267090026
model: lx04

Expand All @@ -229,13 +221,13 @@ zhibot:
- platform: ding
token: !secret zhibot_token
- platform: ding
name: 过道音箱
name: 过道小爱
token: !secret zhibot_token
- platform: ding
name: 客厅音箱
name: 次卧小爱
token: !secret zhibot_token
- platform: ding
name: 儿童房音箱
name: 儿童房小爱
token: !secret zhibot_token

zhiaqara:
Expand All @@ -248,7 +240,7 @@ zhibroad:
# host: 192.168.1.54
- name: 书房遥控
host: 192.168.1.53
- name: 客厅插座
- name: 主卧插座
host: 192.168.1.55

zhibravia:
Expand Down
Loading

0 comments on commit fda4949

Please sign in to comment.