number: - platform: template name: Fan Level optimistic: true id: level min_value: 0 max_value: 3 step: 1 on_value_range: below: 1 then: - switch.turn_off: relay1 - switch.turn_off: relay2 - switch.turn_off: relay3 on_value: then: - if: condition: lambda: return id(level).state == 1; then: - switch.turn_on: relay1 - if: condition: lambda: return id(level).state == 2; then: - switch.turn_on: relay2 - if: condition: lambda: return id(level).state == 3; then: - switch.turn_on: relay3