# virtual switch which follows the Spotswitch states automatically
switch:
  - platform: template
    switches:
      spotswitch1:
        unique_id: spotsw1
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="1" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch2:
        unique_id: spotsw2
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="2" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch3:
        unique_id: spotsw3
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="3" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch4:
        unique_id: spotsw4
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="4" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch5:
        unique_id: spotsw5
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="5" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch6:
        unique_id: spotsw6
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="6" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch7:
        unique_id: spotsw7
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="7" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch8:
        unique_id: spotsw8
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="8" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch9:
        unique_id: spotsw9
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="9" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
      spotswitch10:
        unique_id: spotsw10
        value_template: >
          {% for item in states.sensor.spotswitch_states.attributes.States %}
            {% if item.index=="10" %}
              {{item.state}}
            {% endif %}
          {% endfor %}
        turn_on:
        turn_off:
