Controlling a gas-fireplace using MQTT

I have a gas-fireplace that can be controlled by MQTT commands. The device can be controlled bij 4 commands. /SET with a payload ON, OFF, HIGHER or LOWER. It supports reporting state by sending /GET with a payload STATE and it will sends /STATE with a payload ON or OFF periodically and on each change. How can I simply control this device. I managed to switch it On and Off by putting a switch configuration into the configuration.yaml but I have no idea how configure it so that I also can send the higher and lower commands.

What I would do is create a scripts that send the mqtt commands then create a virtual switch to turn on the send high script and the off would send low script

Doing this from the phone copy/paste hard to do

Tanks Stephan. Inspired by your answer I created 2 buttons that I combined, together with the on/off switch into an entity card. Not the most beautiful solution but it works more than good enough.
This is how I have done it (openhaard = fireplace)

switch:
  - platform: mqtt
    name: "Openhaard"
    unique_id: "openhaard01"
    state_topic: "openhaard/state"
    command_topic: "openhaard/set"
    payload_on: "on"
    payload_off: "off"
button:
  - platform: mqtt
    name: "Openhaard lower"
    unique_id: "openhaard01btnlower"
    command_topic: "openhaard/set"
    payload_press: "lower"
  - platform: mqtt
    name: "Openhaard higher"
    unique_id: "openhaard01btnhigher"
    command_topic: "openhaard/set"
    payload_press: "higher"
1 Like

10 out 10 bro

As long as it does what u want it’s your right way

You can teach a old a new trick

Like the way u use the button got me thinking

1 Like