Showing next X trains with Transport for NSW integration

I’ve setup the TransportNSW integration, and it’s working perfectly. But I’d like to display the next X trains due on a given route.

The data’s certainly there (I can view it on the transport website), but I can’t figure out how to call it from the HA integration.

Any hints?

Did you get anywhere with this?

With all the cancellations I want to get the next bus that has ‘real_time’ = Y, since the lack of realtime seems to indicate the bus will be ‘not in service’ as it passes me, despite having shown up as the next bus due!!