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

Template in script

$
0
0

@helfm wrote:

Dear community,

I need your help.
I want to control in a script, depending on switches and input parameters, which blinds are moved to a certain position.

Unfortunately no roller blind moves. In my example I have two roller blinds.
If I remove one of the services, it works.
Why? Is it only possible to define one service in a sequence using one template?

Listed below, my example:

script_rollo_test:
  alias: Setzt definierte Rollos Test
  icon: "mdi:script-text-outline"
  description: 'Setzt definierte Rollos Test'

  fields:
    title:
      description: 'The title of the notification'
      example: 'State change'
    message:
      description: 'The message content'
      example: 'The light is on!'
    position:
      description: 'New position of cover'
      example: 30
    orientation:
      description: 'geographic direction'
      example: 'all'

  sequence:
    # Benachrichtigung zur Kontrolle
    - service: notify.telegram
      data_template:
        title: "{{ title }}"
        message: "{{ message }} {{ orientation }} {{ position }}"
    # Rollo Osten Gästezimmer auf bestimmte Position stellen
    - service: cover.set_cover_position
      data_template:
        entity_id: >
          {% if is_state('input_boolean.automatisierung_gaestezimmer', 'on') 
            and
              (orientation == 'all'
              or
                orientation == 'east'
              or
                orientation == 'gast') %}
            cover.rollo_gaestezimmer
          {% endif %}
        position: "{{ position }}"
    # Rollo Gästezimmer auf bestimmte Position stellen
    - service: cover.set_cover_position
      data_template:
        entity_id: >
          {% if is_state('input_boolean.automatisierung_schlafzimmer', 'on') 
            and
              (orientation == 'all'
              or
                orientation == 'east'
              or
                orientation == 'schlafz') %}
            cover.rollo_schlafzimmer
          {% endif %}
        position: "{{ position }}"

I hope that someone can help me. I’m a little desperate right now.

BR Markus

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 102436

Trending Articles



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