def METHOD_NAME(
        component_type: str,
        ip_address: str,
        meter_id: int,
        variant: int,
        ip_address2: str = "none",
        num: Optional[int] = None) -> None:
    device_config = Fronius()
    device_config.configuration.ip_address = ip_address
    dev = Device(device_config)
    if component_type in COMPONENT_TYPE_TO_MODULE:
        component_config = COMPONENT_TYPE_TO_MODULE[component_type].component_descriptor.configuration_factory()
        if component_type == "bat":
            component_config.configuration.meter_id = meter_id
        elif component_type == "counter_sm":
            component_config.configuration.variant = variant
            component_config.configuration.meter_id = meter_id
    else:
        raise Exception(
            "illegal component type " + component_type + ". Allowed values: " +
            ','.join(COMPONENT_TYPE_TO_MODULE.keys())
        )
    component_config.id = num
    dev.add_component(component_config)
    log.debug('Fronius IP-Adresse: ' + ip_address)
    if component_type == "bat" or "counter" in component_type:
        dev.update()
    elif component_type == "inverter" and num:
        inverter1 = inverter.FroniusInverter(num, component_config, dev.device_config.configuration)
        with SingleComponentUpdateContext(inverter1.component_info):
            total_power = inverter1.read_power()
            if ip_address2 != "none":
                dev.device_config.configuration.ip_address = ip_address2
                inverter2 = inverter.FroniusInverter(num, component_config, dev.device_config.configuration)
                total_power += inverter2.read_power()
            get_inverter_value_store(num).set(inverter1.fill_inverter_state(total_power))
    else:
        raise Exception("illegal component num " + str(num) + ". Should be an int if it is an inverter.")