I’m telling you (in more than one post) that you need to confirm that Home Assistant is logging in to the broker. Based on the limited information you have provided, it’s not and that’s why your automation’s MQTT Trigger doesn’t work.
I suggest you follow the other instructions I provided above. This is a simple problem to fix.