Hello, as the title says: I need to find a way to modify MQTT messages before they reach the MQTT server. I already tried Node-RED but this didn't intercept the messages but rather sent an extra message along with the original one which is not what I want.
The reason for wanting to achieve this is I have bulbs that do not work properly with a single .json that has both "state" on/off and "color" attributes. I need to send the "color"/etc. attributes first before I send "state" for a smooth transition. Right now HA is sending both "state" and "color" in the same message by default.
I have also looked at the option of disabling autodiscovery and adding all lights manually but this is a tedious, long process which I do not want to do.
Ideally I would like to edit the MQTT integration files so that I can edit the default command that is being sent and split it into two commands. Does anyone have any experience with this?