Clickable MQTT Button

Hey,
Would anyone know how i would have a stateless mqtt switch ask i want a nodemcu to wake send a mqtt message and go back to sleep when i click a button, i know how to do the nodemcu bit just not home assistant

You don’t get a button, just an ‘activate’ text but you can write a script like

script:
  send_identity_lounge:
    sequence:
      # This is written using the Script Syntax
      - service: script.send_trv_command
        data:
          id: '329'
          command: 'Identify'
  
  
  send_trv_command:
    sequence:
      - service: mqtt.publish
        data_template:
          topic: '/energenie/eTRV/Command/{{command}}/{{id}}'
          payload: 'ON'

You don’t have to have two scripts, you can have the mqtt service in the first, its just the example I came across in my configuration.yaml

Check out this video: https://www.youtube.com/watch?v=ImVK5cGVrpQ