import re


def extract_name_from_zeroconf(zeroconf_name):
    """
    helper function to extract ESS name from zeroconf host name
    :param zeroconf_name:
    :return: name
    """
    name = re.sub(r"LGE_ESS-(.+)\._pmsctrl\._tcp\.local\.", r"\g<1>", zeroconf_name)
    return name