Sent MQTT commands log / MQTT topic+payload structure?

Hi all,

I am trying to get to the bottom of what commands/messages is MQTT sending in order to move my indoor PTZ camera left/right up/down. I am trying to create a picture elements card with custom buttons to move the camera.

However MQTT integration integrates the commands as left+right and up+down not separately. This way I cannot bind the MOVE LEFT command to camera to move left button on the card.

I need to determine what command is MQTT sending to my camera in order to move it left/right/up/down. I have tried understanding the firmware’s MQTT commands but I cannot seem to get what should be in topic and what in payload. The camera is Dafang 3 with HACKS firmware.

By pressing the up button the camera tilts up by predefined firmware’s angle/length I would like to replicate this into my icon which upon single press would do the same.

Can anybdoy help me with the correct MQTT publish syntax ?
Also if anybody would be so kind as to tell me how to then create a custom service for such MQTT publish that would be great !

Install MQTT Explorer. Subscribe to your broker. Move your camera left and watch what topic is written to and what the message is.

Omg, it worked! I only thought that the tool would have to be installed on HA itself. The logger there only listens to recieved messaged. These two were the ones I was looking for…

Now all is needed to implement it to lovelace via a service or somehow else :slight_smile:

1 Like

A script using the mqtt publish service can be called from the tap action of a button.

Yes! I just did that, thanks Tom you helped a lot. For anybody interested here is an example:


1 Like