def discovery_topic(topic_prefix: str, component: str, device_id: str) -> str:
    """
    Create discovery topic based on device, follows definition from Home Assistant:
    <topic_prefix>/<component>/<device_id>/config

    Details: https://www.home-assistant.io/docs/mqtt/discovery/
    """
    return "{}/{}/{}/config".format(topic_prefix, component, device_id)