Hi there,
I’d like to set my lights to dim when playing a specific media type in Kodi. I’ve tried to modify the example dim lights automation, but am not winning.
The dim lights automation works well, but becomes a little annoying when Kodi plays the next song. So I’d like it to only apply to videos.
Can one fetch the attribute state of media_content_type in the trigger rather than the condition, if so, how?
What am I doing wrong in my automation below?
Here is my current automation script:
Automation
Kodi - Light - Sun Integration
-
alias: “Media player paused/stopped”
trigger:- platform: state
entity_id: media_player.kodi
from: ‘playing’
condition:
condition: and
conditions:- condition: template
value_template: ‘{{ states.media_player.kodi.attributes.media_content_type = “video” }}’ - condition: state
entity_id: sun.sun
state: ‘below_horizon’
action:
service: scene.turn_on
entity_id: scene.livingroom_normal
- condition: template
- platform: state
-
alias: “Media player playing”
trigger:- platform: state
entity_id: media_player.kodi
to: ‘playing’
condition:
condition: and
conditions:- condition: template
value_template: ‘{{ states.media_player.kodi.attributes.media_content_type = “video” }}’ - condition: state
entity_id: sun.sun
state: ‘below_horizon’
action:
service: scene.turn_on
entity_id: scene.livingroom_dim
- condition: template
- platform: state