Auto-discovery of an MQTT "button" that can be activated from HA?

I have a program that is successfully exposing a named switch, which automatically shows up in Home Assistant without any configuration on the HA side. It does this by publishing a message on topic homeassistant/switch/my_device_name/config with payload { "name": "my_device_name", "command_topic": "homeassistant/switch/my_device_name/set", "state_topic": "homeassistant/switch/my_device_name/state"}

With this i can successfully communicate on/off commands to the program from HA.

Is there a way to expose a simple button in a similar way? To trigger actions in the program that don’t have on/off state like a switch does. I could create a second switch that does the action when turned on nothing when “turned off,” but that seems like a hack. Is there a better way?

You probably need a binary sensor

i’m trying to communicate to the program from HA, via mqtt

OK, now I’m completely lost. I have some Python services running on other Pi’s. E.g I can shutdown a non-HA pi’s by sending mqtt message raspberry/shutdown . Is it something like that you want?

sure, but what type of entity do they present themselves as over mqtt, that HA auto-discovers?