Add christmas lights

This commit is contained in:
Georgi Gardev
2022-12-08 21:36:21 +02:00
parent 3c4776af66
commit 5b60b0ffc2
7 changed files with 202 additions and 0 deletions
+20
View File
@@ -164,3 +164,23 @@ media_extractor:
# https://www.home-assistant.io/integrations/mobile_app
mobile_app:
rest_command:
isparkle_on:
url: "http://192.168.0.13:1338/on"
method: "POST"
content_type: "application/x-www-form-urlencoded"
isparkle_off:
url: "http://192.168.0.13:1338/off"
method: "POST"
content_type: "application/x-www-form-urlencoded"
isparkle_fade:
url: "http://192.168.0.13:1338/fade"
method: "POST"
content_type: "application/x-www-form-urlencoded"
payload: "color={{ color }}&fadeInTime={{ fadeInTime }}&&fadeOutTime={{ fadeOutTime }}"
isparkle_set:
url: "http://192.168.0.13:1338/set"
method: "POST"
content_type: "application/x-www-form-urlencoded"
payload: "color={{ color }}&fn={{ fn }}&brightness1={{ brightness1 }}&timing1={{ timing1 }}&brightness2={{ brightness2 }}&timing2={{ timing2 }}"
@@ -119,6 +119,14 @@
show_state: false
tap_action:
action: more-info
- type: custom:button-card
template: v3_button
entity: input_select.isparkle_color
name: Christmas lights
icon: mdi:string-lights
show_state: false
tap_action:
action: more-info
- type: vertical-stack
cards:
@@ -103,6 +103,21 @@
- automation.tv_plex_setup_house_for_plex
- automation.tv_plex_restore_house_after_plex
- type: custom:decluttering-card
template: v3_section_title
variables:
- title: Christmas lights
- type: entities
entities:
- rest_command.isparkle_on
- rest_command.isparkle_off
- input_select.isparkle_color
- input_select.isparkle_fade
- input_number.isparkle_brightness_1
- input_number.isparkle_fade_1
- input_number.isparkle_brightness_2
- input_number.isparkle_fade_2
- type: vertical-stack
cards:
- type: custom:decluttering-card
+107
View File
@@ -939,3 +939,110 @@ cards:
show_state: false
tap_action:
action: toggle
- type: custom:popup-card
entity: input_select.isparkle_color
title: "Christmas lights"
card:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
template: v3_button
icon: mdi:string-lights
name: "On"
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_on
- type: custom:button-card
template: v3_button
name: "Off"
icon: mdi:string-lights-off
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_off
- type: horizontal-stack
cards:
- type: custom:button-card
template: v3_tablet_button
name: "Fade white"
icon: mdi:string-lights
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_fade
service_data:
color: white
fadeInTime: 20
fadeOutTime: 20
- type: custom:button-card
template: v3_tablet_button
name: "Fade white slow"
icon: mdi:string-lights
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_fade
service_data:
color: white
fadeInTime: 100
fadeOutTime: 100
- type: custom:button-card
template: v3_tablet_button
name: "Fade color"
icon: mdi:string-lights
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_fade
service_data:
color: mix
fadeInTime: 20
fadeOutTime: 20
- type: custom:button-card
template: v3_tablet_button
name: "Fade color slow"
icon: mdi:string-lights
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_fade
service_data:
color: mix
fadeInTime: 100
fadeOutTime: 100
- type: horizontal-stack
cards:
- type: custom:button-card
template: v3_tablet_button
name: "Static white"
icon: mdi:string-lights
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_set
service_data:
color: white
fn: solid
brightness1: 10
brightness2: 10
timing1: 0
timing2: 0
- type: custom:button-card
template: v3_tablet_button
name: "Static color"
icon: mdi:string-lights
show_state: false
tap_action:
action: call-service
service: rest_command.isparkle_set
service_data:
color: mix
fn: solid
brightness1: 10
brightness2: 10
timing1: 0
timing2: 0
@@ -0,0 +1,50 @@
input_select:
isparkle_color:
name: Christmas lights color
options:
- mix
- white
isparkle_fade:
name: Christmas lights fade
options:
- fade
- solid
input_number:
isparkle_fade_1:
name: Christmas lights fade 1
min: 0
max: 999
isparkle_fade_2:
name: Christmas lights fade 2
min: 0
max: 999
isparkle_brightness_1:
name: Christmas lights brightness 1
min: 0
max: 10
isparkle_brightness_2:
name: Christmas lights brightness 2
min: 0
max: 10
automation:
- alias: Christmas lights change
trigger:
- platform: state
entity_id:
- input_select.isparkle_color
- input_select.isparkle_fade
- input_number.isparkle_fade_1
- input_number.isparkle_fade_2
- input_number.isparkle_brightness_1
- input_number.isparkle_brightness_2
action:
service: rest_command.isparkle_set
data_template:
color: "{{ states('input_select.isparkle_color') }}"
fn: "{{ states('input_select.isparkle_fade') }}"
brightness1: "{{ states('input_number.isparkle_brightness_1') | int }}"
timing1: "{{ states('input_number.isparkle_fade_1') | int}}"
brightness2: "{{ states('input_number.isparkle_brightness_2') | int }}"
timing2: "{{ states('input_number.isparkle_fade_2') | int }}"
+1
View File
@@ -21,6 +21,7 @@ script:
- service: light.turn_off
entity_id: light.master_bedroom
- service: script.living_room_candle_off
- service: rest_command.isparkle_off
routine_good_night:
alias: Routine · Going to sleep
+1
View File
@@ -24,6 +24,7 @@ script:
entity_id:
- light.living_room_ambient
- service: rest_command.isparkle_on
- service: script.open_living_room_cover
- service: script.shield_screensaver