There is a bus which does Cardiff to Hay Sparkly, judging by times from Cardiff to towns in south Powys could be over two hours. I suggest you contact Cardiff bus depots, so many come to Hay for the festival they may have buses which go straight to Hay and not stop at all those villages . If you decide to visit Hay and choose to stay over night try Brecon and surrounding villages, lots of B&B's and you may be lucky . If you fail to get to the festival but love books a whole day can be spent in Hay in the book shops and some lovely tea rooms ? , I love going to Hay, I have been told the fabulous jigsaw shop is now closed , hope not true