|
|
新增好設備之後可以透過 multiple-entity-row節省版面
1. 因 auto 氣流方向 擺頭都只有在實體面板才能控制所以需要另外拉出來做成switch
請依照下面格式去把這三個按鈕拉出來
switch:
- platform: template
switches:
dyson_auto:
friendly_name: Dyson HP04 Auto
value_template: "{{ is_state_attr('fan.pure_hot_cool', 'preset_mode', 'Auto') }}"
turn_on:
service: fan.set_preset_mode
target:
entity_id: fan.pure_hot_cool
data:
preset_mode: Auto
turn_off:
service: fan.set_percentage
target:
entity_id: fan.pure_hot_cool
data:
percentage: 50
icon_template: >
{% if is_state('fan.pure_hot_cool', 'on') and is_state_attr('fan.pure_hot_cool', 'preset_mode', true) %}
mdi:fan-auto
{% else %}
mdi:fan-auto
{% endif %}
- platform: template
switches:
dyson_direction:
friendly_name: Dyson氣流方向
value_template: "{{ is_state_attr('fan.pure_hot_cool', 'direction', 'forward') }}"
turn_on:
service: fan.set_direction
target:
entity_id: fan.pure_hot_cool
data:
direction: forward
turn_off:
service: fan.set_direction
target:
entity_id: fan.pure_hot_cool
data:
direction: reverse
icon_template: >
{% if is_state('fan.pure_hot_cool', 'on') and is_state_attr('fan.pure_hot_cool', 'direction', true) %}
mdi:tailwind
{% else %}
mdi:tailwind
{% endif %}
- platform: template
switches:
dyson_oscillation:
friendly_name: Dyson擺頭
value_template: "{{ is_state('fan.pure_hot_cool', 'on') and is_state_attr('fan.pure_hot_cool', 'oscillating', true) }}"
turn_on:
service: fan.oscillate
data:
entity_id: fan.pure_hot_cool
oscillating: true
turn_off:
service: fan.oscillate
data:
entity_id: fan.pure_hot_cool
oscillating: false
icon_template: >
{% if is_state('fan.pure_hot_cool', 'on') and is_state_attr('fan.pure_hot_cool', 'oscillating', true) %}
mdi:sync
{% else %}
mdi:sync-off
{% endif %}
2. 面板分享 須先在HACS安裝 multiple-entity-row
type: entities
entities:
- entity: fan.pure_hot_cool
- entity: switch.dyson_auto
type: custom:multiple-entity-row
name: 設定
state_header: 自動
toggle: true
entities:
- entity: switch.dyson_oscillation
name: 擺頭
toggle: true
state_color: true
tap_action:
action: toggle
- entity: switch.pure_hot_cool_continuous_monitoring
name: 監控
toggle: true
- entity: switch.pure_hot_cool_night_mode
name: 夜間
toggle: true
- entity: switch.dyson_direction
name: 氣流
toggle: true
- type: section
- entity: sensor.pure_hot_cool_pm_2_5
type: custom:multiple-entity-row
name: 空氣品質
state_header: PM2.5
toggle: false
entities:
- entity: sensor.pure_hot_cool_volatile_organic_compounds
name: VOC
toggle: false
- entity: sensor.pure_hot_cool_nitrogen_dioxide
name: NO2
toggle: false
- entity: sensor.pure_hot_cool_pm_10
name: PM10
toggle: false
- type: section
- entity: sensor.pure_hot_cool_carbon_filter_life
type: custom:multiple-entity-row
name: 濾網
state_header: 碳濾網
toggle: false
entities:
- entity: sensor.pure_hot_cool_hepa_filter_life
name: HEPA濾網
toggle: false
- type: section
- entity: sensor.pure_hot_cool_temperature
type: custom:multiple-entity-row
name: 環境狀態
state_header: 溫度
toggle: false
entities:
- entity: sensor.pure_hot_cool_humidity
name: 濕度
toggle: false
show_header_toggle: false
title: Dyson HP04
|
|