MQTT Device not appearing

I have a correctly installed HomeAssistant ( 0.112.4) running in Docker with a separate Mosquitto instance, also running in Docker. They have their own static IP addresses. within the house are a large number of Sonoff/Tasmota devices. These are configured using autodiscovery, and work fine.

I now need to configure a MQTT device with a couple of switch and sensors. I want to be able to control a custom application that will be running on a Raspberry Pi.

The ‘Entity’ refuses to appear in HA. I can get the devices (switch and sensor) to appear, but the DEVICE refuses to appear.

This is the latest iteration of the config. What is wrong with it, please?

Many thanks, and sorry if this post contains too much/not enough information.

mqtt:
  broker:   192.168.0.4
  port:     1883
  discovery: true
  discovery_prefix: homeassistant

switch:
  - platform: mqtt
    unique_id: = 12345711
    name: "paho2/switch"  
    state_topic: "paho2/RESULT"
    command_topic: "cmnd/paho2/POWER"
    device:
        identifiers: ["12345641"] 
        manufacturer: "Raspberry"

After struggling with this for a while, I finally understood that the device registration only works with MQTT discovery (i.e. in response to a config message over MQTT) and not via the configuration files. It does say this in the docs (MQTT Switch - Home Assistant) but I don’t think it’s very clear for a newcomer.

My follow up: Device registration via MQTT configuration