Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105741

Automation service data_template not working

$
0
0

@thisisdavidbell wrote:

Hey,
I presume Im making a very simple mistake, but the following automation (when I select the Nintendo Switch in the input selector):

- alias: cinema_room_scene_automation
  trigger:
    platform: state
    entity_id: input_select.cinema_room_scenes
  action:
    service: remote.turn_on
    data:
      entity_id: remote.cinema_room
#      activity: 'Cinema Room Switch'
    data_template:
      activity: >
        {% if is_state("input_select.cinema_room_scenes", "Chromecast") %}
          'Cinema Room Chromecast'
        {%-elif is_state("input_select.cinema_room_scenes", "NintendoSwitch") %}
          'Cinema Room Switch'
        {%-elif is_state("input_select.cinema_room_scenes", "PS3") %}
          'Cinema Room PS3'
        {% else %}
           'PowerOff'
        {% endif %}

results in the following log error:

2020-04-26 11:52:52 ERROR (MainThread) [homeassistant.components.harmony.remote] Cinema Room: Activity 'Cinema Room Switch' is invalid

However, removing the data_template and uncommenting the activity line under data results in the Harmony activity starting without issue.

So what have I done wrong?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 105741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>