Azndk01
(Liwen Chiang)
October 16, 2017, 6:18am
1
I have a question on the coding for automated lighting here what i have:
action:
alias: Lights on
data:
brightness_pct: ‘25’
entity_id: light.smart_dimmer_level
transition: ‘3’
service: light.turn_on
alias: Plex cast Playing to Paused
condition:
condition: template
value_template: states.media_player.living_room.attributes.app_name = Plex
value-template: ‘{{ states.media_player.cr_chromecast.attributes.app_name == “Plex” }}’
even replacing the vakue doesn’t work. Im using the automation template under configuration.
Tinkerer
(aka DubhAd on GitHub)
October 16, 2017, 8:18am
2
I don’t see a trigger, and your formatting is off - can you read the large blue box at the top please, and then edit your post and mark the YAML with </>
so that we can see the actual spacing, etc.
Azndk01
(Liwen Chiang)
October 16, 2017, 7:39pm
3
- action:
- alias: Lights on
data:
brightness_pct: '25'
entity_id: light.ge_15294_inwall_smart_dimmer_level
transition: '3'
service: light.turn_on
alias: Plex cast Playing to Paused
condition:
- condition: template
value_template: states.media_player.living_room.attributes.app_name = Plex
id: '1508825255892'
trigger:
- entity_id: media_player.living_room
from: playing
platform: state
to: paused
Tinkerer
(aka DubhAd on GitHub)
October 16, 2017, 7:51pm
4
The problem is with your template, it’s not a template
It should be:
value_template: '{{ states.media_player.living_room.attributes.app_name == "Plex" }}'
or
value_template: '{{ is_state_attr("media_player.living_room", "app_name", "Plex") }}'
Azndk01
(Liwen Chiang)
November 6, 2017, 9:57pm
6
Seems to work now after an update. thanks