diff --git a/config/lovelace/home_dashboard/living_room_dashboard.yaml b/config/lovelace/home_dashboard/living_room_dashboard.yaml index 49a04c7..84045c5 100644 --- a/config/lovelace/home_dashboard/living_room_dashboard.yaml +++ b/config/lovelace/home_dashboard/living_room_dashboard.yaml @@ -101,6 +101,7 @@ name: Radiator - entity: climate.toshiba_ac name: AC + - entity: input_number.toshiba_cool_temp - type: vertical-stack cards: diff --git a/config/lovelace/home_dashboard/main_dashboard.yaml b/config/lovelace/home_dashboard/main_dashboard.yaml index 4657282..642ea75 100644 --- a/config/lovelace/home_dashboard/main_dashboard.yaml +++ b/config/lovelace/home_dashboard/main_dashboard.yaml @@ -174,6 +174,22 @@ - type: horizontal-stack cards: + - type: custom:button-card + template: default + entity: climate.toshiba_ac + name: AC + state: + - value: 'off' + operator: '!=' + styles: + card: + - background-color: var(--primary-color) + - color: black + icon: + - color: black + tap_action: + action: call-service + service: script.toshiba_ac_toggle_cool - type: custom:button-card template: default entity: switch.camera diff --git a/config/packages/devices/living_room/toshiba_ac.yaml b/config/packages/devices/living_room/toshiba_ac.yaml index 0f5dc9d..3f84104 100644 --- a/config/packages/devices/living_room/toshiba_ac.yaml +++ b/config/packages/devices/living_room/toshiba_ac.yaml @@ -26,7 +26,27 @@ climate: supported_swing_list: - "off" +input_number: + toshiba_cool_temp: + name: AC cool temp + unit_of_measurement: "潞C" + min: 18 + max: 21 + step: 1 + icon: mdi:air-conditioner + script: + toshiba_ac_toggle_cool: + sequence: + - service_template: >- + {% if is_state('climate.toshiba_ac', 'off') %} + script.toshiba_ac_on_cool + {% else %} + climate.turn_off + {% endif %} + data_template: + entity_id: "{% if not is_state('climate.toshiba_ac', 'off') %}climate.toshiba_ac{%endif%}" + toshiba_ac_on_cool: sequence: - service: climate.turn_on @@ -43,8 +63,8 @@ script: - delay: "00:00:01" - service: climate.set_temperature entity_id: climate.toshiba_ac - data: - temperature: 19 + data_template: + temperature: "{{ states('input_number.toshiba_cool_temp') | default(19) }}" - service: logbook.log data: name: "馃挩 Climate Module 路 " diff --git a/config/packages/devices/living_room/wallmote.yaml b/config/packages/devices/living_room/wallmote.yaml index df5f281..059b968 100644 --- a/config/packages/devices/living_room/wallmote.yaml +++ b/config/packages/devices/living_room/wallmote.yaml @@ -104,14 +104,7 @@ automation: scene_id: 4 scene_data: 0 action: - - service_template: >- - {% if is_state('climate.toshiba_ac', 'off') %} - script.toshiba_ac_on_cool - {% else %} - climate.turn_off - {% endif %} - data_template: - entity_id: "{% if not is_state('climate.toshiba_ac', 'off') %}climate.toshiba_ac{%endif%}" + - service: script.toshiba_ac_toggle_cool - alias: Wallmote 路聽Living room 路 4 路 Hold 路 Toggle Titanium trigger: