def get_device_uid_from_element_uid(element_uid: str) ->str:
    """
    Return device UID from the given element UID.

    :param element_uid: Element UID, something like devolo.MultiLevelSensor:hdm:ZWave:CBC56091/24#2
    :return: Device UID, something like hdm:ZWave:CBC56091/24
    """
    element_uid = element_uid.split(':', 1)[1].split('#')[0]
    if element_uid.endswith('secure'):
        return element_uid.rsplit(':', 1)[0]
    return element_uid
