Hey guys:
I’m trying to implement the Dim Lights When Playing Media automation from here, but i think there is an error: https://home-assistant.io/cookbook/dim_lights_when_playing_media/
I have the following scene created, and it appears as an entity:
- name: Great Room Normal
entities:
light.great_room_table_left:
state: on
transition: 2
brightness: 175
xy_color: [ 0.1684,0.0416 ]
light.great_room_table_right:
state: on
transition: 2
brightness: 190
xy_color: [ 0.1684,0.0416 ]
light.great_room_ceiling:
state: on
transition: 2
brightness: 190
xy_color: [ 0.1684,0.0416 ]
- name: Great Room Dim
entities:
light.great_room_table_left:
state: on
transition: 2
brightness: 75
xy_color: [ 0.1684,0.0416 ]
light.great_room_table_right:
state: on
transition: 2
brightness: 75
xy_color: [ 0.1684,0.0416 ]
light.great_room_ceiling:
state: on
transition: 2
brightness: 75
xy_color: [ 0.1684,0.0416 ]
but the automation is throwing some errors:
###Dim and Turn on Great Room Lights with Movie####
- alias: "Media player paused/stopped"
trigger:
- platform: state
entity_id: media_player.family_room_tv
from: 'on'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.great_room_normal
- alias: "Media player playing"
trigger:
- platform: state
entity_id: media_player.family_room_tv
to: 'on'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.great_room_dim
If I run hass --script check_config I get the following:
automation:
- [OrderedDict([('alias', 'Media player paused/stopped'), ('trigger', [OrderedDict([('platform', 'state'), ('entity_id', 'media_player.family_room_tv'), ('from', 'on')])]), ('condition', [OrderedDict([('condition', 'state'), ('entity_id', 'sun.sun'), ('state', 'below_horizon')])]), ('action', OrderedDict([('service', 'scene.turn_on'), ('entity_id', 'scene.great_room_normal')]))]), OrderedDict([('alias', 'Media player playing'), ('trigger', [OrderedDict([('platform', 'state'), ('entity_id', 'media_player.family_room_tv'), ('to', 'on')])]), ('condition', [OrderedDict([('condition', 'state'), ('entity_id', 'sun.sun'), ('state', 'below_horizon')])]), ('action', OrderedDict([('service', 'scene.turn_on'), ('entity_id', 'scene.great_room_dim')]))])]
Successful config (partial)
automation:
I’m running HASS version 0.32.1, and Kodi version 16.1 ( librelec )
Does anyone have any ideas how I can make this work? Maybe we can update the cookbook if there’s an issue?