How to command an ESPHome device from

Apologies for the non-specific question.

I have a number of home-built smart power switches that I’d like to transition from the Arduino/mqtt environment into Home Assistant. Installing the ESPHome code and operating them from the Home Assistant App or a Browser has been done. My problem now is how to command these switched from a Linux desktop script?

Up to now, I’ve commanded them via:
mosquitto_pub -hostname mqttbroker -topic switchname -message "on|off"

Can anyone suggest how I can send a command to my Home Assistant server (not necessarily via MQTT) to switch the ESPHome switches?

And what would that message be to command a switch On or Off?

Regards, Martin
PS - I have looked! There are lots of information regarding “sending” from Home Assistant but nothing covering commands the other way.

I am not using this myself currently, but here is a command line tool to remote control entities: