mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-06 18:08:45 +00:00
Introduce magic cube modes
This commit is contained in:
@@ -52,8 +52,6 @@ cards:
|
|||||||
- automation.lighting_adjust_temperature_on_start
|
- automation.lighting_adjust_temperature_on_start
|
||||||
- type: divider
|
- type: divider
|
||||||
- automation.lighting_living_room_adjust_temperature_based_on_time
|
- automation.lighting_living_room_adjust_temperature_based_on_time
|
||||||
- automation.lighting_living_room_turn_all_lights_on_on_magic_cube_flip_90
|
|
||||||
- automation.lighting_living_room_turn_all_lights_off_on_magic_cube_flip_180
|
|
||||||
- automation.lighting_master_bedroom_toggle_lights_on_bedside_switch_single_click
|
- automation.lighting_master_bedroom_toggle_lights_on_bedside_switch_single_click
|
||||||
- automation.lighting_master_bedroom_adjust_temperature_based_on_time
|
- automation.lighting_master_bedroom_adjust_temperature_based_on_time
|
||||||
- automation.lighting_kitchen_day_mode_motion_turn_lights_on_after_sunset
|
- automation.lighting_kitchen_day_mode_motion_turn_lights_on_after_sunset
|
||||||
@@ -66,21 +64,6 @@ cards:
|
|||||||
|
|
||||||
- type: divider
|
- type: divider
|
||||||
|
|
||||||
# Music
|
|
||||||
- type: custom:fold-entity-row
|
|
||||||
head:
|
|
||||||
type: custom:dummy-entity-row
|
|
||||||
entity: sun.sun
|
|
||||||
name: Music
|
|
||||||
icon: mdi:music-note
|
|
||||||
tap_action: none
|
|
||||||
entities:
|
|
||||||
- automation.music_play_pause_on_magic_cube_knock
|
|
||||||
- automation.music_volume_down_on_magic_cube_rotate_left
|
|
||||||
- automation.music_volume_up_on_magic_cube_rotate_right
|
|
||||||
|
|
||||||
- type: divider
|
|
||||||
|
|
||||||
# Media
|
# Media
|
||||||
- type: custom:fold-entity-row
|
- type: custom:fold-entity-row
|
||||||
head:
|
head:
|
||||||
@@ -184,6 +167,18 @@ cards:
|
|||||||
|
|
||||||
- type: divider
|
- type: divider
|
||||||
|
|
||||||
|
# Magic cube
|
||||||
|
- type: custom:fold-entity-row
|
||||||
|
head:
|
||||||
|
entity: input_boolean.magic_cube_enabled
|
||||||
|
name: Magic Cube
|
||||||
|
entities:
|
||||||
|
- automation.magic_cube_mode_change
|
||||||
|
- automation.magic_cube_lighting_toggle_on_knock
|
||||||
|
- automation.magic_cube_music_play_pause_on_knock
|
||||||
|
- automation.magic_cube_music_volume_down_on_rotate_left
|
||||||
|
- automation.magic_cube_music_volume_up_rotate_right
|
||||||
|
|
||||||
# Browser mod
|
# Browser mod
|
||||||
- type: custom:fold-entity-row
|
- type: custom:fold-entity-row
|
||||||
head:
|
head:
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ cards:
|
|||||||
|
|
||||||
- type: entities
|
- type: entities
|
||||||
entities:
|
entities:
|
||||||
|
- input_boolean.magic_cube_enabled
|
||||||
|
- input_select.magic_cube_mode
|
||||||
- entity: sensor.cube_analog_input
|
- entity: sensor.cube_analog_input
|
||||||
- entity: sensor.cube_multistate_input
|
- entity: sensor.cube_multistate_input
|
||||||
- entity: sensor.cube_power
|
- entity: sensor.cube_power
|
||||||
|
|||||||
@@ -1,29 +1,120 @@
|
|||||||
|
input_boolean:
|
||||||
|
magic_cube_enabled:
|
||||||
|
name: Enable Cube
|
||||||
|
icon: mdi:cube-outline
|
||||||
|
|
||||||
|
input_select:
|
||||||
|
magic_cube_mode:
|
||||||
|
name: Cube Mode
|
||||||
|
icon: mdi:cube-scan
|
||||||
|
options:
|
||||||
|
- music
|
||||||
|
- light
|
||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: Lighting · Living room · Turn all lights on on Magic Cube flip 90
|
- alias: Magic Cube · Mode · Change
|
||||||
trigger:
|
trigger:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_ieee: !secret magic_cube_ieee
|
device_ieee: !secret magic_cube_ieee
|
||||||
command: flip
|
command: slide
|
||||||
args:
|
|
||||||
flip_degrees: 90
|
|
||||||
action:
|
action:
|
||||||
- service: light.turn_on
|
- service: input_select.select_option
|
||||||
|
entity_id: input_select.magic_cube_mode
|
||||||
|
data_template:
|
||||||
|
option: >-
|
||||||
|
|
||||||
|
{% if trigger.event.data["args"]["activated_face"] == 5 %}
|
||||||
|
music
|
||||||
|
{% elif trigger.event.data["args"]["activated_face"] == 2 %}
|
||||||
|
light
|
||||||
|
{% else %}
|
||||||
|
{{ states('input_select.magic_cube_mode') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
- alias: Magic Cube · Lighting · Toggle on Knock
|
||||||
|
trigger:
|
||||||
|
platform: event
|
||||||
|
event_type: zha_event
|
||||||
|
event_data:
|
||||||
|
device_ieee: !secret magic_cube_ieee
|
||||||
|
command: knock
|
||||||
|
condition:
|
||||||
|
condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.magic_cube_enabled
|
||||||
|
state: "on"
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_select.magic_cube_mode
|
||||||
|
state: "light"
|
||||||
|
action:
|
||||||
|
- service: light.toggle
|
||||||
entity_id: light.living_room_all_lights
|
entity_id: light.living_room_all_lights
|
||||||
|
|
||||||
- alias: Lighting · Living room · Turn all lights off on Magic Cube flip 180
|
- alias: Magic Cube · Music · Play/Pause on Knock
|
||||||
trigger:
|
trigger:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: zha_event
|
event_type: zha_event
|
||||||
event_data:
|
event_data:
|
||||||
device_ieee: !secret magic_cube_ieee
|
device_ieee: !secret magic_cube_ieee
|
||||||
command: flip
|
command: knock
|
||||||
args:
|
condition:
|
||||||
flip_degrees: 180
|
condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.magic_cube_enabled
|
||||||
|
state: "on"
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_select.magic_cube_mode
|
||||||
|
state: "music"
|
||||||
action:
|
action:
|
||||||
- service: light.turn_off
|
- service: media_player.media_play_pause
|
||||||
entity_id: light.living_room_all_lights
|
data:
|
||||||
|
entity_id: media_player.living_room
|
||||||
|
|
||||||
|
- alias: Magic Cube · Music · Volume down on rotate left
|
||||||
|
trigger:
|
||||||
|
platform: event
|
||||||
|
event_type: zha_event
|
||||||
|
event_data:
|
||||||
|
device_ieee: !secret magic_cube_ieee
|
||||||
|
command: rotate_left
|
||||||
|
condition:
|
||||||
|
condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.magic_cube_enabled
|
||||||
|
state: "on"
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_select.magic_cube_mode
|
||||||
|
state: "music"
|
||||||
|
action:
|
||||||
|
- service: media_player.volume_down
|
||||||
|
data:
|
||||||
|
entity_id: media_player.living_room
|
||||||
|
|
||||||
|
- alias: Magic Cube ‚ Music · Volume up rotate right
|
||||||
|
trigger:
|
||||||
|
platform: event
|
||||||
|
event_type: zha_event
|
||||||
|
event_data:
|
||||||
|
device_ieee: !secret magic_cube_ieee
|
||||||
|
command: rotate_right
|
||||||
|
condition:
|
||||||
|
condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.magic_cube_enabled
|
||||||
|
state: "on"
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_select.magic_cube_mode
|
||||||
|
state: "music"
|
||||||
|
action:
|
||||||
|
- service: media_player.volume_up
|
||||||
|
data:
|
||||||
|
entity_id: media_player.living_room
|
||||||
|
|
||||||
#
|
#
|
||||||
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ group:
|
|||||||
- automation.house_mode_set_to_day
|
- automation.house_mode_set_to_day
|
||||||
- automation.house_mode_toggle_on_bedside_switch_double_click
|
- automation.house_mode_toggle_on_bedside_switch_double_click
|
||||||
- automation.alarm_wake_up
|
- automation.alarm_wake_up
|
||||||
- automation.music_play_pause_on_magic_cube_knock
|
|
||||||
- automation.music_volume_down_on_magic_cube_rotate_left
|
|
||||||
- automation.music_volume_up_on_magic_cube_rotate_right
|
|
||||||
- automation.lighting_turn_on_ceiling_lights_after_sunset
|
- automation.lighting_turn_on_ceiling_lights_after_sunset
|
||||||
- automation.lighting_turn_off_all_lights_after_sunrise
|
- automation.lighting_turn_off_all_lights_after_sunrise
|
||||||
- automation.lighting_living_room_turn_all_lights_on_on_magic_cube_flip_90
|
- automation.lighting_living_room_turn_all_lights_on_on_magic_cube_flip_90
|
||||||
@@ -45,6 +42,8 @@ automation:
|
|||||||
entity_id: input_boolean.guest_mode
|
entity_id: input_boolean.guest_mode
|
||||||
- service: automation.turn_off
|
- service: automation.turn_off
|
||||||
entity_id: group.domestina_disabled_automations
|
entity_id: group.domestina_disabled_automations
|
||||||
|
- service: input_boolean.turn_off
|
||||||
|
entity_id: input_boolean.magic_cube_enabled
|
||||||
|
|
||||||
- alias: Domestina · Automate end
|
- alias: Domestina · Automate end
|
||||||
trigger:
|
trigger:
|
||||||
@@ -68,3 +67,5 @@ automation:
|
|||||||
entity_id: input_boolean.guest_mode
|
entity_id: input_boolean.guest_mode
|
||||||
- service: automation.turn_on
|
- service: automation.turn_on
|
||||||
entity_id: group.domestina_disabled_automations
|
entity_id: group.domestina_disabled_automations
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
entity_id: input_boolean.magic_cube_enabled
|
||||||
|
|||||||
@@ -21,40 +21,3 @@ script:
|
|||||||
entity_id: media_player.master_bedroom
|
entity_id: media_player.master_bedroom
|
||||||
source: "{{ playlist | default('Evening Chill') }}"
|
source: "{{ playlist | default('Evening Chill') }}"
|
||||||
|
|
||||||
|
|
||||||
automation:
|
|
||||||
- alias: Music · Play/Pause on Magic Cube Knock
|
|
||||||
trigger:
|
|
||||||
platform: event
|
|
||||||
event_type: zha_event
|
|
||||||
event_data:
|
|
||||||
device_ieee: !secret magic_cube_ieee
|
|
||||||
command: knock
|
|
||||||
action:
|
|
||||||
- service: media_player.media_play_pause
|
|
||||||
data:
|
|
||||||
entity_id: media_player.living_room
|
|
||||||
|
|
||||||
- alias: Music · Volume down on Magic Cube rotate left
|
|
||||||
trigger:
|
|
||||||
platform: event
|
|
||||||
event_type: zha_event
|
|
||||||
event_data:
|
|
||||||
device_ieee: !secret magic_cube_ieee
|
|
||||||
command: rotate_left
|
|
||||||
action:
|
|
||||||
- service: media_player.volume_down
|
|
||||||
data:
|
|
||||||
entity_id: media_player.living_room
|
|
||||||
|
|
||||||
- alias: Music · Volume up on Magic Cube rotate right
|
|
||||||
trigger:
|
|
||||||
platform: event
|
|
||||||
event_type: zha_event
|
|
||||||
event_data:
|
|
||||||
device_ieee: !secret magic_cube_ieee
|
|
||||||
command: rotate_right
|
|
||||||
action:
|
|
||||||
- service: media_player.volume_up
|
|
||||||
data:
|
|
||||||
entity_id: media_player.living_room
|
|
||||||
|
|||||||
Reference in New Issue
Block a user