MQTT Switch and multiple JSON value publish message

I have MQTT service to control stepper motors, JSON status message look like { “1”:“ON” “2”:“OFF” “3”:“ON” }
I have 3 MQTT Switch components in HA.
I would like to publish full JSON message with all switches status on every switch change.
Is it possible to create payload_off and payload_on template like this ? { “1”:switch1_status “2”:switch2_status “3”:switch3_status }

Is there another way ?

1 Like