The “state” part of the binding above is actually part of the topic name. It could be anything. The “command” part of the above is to indicate that when this Item receives a command from OH to send a message to the topic. The “ON” and “OFF” part specifies which command received corresponds to which binding config. The “1” and “0” part indicates what the message to publish should be.
So the the binding means in English:
When the office_panel receives an ON command send the message “1” to the “office/switch1/state” topic on the mosquitto broker.
When the office_panel receives an OFF command send the message “0” to the “office/switch1/state” topic on the mosquitto broker.
This Item set up with outbound MQTT binding configs only. When office_panel receives a command the MQTT binding will send the appropriate message to the topic. You can read the state of office_panel from your rules but it doesn’t really necessarily reflect the state of the actual switch because you don’t have any incoming messages. If someone or something else switches the switch OH will not know about it.
Are you talking about mosquitto config or OH config. In OH, MQTT persistence is not necessary. In mosquitto it depends on whether you want to guarantee that OH receives all messages even if it happens to be down when the message is sent. Most likely the answer is no.
When possible it is best for the device to report its status if it can be controlled outside of OH. However, you will need to add an incoming binding config to your Item along the lines of:
This line means for any messages published to the topic “office/switch1/state” set the state of office_panel to the message.
The Switch Item is smart enough to convert “1” to ON and “0” to OFF for you so you do not need to specify a transform.