I have had to create a status group of topics and a control group of identical topics for MQTT device management. This is due to the local code controlling the device, and then sending an update to the topic that the status was changed.
For example: Lights are 0 for off and 1 for on. If the arduino receives a 0 or 1, it sets the lights accordingly and then publishes the new status (0 or 1). Since it is subscribed to the topic, it sees its own published content, then updates the device again, and publishes...repeat.
It was easy to create a "control" topic that avoids this (Home/Lights and Home/Control/Lights for example), but that makes node red more complex than needed to create a web UI.
Is there a way to have the pubsubclient not process MQTT publications from the local client? The callback function appears to only give me topic and payload.