mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-06 01:48:44 +00:00
Automate music and lighting with Magic Cube
This commit is contained in:
+35
-15
@@ -7,10 +7,6 @@ cards:
|
||||
title: Automations
|
||||
show_header_toggle: false
|
||||
entities:
|
||||
- automation.master_bedroom_bedside_light_on_bedside_switch_single_click
|
||||
- automation.cube_knock
|
||||
- automation.cube_shake
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
@@ -24,6 +20,30 @@ cards:
|
||||
- automation.leaving_work_to_home
|
||||
- automation.leaving_home
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
entity: sun.sun
|
||||
name: Lighting
|
||||
icon: mdi:lightbulb
|
||||
open: true
|
||||
entities:
|
||||
- automation.master_bedroom_bedside_light_on_bedside_switch_single_click
|
||||
- automation.lighting_living_room_turn_on_cube_flip_90
|
||||
- automation.lighting_living_room_turn_off_cube_flip_180
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
entity: sun.sun
|
||||
name: Music
|
||||
icon: mdi:music-note
|
||||
open: true
|
||||
entities:
|
||||
- automation.music_pause_on_cube_knock
|
||||
- automation.music_volume_down_on_cube_rotate_left
|
||||
- automation.music_volume_up_on_cube_rotate_right
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
@@ -46,17 +66,6 @@ cards:
|
||||
- automation.telegram_enable_guest_mode
|
||||
- automation.telegram_disable_guest_mode
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
entity: sun.sun
|
||||
name: Security
|
||||
icon: mdi:shield-home
|
||||
open: true
|
||||
entities:
|
||||
- automation.security_door_opened_while_away
|
||||
- automation.camera_turn_off_on_startup
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
@@ -68,6 +77,17 @@ cards:
|
||||
- automation.domestina_automate_end
|
||||
- automation.domestina_end
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
entity: sun.sun
|
||||
name: Security
|
||||
icon: mdi:shield-home
|
||||
open: true
|
||||
entities:
|
||||
- automation.security_door_opened_while_away
|
||||
- automation.camera_turn_off_on_startup
|
||||
|
||||
- type: custom:fold-entity-row
|
||||
head:
|
||||
type: custom:dummy-entity-row
|
||||
|
||||
@@ -1,24 +1,3 @@
|
||||
automation:
|
||||
- id: cube_knock
|
||||
alias: Magic cube · Knock · Go to bed
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.cube_multistate_input
|
||||
to: "knock"
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.sleep_mode
|
||||
|
||||
- id: cube_shake
|
||||
alias: Magic cube · Shake · Wake up
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.cube_multistate_input
|
||||
to: "shake"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.sleep_mode
|
||||
|
||||
#
|
||||
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
||||
#
|
||||
|
||||
@@ -12,8 +12,11 @@ group:
|
||||
- automation.enable_sleep_mode
|
||||
- automation.disable_sleep_mode
|
||||
- automation.sleep_toggle_on_switch_tap
|
||||
- automation.cube_knock
|
||||
- automation.cube_shake
|
||||
- automation.music_pause_on_cube_knock
|
||||
- automation.music_volume_down_on_cube_rotate_left
|
||||
- automation.music_volume_up_on_cube_rotate_right
|
||||
- automation.lighting_living_room_turn_on_cube_flip_90
|
||||
- automation.lighting_living_room_turn_off_cube_flip_180
|
||||
- automation.bedtime_toggle_on_master_bedroom_bedside_switch_hold
|
||||
|
||||
automation:
|
||||
|
||||
@@ -23,17 +23,45 @@ light:
|
||||
|
||||
automation:
|
||||
- id: master_bedroom_bedside_light_on_bedside_switch_single_click
|
||||
alias: "Lighting · Toggle master bedroom bedside light on bedisde switch single click"
|
||||
alias: Lighting · Master bedroom · Toggle bedside light on bedisde switch single click"
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: zha_event
|
||||
event_data:
|
||||
device_ieee: !secret master_bedroom_bedside_switch_ieee
|
||||
command: single
|
||||
platform: event
|
||||
event_type: zha_event
|
||||
event_data:
|
||||
device_ieee: !secret master_bedroom_bedside_switch_ieee
|
||||
command: single
|
||||
action:
|
||||
- service: light.toggle
|
||||
entity_id: light.bedside_light
|
||||
|
||||
- id: lighting_living_room_turn_on_cube_flip_90
|
||||
alias: Lighting · Living room · Turn all lights on on Magic Cube flip 90
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zha_event
|
||||
event_data:
|
||||
device_ieee: !secret magic_cube_ieee
|
||||
command: flip
|
||||
args:
|
||||
flip_degrees: 90
|
||||
action:
|
||||
- service: light.turn_on
|
||||
entity_id: light.living_room_all_lights
|
||||
|
||||
- id: lighting_living_room_turn_off_cube_flip_180
|
||||
alias: Lighting · Living room · Turn all lights off on Magic Cube flip 180
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: zha_event
|
||||
event_data:
|
||||
device_ieee: !secret magic_cube_ieee
|
||||
command: flip
|
||||
args:
|
||||
flip_degrees: 180
|
||||
action:
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room_all_lights
|
||||
|
||||
homeassistant:
|
||||
customize:
|
||||
light.living_room_1:
|
||||
|
||||
@@ -41,3 +41,40 @@ script:
|
||||
entity_id: group.all_sonos
|
||||
data_template:
|
||||
master: "{{ states('input_select.sonos_leader') }}"
|
||||
|
||||
automation:
|
||||
- id: music_pause_on_cube_knock
|
||||
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
|
||||
entity_id: group.all_sonos
|
||||
|
||||
- id: music_volume_down_on_cube_rotate_left
|
||||
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
|
||||
entity_id: group.all_sonos
|
||||
|
||||
- id: music_volume_up_on_cube_rotate_right
|
||||
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
|
||||
entity_id: group.all_sonos
|
||||
|
||||
Reference in New Issue
Block a user