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

Problem with : repeat for each

$
0
0

Hello everyone,

Is it possible to use a repear for each in a repeat for each.
See below:

actions:
  - repeat:
      for_each:
        - min
        - max
      sequence:
        - repeat:
            for_each: |
              {% set Lijst = states 
                               |selectattr('domain', '==', 'input_number') 
                               |selectattr('entity_id', 'search', 'vandaag') 
                               |selectattr('entity_id', 'search', repeat.item) 
                               |map(attribute='entity_id')  
                               |list
                               %}
              {{Lijst}}
            sequence:
              - data:
                  value: >
                    {% if states('sensor.' +
                    repeat.item.split('.')[1].split('_')[-5:-3]|join('_')+
                    '_nu_temp')|float <
                             states('input_number.' + repeat.item.split('.')[1].split('_')[-5:-3]|join('_') + '_vandaag_' + repeat.item + '_temp')|float %}
                           {{states('sensor.' + repeat.item.split('.')[1].split('_')[-5:-3]|join('_')+ '_nu_temp')|float}}
                       {% else %}
                           {{states('input_number.' + repeat.item.split('.')[1].split('_')[-5:-3]|join('_') + '_vandaag_' + repeat.item + '_temp')|float}}
                       {% endif %}             
                target:
                  entity_id: >
                    input_number.{{repeat.item.split('.')[1].split('_')[-5:-3]|join('_')}}_vandaag_{{repeat.item}}_temp
                action: input_number.set_value

But this does not work.

If this is possible, how do I do this.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 107909

Trending Articles



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