Controlling a servo motor (SG90) direct from HA

I’m using a Raspberry Pi, with Hassbian OS, and want to control a servo motor direct from HA.
After searching, I think the good way to do it is using MQTT cover, I know the code that could be written in config.yaml, the problem that I don’t know what to write in python code, or how to control the motor through MQTT, any help is hugely appreciated.

Will the servo be plug into the Pi or on a difference board like a esp8266 if so have you tried esp-home

No, it plugged direct to the Pi

If any one can help pleas

  - platform: mqtt
    name: "MQTT Cover"
    command_topic: "home-assistant/cover/set"
    state_topic: "home-assistant/cover/state"
    availability_topic: "home-assistant/cover/availability"
    qos: 0
    retain: true
    payload_open: "OPEN"
    payload_close: "CLOSE"
    payload_stop: "STOP"
    state_open: "open"
    state_closed: "closed"
    payload_available: "online"
    payload_not_available: "offline"
    optimistic: false
    value_template: '{{ value.x }}'
    tilt_command_topic: 'home-assistant/cover/tilt'
    tilt_status_topic: 'home-assistant/cover/tilt-state'
    tilt_min: 0
    tilt_max: 180
    tilt_closed_value: 70
    tilt_opened_value: 180

This is my configuration.yaml and I don’t know what is the python code to use with that one

any one help me pleas