mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-07 01:14:42 +00:00
Extract next house mode into script. Use in home dashboard
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user