Hi there,
I want to share my first project. I took the example from the home assistant page and modified it to that what I want.
Here is what my configuration does:
- automatic change scene when playing media
- go to “normal” scene when pause or stopping movie
- toggle that automatic scene mode e.g. when you watch something besides and you need the normal light mode
- add and switch between more than one scene, e.g. football scene, romantic scene, action scene…
Here is my config for that:
Switch
platform: template
switches:
wozi_moviemode2:
value_template: "{{ is_state('automation.wozi_moviemode2_turn_on', 'on') }}"
friendly_name: 'Moviemode II'
turn_on:
service: automation.turn_on
entity_id:
- automation.wozi_moviemode2_turn_on
- automation.wozi_moviemode2_turn_off
turn_off:
- service: automation.turn_off
entity_id:
- automation.wozi_moviemode2_turn_on
- automation.wozi_moviemode2_turn_off
- service: scene.turn_on
entity_id:
- scene.wozi_normal
Turn-On Automation
alias: "wozi_moviemode2_turn_on"
trigger:
- platform: state
entity_id:
- media_player.wozi
- media_player.amazon_fire_tv
state: 'playing'
- platform: homeassistant
event: start
- platform: state
entity_id:
- light.puelight
from: 'unavailable'
to: 'on'
- platform: state
entity_id:
- light.puelight
from: 'off'
to: 'on'
- platform: state
entity_id:
- input_select.wozi_movie_mode_scenes
condition:
- condition: state
entity_id: switch.wozi_moviemode2
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: media_player.wozi
state: 'playing'
- condition: state
entity_id: media_player.amazon_fire_tv
state: 'playing'
action:
service: script.turn_on
entity_id: script.wozi_movie_script
Turn-Off Automation
alias: "wozi_moviemode2_turn_off"
trigger:
- platform: state
entity_id:
- media_player.wozi
- media_player.amazon_fire_tv
from: 'playing'
to: 'off'
- platform: state
entity_id:
- media_player.wozi
- media_player.amazon_fire_tv
from: 'playing'
to: 'paused'
- platform: state
entity_id:
- media_player.wozi
- media_player.amazon_fire_tv
from: 'playing'
to: 'idle'
- platform: state
entity_id:
- media_player.wozi
- media_player.amazon_fire_tv
from: 'playing'
to: 'standby'
action:
service: scene.turn_on
entity_id: scene.wozi_normal
Input-select
wozi_movie_mode_scenes:
name: 'Genre:'
options:
- Standard
- Fußball
- Romantik
initial: Standard
Scene football
name: wozi_fuba
entities:
light.puelight:
state: on
transition: 2
brightness: 255
rgb_color: [100,180,0]
Scene movie
name: wozi_movie
entities:
light.puelight:
state: on
transition: 2
brightness: 20
rgb_color: [0,80,180]
Scene normal
name: wozi_normal
entities:
light.puelight:
state: on
transition: 2
brightness: 154
color_temp: 265
rgb_color: [255,68,0]
Scene romantic
name: wozi_romantic
entities:
light.puelight:
state: on
transition: 2
brightness: 20
rgb_color: [255,30,110]
Customize
switch.wozi_moviemode2:
icon: mdi:movie
friendly_name: Lichtautomatik
Group for the card
wozi_movie_automatic:
name: Filmautomatik
control: shown
entities:
- switch.wozi_moviemode2
- input_select.wozi_movie_mode_scenes
script
wozi_movie_script:
alias: Set scene for wozi
sequence:
- service: scene.turn_on
data_template:
entity_id: >
{% if is_state("input_select.wozi_movie_mode_scenes", "Standard") %} scene.wozi_movie
{% elif is_state("input_select.wozi_movie_mode_scenes", "Fußball") %} scene.wozi_fuba
{% elif is_state("input_select.wozi_movie_mode_scenes", "Romantik") %} scene.wozi_romantic
{% endif %}
This is what it looks like in HA: