原本的自動化是使用sonoff內建的功能,不過要快速調整
就比較繁瑣一點。
所以就使用HA來建立自動化
設定-裝置與服務-輔助工具(上方)-新增輔助工具
搜尋計時器
按一下取得實體ID
- 熱水計時器(計時器) timer.dao_ji_shi_jia_re
- 熱水加熱溫度(數字) input_number.input_number_bath_target_temp
- 熱水加熱時間(數字) input_number.input_number_bath_duration_min
實際的sonoff溫控開關
- 開關 switch.sonoff_10018d035a
- 溫度傳感器 sensor.sonoff_10018d035a_temperature
alias: 電熱水器description: 溫度達標即關閉,時間到關閉並通知目前水溫triggers: - entity_id: switch.sonoff_10018d035a from: "off" to: "on" id: system_start trigger: state - event_type: timer.finished event_data: entity_id: timer.dao_ji_shi_jia_re id: timer_end trigger: event - entity_id: sensor.sonoff_10018d035a_temperature id: temp_change trigger: stateactions: - choose: - conditions: - condition: trigger id: system_start sequence: - target: entity_id: timer.dao_ji_shi_jia_re data: duration: >- 00:{{ states('input_number.input_number_bath_duration_min') | int(40) }}:00 action: timer.start - if: - condition: template value_template: >- {{ states('sensor.sonoff_10018d035a_temperature') | float(0) >= states('input_number.input_number_bath_target_temp') | float(40) }} then: - target: entity_id: switch.sonoff_10018d035a action: switch.turn_off data: {} - action: notify.mobile_app_iphone metadata: {} data: message: >- 加熱結束,水溫:{{ states('sensor.sonoff_10018d035a_temperature') }}°C title: 熱水器 - action: notify.mobile_app_iphone metadata: {} data: message: 開始加熱,水溫:{{ states('sensor.sonoff_10018d035a_temperature') }}°C title: 熱水器 - conditions: - condition: trigger id: temp_change - condition: state entity_id: timer.dao_ji_shi_jia_re state: active - condition: template value_template: | {{ states('sensor.sonoff_10018d035a_temperature') | float(0) >= states('input_number.input_number_bath_target_temp') | float(40) }} sequence: - target: entity_id: switch.sonoff_10018d035a action: switch.turn_off data: {} - target: entity_id: timer.dao_ji_shi_jia_re action: timer.finish data: {} - conditions: - condition: trigger id: timer_end sequence: - target: entity_id: switch.sonoff_10018d035a action: switch.turn_off - action: notify.mobile_app_iphone data: message: 加熱結束,水溫:{{ states('sensor.sonoff_10018d035a_temperature') }}°C title: 熱水器 - conditions: - condition: trigger id: system_stop sequence: - target: entity_id: timer.dao_ji_shi_jia_re action: timer.finish
mode: restart
type: vertical-stackcards:
- type: custom:bubble-card
card_type: button
button_type: switch
entity: switch.sonoff_10018d035a
icon: mdi:water-boiler
force_icon: false
show_state: true
- type: horizontal-stack
cards:
- type: entities
entities:
- entity: timer.dao_ji_shi_jia_re
name: 剩餘時間
show_header_toggle: false
state_color: true
- type: custom:mini-graph-card
entities:
- sensor.sonoff_10018d035a_temperature
align_icon: left
align_state: center
name: 熱水溫度
show:
fill: true
hours_to_show: 2
points_per_hour: 30
- type: custom:bubble-card
card_type: button
button_type: slider
entity: input_number.input_number_bath_target_temp
name: 加熱溫度/˚C
icon: mdi:thermometer
force_icon: false
show_state: true
show_last_changed: false
min_value: 30
max_value: 60
step: 1
tap_to_slide: false
slider_live_update: false
styles: ""
show_name: true
show_icon: true
scrolling_effect: true
- square: false
type: grid
columns: 4
cards:
- show_name: true
show_icon: false
type: button
name: 40˚C
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_target_temp
data:
value: 40
icon_height: 20px
show_state: false
- show_name: true
show_icon: false
type: button
name: 50˚C
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_target_temp
data:
value: 50
icon_height: 20px
- show_name: true
show_icon: false
type: button
name: 55˚C
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_target_temp
data:
value: 55
icon_height: 20px
- show_name: true
show_icon: false
type: button
name: 60˚C
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_target_temp
data:
value: 60
icon_height: 20px
- type: custom:bubble-card
card_type: button
button_type: slider
entity: input_number.input_number_bath_duration_min
name: 加熱時間/分
icon: mdi:av-timer
force_icon: false
show_state: true
show_last_changed: false
min_value: 10
max_value: 120
step: 1
tap_to_slide: false
slider_live_update: false
styles: |+
show_name: true
show_icon: true
scrolling_effect: true
- square: false
type: grid
columns: 4
cards:
- show_name: true
show_icon: false
type: button
name: 30分
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_duration_min
data:
value: 30
icon_height: 20px
show_state: false
- show_name: true
show_icon: false
type: button
name: 60分
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_duration_min
data:
value: 60
icon_height: 20px
- show_name: true
show_icon: false
type: button
name: 90分
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_duration_min
data:
value: 90
icon_height: 20px
- show_name: true
show_icon: false
type: button
name: 120分
icon: ""
tap_action:
action: call-service
service: input_number.set_value
target:
entity_id: input_number.input_number_bath_duration_min
data:
value: 120
icon_height: 20px
grid_options:
columns: 12
rows: auto------------------------------------
15.從零開始裝 Home Assistant 接入Hitachi冷氣










沒有留言:
張貼留言