How to Turn on MQTT device in Automation?

I can turn on/off all my MQTT devices from dashboard but when I try to add one to an automation they aren’t listed under devices? How do I turn a mqtt device on/off in automation? Thanks