def METHOD_NAME(component_type: str,
                address: str,
                bat_module: str,
                bat_ip: str,
                bat_username: str,
                bat_password: str,
                num: Optional[int] = None) -> None:
    dev = Device(KostalPiko(configuration=KostalPikoConfiguration(ip_address=address)))
    if component_type in COMPONENT_TYPE_TO_MODULE:
        component_config = COMPONENT_TYPE_TO_MODULE[component_type].component_descriptor.configuration_factory()
    else:
        raise Exception(
            "illegal component type " + component_type + ". Allowed values: " +
            ','.join(COMPONENT_TYPE_TO_MODULE.keys())
        )
    component_config.id = num
    if isinstance(component_config, KostalPikoInverterSetup) and bat_module != "none":
        component_config.configuration.bat_configured = True
    dev.add_component(component_config)
    log.debug('KostalPiko IP-Adresse: ' + address)
    log.debug('KostalPiko Speicher: ' + bat_module)
    if isinstance(component_config, KostalPikoInverterSetup):
        dev.update()
    elif isinstance(component_config, KostalPikoCounterSetup):
        with SingleComponentUpdateContext(dev.components["componentNone"].component_info):
            home_consumption, powers = dev.components["componentNone"].get_values()
            if bat_module == "speicher_bydhv":
                bat_power = _get_byd_bat_power(bat_ip, bat_username, bat_password, 1)
                home_consumption += bat_power
            dev.add_component(KostalPikoInverterSetup(
                id=1, configuration=KostalPikoInverterConfiguration(bat_configured=True)))
            inverter_power, _ = dev.components["component"+str(1)].update()
            power = home_consumption + inverter_power
            imported, exported = sim_count(power, prefix="bezug")
            counter_state = CounterState(
                imported=imported,
                exported=exported,
                power=power,
                powers=powers
            )
            get_counter_value_store(None).set(counter_state)