diff --git a/config/home-lovelace.yaml b/config/home-lovelace.yaml index fcd8a84..8cd3830 100644 --- a/config/home-lovelace.yaml +++ b/config/home-lovelace.yaml @@ -171,6 +171,9 @@ views: - type: custom:button-card template: small entity: input_boolean.guest_mode + tap_action: + action: call-service + service: script.house_mode_next - type: horizontal-stack cards: - type: custom:button-card diff --git a/config/packages/modes/house_mode.yaml b/config/packages/modes/house_mode.yaml index c46e833..2032783 100644 --- a/config/packages/modes/house_mode.yaml +++ b/config/packages/modes/house_mode.yaml @@ -36,9 +36,24 @@ input_boolean: name: Enable alarm icon: mdi:alarm +script: + house_mode_next: + alias: House mode · Next + sequence: + - service: input_select.select_option + entity_id: input_select.house_mode + data_template: + option: > + + {% if is_state('input_select.house_mode', 'day') %} + bed + {% elif is_state('input_select.house_mode', 'bed') %} + night + {% else %} + day + {% endif %} automation: - - alias: House mode · Set to day trigger: platform: state @@ -71,18 +86,7 @@ automation: device_ieee: !secret master_bedroom_bedside_switch_ieee command: double action: - - service: input_select.select_option - entity_id: input_select.house_mode - data_template: - option: > - - {% if is_state('input_select.house_mode', 'day') %} - bed - {% elif is_state('input_select.house_mode', 'bed') %} - night - {% else %} - day - {% endif %} + - service: script.house_mode_next - alias: Alarm · Wake up trigger: