Initial state Mqtt switch

Hi all,

How can I config a Mqtt switch with a initial state?
When I restart HA the switch become “unknown” and I want that those switches get state “off”

- platform: mqtt
  name: "Vacation"
  unique_id: "Vacation"
  command_topic: "homeassistant/other/holiday"
  state_topic: "homeassistant/other/holiday"
  icon: mdi:palm-tree
  payload_on: "1"
  payload_off: "0"
  state_on: "1"
  state_off: "0"
  optimistic: false
  qos: 1
  retain: true
3 Likes